updates migrations

This commit is contained in:
Christian Beutel
2025-03-17 00:03:56 +01:00
parent c765e6391d
commit eca79758ec
130 changed files with 2107 additions and 2758 deletions

View File

@@ -1,17 +1,15 @@
package migrations
import (
"github.com/pocketbase/dbx"
"github.com/pocketbase/pocketbase/daos"
"github.com/pocketbase/pocketbase/core"
m "github.com/pocketbase/pocketbase/migrations"
"github.com/pocketbase/pocketbase/tools/types"
)
func init() {
m.Register(func(db dbx.Builder) error {
dao := daos.New(db);
m.Register(func(app core.App) error {
collection, err := dao.FindCollectionByNameOrId("_pb_users_auth_")
collection, err := app.FindCollectionByNameOrId("_pb_users_auth_")
if err != nil {
return err
}
@@ -20,11 +18,10 @@ func init() {
collection.ViewRule = types.Pointer("id = @request.auth.id")
return dao.SaveCollection(collection)
}, func(db dbx.Builder) error {
dao := daos.New(db);
return app.Save(collection)
}, func(app core.App) error {
collection, err := dao.FindCollectionByNameOrId("_pb_users_auth_")
collection, err := app.FindCollectionByNameOrId("_pb_users_auth_")
if err != nil {
return err
}
@@ -33,6 +30,6 @@ func init() {
collection.ViewRule = types.Pointer("@request.auth.id != \"\"")
return dao.SaveCollection(collection)
return app.Save(collection)
})
}