Functions into dbmodels, introduced air

This commit is contained in:
Simon Martens
2025-02-11 13:10:48 +01:00
parent ad91cbd4c6
commit 420fff6daa
16 changed files with 237 additions and 140 deletions

View File

@@ -32,7 +32,7 @@ func init() {
func entriesTable() *core.Collection {
collection := core.NewBaseCollection(dbmodels.ENTRIES_TABLE)
setBasicPublicRules(collection)
dbmodels.SetBasicPublicRules(collection)
return collection
}
@@ -106,24 +106,24 @@ func entriesFields(app core.App) *core.FieldsList {
&core.JSONField{Name: dbmodels.MUSENALM_DEPRECATED_FIELD, Required: false},
)
setMusenalmIDField(&fields)
setEditorStateField(&fields)
setNotesAndAnnotationsField(&fields)
dbmodels.SetMusenalmIDField(&fields)
dbmodels.SetEditorStateField(&fields)
dbmodels.SetNotesAndAnnotationsField(&fields)
return &fields
}
func entriesIndexes(collection *core.Collection) {
addMusenalmIDIndex(collection)
addIndex(collection, dbmodels.PREFERRED_TITLE_FIELD, false)
addIndex(collection, dbmodels.VARIANT_TITLE_FIELD, false)
addIndex(collection, dbmodels.PARALLEL_TITLE_FIELD, false)
addIndex(collection, dbmodels.TITLE_STMT_FIELD, false)
addIndex(collection, dbmodels.SUBTITLE_STMT_FIELD, false)
addIndex(collection, dbmodels.INCIPIT_STMT_FIELD, false)
addIndex(collection, dbmodels.RESPONSIBILITY_STMT_FIELD, false)
addIndex(collection, dbmodels.PLACE_STMT_FIELD, false)
addIndex(collection, dbmodels.PUBLICATION_STMT_FIELD, false)
addIndex(collection, dbmodels.YEAR_FIELD, false)
addIndex(collection, dbmodels.EDITION_FIELD, false)
dbmodels.AddMusenalmIDIndex(collection)
dbmodels.AddIndex(collection, dbmodels.PREFERRED_TITLE_FIELD, false)
dbmodels.AddIndex(collection, dbmodels.VARIANT_TITLE_FIELD, false)
dbmodels.AddIndex(collection, dbmodels.PARALLEL_TITLE_FIELD, false)
dbmodels.AddIndex(collection, dbmodels.TITLE_STMT_FIELD, false)
dbmodels.AddIndex(collection, dbmodels.SUBTITLE_STMT_FIELD, false)
dbmodels.AddIndex(collection, dbmodels.INCIPIT_STMT_FIELD, false)
dbmodels.AddIndex(collection, dbmodels.RESPONSIBILITY_STMT_FIELD, false)
dbmodels.AddIndex(collection, dbmodels.PLACE_STMT_FIELD, false)
dbmodels.AddIndex(collection, dbmodels.PUBLICATION_STMT_FIELD, false)
dbmodels.AddIndex(collection, dbmodels.YEAR_FIELD, false)
dbmodels.AddIndex(collection, dbmodels.EDITION_FIELD, false)
}