fix: specify varchar(255) for slug columns to fix MySQL unique index error
Docker Build / Build and Push Docker Image (push) Successful in 4m11s
Docker Build / Build and Push Docker Image (push) Successful in 4m11s
This commit is contained in:
+1
-1
@@ -7,7 +7,7 @@ import (
|
||||
type Document struct {
|
||||
Id int `json:"id" gorm:"primaryKey"`
|
||||
Title string `json:"title" gorm:"not null"`
|
||||
Slug string `json:"slug" gorm:"uniqueIndex;not null"`
|
||||
Slug string `json:"slug" gorm:"type:varchar(255);uniqueIndex;not null"`
|
||||
Content string `json:"content" gorm:"type:text;not null"`
|
||||
CategoryId *int `json:"category_id" gorm:"index"`
|
||||
Visibility string `json:"visibility" gorm:"default:'public'"` // public, auth, admin
|
||||
|
||||
@@ -7,7 +7,7 @@ import (
|
||||
type DocumentCategory struct {
|
||||
Id int `json:"id" gorm:"primaryKey"`
|
||||
Name string `json:"name" gorm:"not null"`
|
||||
Slug string `json:"slug" gorm:"uniqueIndex;not null"`
|
||||
Slug string `json:"slug" gorm:"type:varchar(255);uniqueIndex;not null"`
|
||||
ParentId *int `json:"parent_id" gorm:"index"`
|
||||
SortOrder int `json:"sort_order" gorm:"default:0"`
|
||||
CreatedAt time.Time `json:"created_at" gorm:"autoCreateTime"`
|
||||
|
||||
Reference in New Issue
Block a user