diff options
| author | roerick <roerick@wyo.town> | 2025-10-17 15:32:59 -0600 |
|---|---|---|
| committer | roerick <roerick@wyo.town> | 2025-10-17 15:32:59 -0600 |
| commit | a1c3883334a9c54358173ebd822a5a85036dcda6 (patch) | |
| tree | 341f78d3fd276ce92fe9bcdebf6c023c6763c6a0 /models/models.go | |
| parent | ce61d3db96e0539c8df1886ac635e7e85dbde31f (diff) | |
Removed users and comments
Diffstat (limited to 'models/models.go')
| -rw-r--r-- | models/models.go | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/models/models.go b/models/models.go index 1ccf37f..355851a 100644 --- a/models/models.go +++ b/models/models.go @@ -1,14 +1,5 @@ package models - -type User struct { - ID uint `gorm:"primaryKey" json:"id"` - Username string `gorm:"unique;not null" json:"username"` - Password string `gorm:"not null" json:"-"` - Blogs []Blog `gorm:"foreignKey:UserID" json:"blogs"` - Comments []Comment `gorm:"foreignKey:UserID" json:"comments"` -} - type Blog struct { ID uint `gorm:"primaryKey" json:"id"` Title string `gorm:"not null" json:"title"` @@ -18,13 +9,3 @@ type Blog struct { Comments []Comment `gorm:"foreignKey:BlogID" json:"comments"` } -type Comment struct { - ID uint `gorm:"primaryKey" json:"id"` - Content string `gorm:"not null" json:"content"` - UserID uint `gorm:"not null" json:"user_id"` - BlogID uint `gorm:"not null" json:"blog_id"` - User User `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;" json:"user"` - Blog Blog `gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;" json:"blog"` -} - - |
