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,21 +1,21 @@
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 {
collections, err := basicRelationCollection(app, models.PARTIALS_TABLE, models.AGENTS_TABLE, models.AGENT_RELATIONS)
collections, err := basicRelationCollection(app, dbmodels.PARTIALS_TABLE, dbmodels.AGENTS_TABLE, dbmodels.AGENT_RELATIONS)
if err != nil {
return err
}
return app.Save(collections)
}, func(app core.App) error {
collection, err := app.FindCollectionByNameOrId(models.RelationTableName(models.PARTIALS_TABLE, models.AGENTS_TABLE))
collection, err := app.FindCollectionByNameOrId(dbmodels.RelationTableName(dbmodels.PARTIALS_TABLE, dbmodels.AGENTS_TABLE))
if err != nil {
return nil
}