2022-11-17 10:09:18 +08:00
|
|
|
package migrations
|
|
|
|
|
|
|
|
import (
|
2023-07-13 16:16:13 +08:00
|
|
|
"context"
|
2022-11-17 10:09:18 +08:00
|
|
|
"xorm.io/xorm"
|
|
|
|
)
|
|
|
|
|
2023-07-13 16:16:13 +08:00
|
|
|
func addTagRecommendedAndReserved(ctx context.Context, x *xorm.Engine) error {
|
2022-11-17 10:09:18 +08:00
|
|
|
type Tag struct {
|
2022-12-15 14:39:16 +08:00
|
|
|
ID string `xorm:"not null pk comment('tag_id') BIGINT(20) id"`
|
|
|
|
SlugName string `xorm:"not null default '' unique VARCHAR(35) slug_name"`
|
|
|
|
Recommend bool `xorm:"not null default false BOOL recommend"`
|
|
|
|
Reserved bool `xorm:"not null default false BOOL reserved"`
|
2022-11-17 10:09:18 +08:00
|
|
|
}
|
2023-07-13 16:16:13 +08:00
|
|
|
return x.Context(ctx).Sync(new(Tag))
|
2022-11-17 10:09:18 +08:00
|
|
|
}
|