Adding upstream version 0.28.1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
88f1d47ab6
commit
e28c88ef14
933 changed files with 194711 additions and 0 deletions
35
migrations/1717233557_v0.23_migrate2.go
Normal file
35
migrations/1717233557_v0.23_migrate2.go
Normal file
|
@ -0,0 +1,35 @@
|
|||
package migrations
|
||||
|
||||
import (
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
)
|
||||
|
||||
// note: this migration will be deleted in future version
|
||||
|
||||
func init() {
|
||||
core.SystemMigrations.Register(func(txApp core.App) error {
|
||||
_, err := txApp.DB().NewQuery("CREATE INDEX IF NOT EXISTS idx__collections_type on {{_collections}} ([[type]]);").Execute()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// reset mfas and otps delete rule
|
||||
collectionNames := []string{core.CollectionNameMFAs, core.CollectionNameOTPs}
|
||||
for _, name := range collectionNames {
|
||||
col, err := txApp.FindCollectionByNameOrId(name)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if col.DeleteRule != nil {
|
||||
col.DeleteRule = nil
|
||||
err = txApp.SaveNoValidate(col)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}, nil)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue