mirror of
https://github.com/Theodor-Springmann-Stiftung/musenalm.git
synced 2025-10-28 16:55:32 +00:00
Exemplare -> Items
This commit is contained in:
10
dbmodels/common.go
Normal file
10
dbmodels/common.go
Normal file
@@ -0,0 +1,10 @@
|
||||
package dbmodels
|
||||
|
||||
type AnnotatioNotes struct {
|
||||
Annotation string `json:",omitempty" db:"annotation"`
|
||||
Notes string `json:",omitempty" db:"edit_comment"`
|
||||
}
|
||||
|
||||
type FieldMetaData struct {
|
||||
MetaData MetaData `json:",omitempty" db:"edit_fielddata"`
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package dbmodels
|
||||
|
||||
type Exemplar struct {
|
||||
Location string `json:",omitempty"`
|
||||
Identifier string `json:",omitempty"`
|
||||
Annotation string `json:",omitempty"`
|
||||
Condition string `json:",omitempty"`
|
||||
Owner string `json:",omitempty"`
|
||||
Media string `json:",omitempty"`
|
||||
}
|
||||
20
dbmodels/item.go
Normal file
20
dbmodels/item.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package dbmodels
|
||||
|
||||
import "github.com/pocketbase/pocketbase/core"
|
||||
|
||||
type Item struct {
|
||||
core.BaseModel
|
||||
Entry string `json:",omitempty" db:"entries"`
|
||||
Identifier string `json:",omitempty" db:"identifier"`
|
||||
Location string `json:",omitempty" db:"location"`
|
||||
Owner string `json:",omitempty" db:"owner"`
|
||||
Media string `json:",omitempty" db:"media"`
|
||||
Condition string `json:",omitempty" db:"condition"`
|
||||
Scans string `json:",omitempty" db:"scans"`
|
||||
Uri string `json:",omitempty" db:"uri"`
|
||||
AnnotatioNotes
|
||||
}
|
||||
|
||||
func (i *Item) TableName() string {
|
||||
return ITEMS_TABLE
|
||||
}
|
||||
18
migrations/1739119777_settings.go
Normal file
18
migrations/1739119777_settings.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"github.com/pocketbase/pocketbase/core"
|
||||
m "github.com/pocketbase/pocketbase/migrations"
|
||||
)
|
||||
|
||||
func init() {
|
||||
m.Register(func(app core.App) error {
|
||||
// add up queries...
|
||||
|
||||
return nil
|
||||
}, func(app core.App) error {
|
||||
// add down queries...
|
||||
|
||||
return nil
|
||||
})
|
||||
}
|
||||
@@ -66,10 +66,10 @@ func ItemsFromBändeAndBIBLIO(
|
||||
}
|
||||
}
|
||||
|
||||
var exemlist []dbmodels.Exemplar
|
||||
var exemlist []dbmodels.Item
|
||||
|
||||
if band.BiblioID != 0 {
|
||||
exem := dbmodels.Exemplar{Identifier: strconv.Itoa(band.BiblioID)}
|
||||
exem := dbmodels.Item{Identifier: strconv.Itoa(band.BiblioID)}
|
||||
if e, ok := biblio[band.BiblioID]; ok {
|
||||
exem.Location = strings.TrimSpace(e.Standort)
|
||||
exem.Condition = strings.TrimSpace(e.Zustand)
|
||||
@@ -84,7 +84,7 @@ func ItemsFromBändeAndBIBLIO(
|
||||
}
|
||||
|
||||
for nr, m := range t {
|
||||
exem := dbmodels.Exemplar{Identifier: nr}
|
||||
exem := dbmodels.Item{Identifier: nr}
|
||||
|
||||
no, err := strconv.Atoi(strings.TrimSpace(nr))
|
||||
message := strings.TrimSpace(m)
|
||||
|
||||
Reference in New Issue
Block a user