adds email notifications

This commit is contained in:
Christian Beutel
2025-01-04 14:24:00 +01:00
parent 72d2bf6062
commit 788690086e
15 changed files with 666 additions and 373 deletions

View File

@@ -86,7 +86,7 @@ func init() {
return daos.New(db).SaveCollection(collection)
}, func(db dbx.Builder) error {
dao := daos.New(db);
dao := daos.New(db)
collection, err := dao.FindCollectionByNameOrId("urytyc428mwlbqq")
if err != nil {

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("r6gu2ajyidy1x69")
if err != nil {
return err
}
// update
edit_author := &schema.SchemaField{}
if err := json.Unmarshal([]byte(`{
"system": false,
"id": "kwm6zdet",
"name": "author",
"type": "relation",
"required": true,
"presentable": false,
"unique": false,
"options": {
"collectionId": "_pb_users_auth_",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
}`), edit_author); err != nil {
return err
}
collection.Schema.AddField(edit_author)
return dao.SaveCollection(collection)
}, func(db dbx.Builder) error {
dao := daos.New(db);
collection, err := dao.FindCollectionByNameOrId("r6gu2ajyidy1x69")
if err != nil {
return err
}
// update
edit_author := &schema.SchemaField{}
if err := json.Unmarshal([]byte(`{
"system": false,
"id": "kwm6zdet",
"name": "author",
"type": "relation",
"required": false,
"presentable": false,
"unique": false,
"options": {
"collectionId": "_pb_users_auth_",
"cascadeDelete": false,
"minSelect": null,
"maxSelect": 1,
"displayFields": null
}
}`), edit_author); err != nil {
return err
}
collection.Schema.AddField(edit_author)
return dao.SaveCollection(collection)
})
}