diff options
Diffstat (limited to 'cmd/web/model/tag.go')
-rw-r--r-- | cmd/web/model/tag.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/cmd/web/model/tag.go b/cmd/web/model/tag.go new file mode 100644 index 0000000..db38a07 --- /dev/null +++ b/cmd/web/model/tag.go @@ -0,0 +1,9 @@ +package model + +import "gorm.io/gorm" + +type Tag struct { + gorm.Model + Name string `gorm:"uniqueIndex"` + Articles []Article `gorm:"many2many:article_tag;"` +} |