Places, Agents, Serials, Entries

This commit is contained in:
Simon Martens
2025-02-08 15:24:13 +01:00
parent f4cbb037e0
commit cfce7a2dc7
32 changed files with 451342 additions and 154 deletions

View File

@@ -1,23 +1,23 @@
package migrations
import (
"github.com/Theodor-Springmann-Stiftung/musenalm/models"
"github.com/Theodor-Springmann-Stiftung/musenalm/dbmodels"
"github.com/pocketbase/pocketbase/core"
m "github.com/pocketbase/pocketbase/migrations"
)
func init() {
m.Register(func(app core.App) error {
collection, err := basicRelationCollection(app, models.ENTRIES_TABLE, models.SERIES_TABLE, models.SERIES_RELATIONS)
collection, err := basicRelationCollection(app, dbmodels.ENTRIES_TABLE, dbmodels.SERIES_TABLE, dbmodels.SERIES_RELATIONS)
if err != nil {
return err
}
collection.Fields.Add(&core.TextField{Name: models.NUMBERING_FIELD, Required: false, Presentable: true})
collection.Fields.Add(&core.TextField{Name: dbmodels.NUMBERING_FIELD, Required: false, Presentable: true})
return app.Save(collection)
}, func(app core.App) error {
collection, err := app.FindCollectionByNameOrId(models.RelationTableName(models.ENTRIES_TABLE, models.SERIES_TABLE))
collection, err := app.FindCollectionByNameOrId(dbmodels.RelationTableName(dbmodels.ENTRIES_TABLE, dbmodels.SERIES_TABLE))
if err != nil {
return nil
}