All checks were successful
Server CI/CD / deploy (push) Successful in 38s
longtext 타입은 MySQL에서 uniqueIndex를 걸 수 없어 AutoMigrate 실패 및 announcements 테이블 미생성 문제 해결 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
18 lines
303 B
Go
18 lines
303 B
Go
package auth
|
|
|
|
import "gorm.io/gorm"
|
|
|
|
type Role string
|
|
|
|
const (
|
|
RoleAdmin Role = "admin"
|
|
RoleUser Role = "user"
|
|
)
|
|
|
|
type User struct {
|
|
gorm.Model
|
|
Username string `gorm:"type:varchar(100);uniqueIndex;not null"`
|
|
PasswordHash string `gorm:"not null"`
|
|
Role Role `gorm:"default:'user'"`
|
|
}
|