Add tags to model
This commit is contained in:
parent
870ea05911
commit
e29aab0b9d
2 changed files with 19 additions and 0 deletions
|
|
@ -56,6 +56,8 @@ func GetDatabase() (*gorm.DB, error) {
|
||||||
&models.ListItem{},
|
&models.ListItem{},
|
||||||
&models.Field{},
|
&models.Field{},
|
||||||
&models.FieldValue{},
|
&models.FieldValue{},
|
||||||
|
&models.Tag{},
|
||||||
|
&models.PersonTag{},
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return database, err
|
return database, err
|
||||||
|
|
|
||||||
17
models/tags.go
Normal file
17
models/tags.go
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
package models
|
||||||
|
|
||||||
|
import "gorm.io/gorm"
|
||||||
|
|
||||||
|
type Tag struct {
|
||||||
|
gorm.Model
|
||||||
|
Name string
|
||||||
|
Color string
|
||||||
|
}
|
||||||
|
|
||||||
|
type PersonTag struct {
|
||||||
|
gorm.Model
|
||||||
|
PersonID uint
|
||||||
|
Person Person
|
||||||
|
TagID uint
|
||||||
|
Tag Tag
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue