adds notifications

This commit is contained in:
Christian Beutel
2024-12-21 03:24:36 +01:00
parent 034f6873c1
commit 9140b523da
39 changed files with 1613 additions and 142 deletions

View File

@@ -0,0 +1,76 @@
package migrations
import (
"encoding/json"
"github.com/pocketbase/dbx"
"github.com/pocketbase/pocketbase/daos"
m "github.com/pocketbase/pocketbase/migrations"
"github.com/pocketbase/pocketbase/models/schema"
)
func init() {
m.Register(func(db dbx.Builder) error {
dao := daos.New(db);
collection, err := dao.FindCollectionByNameOrId("1kot7t9na3hi0gl")
if err != nil {
return err
}
// update
edit_list := &schema.SchemaField{}
if err := json.Unmarshal([]byte(`{
"system": false,
"id": "luqrtipy",
"name": "list",
"type": "relation",
"required": true,
"presentable": false,
"unique": false,
"options": {
"collectionId": "r6gu2ajyidy1x69",
"cascadeDelete": true,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
}`), edit_list); err != nil {
return err
}
collection.Schema.AddField(edit_list)
return dao.SaveCollection(collection)
}, func(db dbx.Builder) error {
dao := daos.New(db);
collection, err := dao.FindCollectionByNameOrId("1kot7t9na3hi0gl")
if err != nil {
return err
}
// update
edit_list := &schema.SchemaField{}
if err := json.Unmarshal([]byte(`{
"system": false,
"id": "luqrtipy",
"name": "list",
"type": "relation",
"required": true,
"presentable": false,
"unique": false,
"options": {
"collectionId": "r6gu2ajyidy1x69",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
}`), edit_list); err != nil {
return err
}
collection.Schema.AddField(edit_list)
return dao.SaveCollection(collection)
})
}