mirror of
https://github.com/pocketbase/pocketbase.git
synced 2026-10-10 00:07:27 +02:00
enabled __hooks in the jsvm migrations
This commit is contained in:
1 parent
95787da4df
commit
58b564557f
3 files changed
+7
-3
No files matched your search
@@ -184,6 +184,11 @@ func (p *plugin) registerMigrations() error {
|
||||
return err
|
||||
}
|
||||
|
||||
absHooksDir, err := filepath.Abs(p.config.HooksDir)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
registry := new(require.Registry) // this can be shared by multiple runtimes
|
||||
templateRegistry := template.NewRegistry()
|
||||
|
||||
@@ -206,6 +211,7 @@ func (p *plugin) registerMigrations() error {
|
||||
mailsBinds(vm)
|
||||
|
||||
vm.Set("$template", templateRegistry)
|
||||
vm.Set("__hooks", absHooksDir)
|
||||
|
||||
vm.Set("migrate", func(up, down func(txApp core.App) error) {
|
||||
core.AppMigrations.Register(up, down, file)
|
||||
|
||||
Reference in new issue
Block a user