Files
a301_server/internal/auth/model.go
tolelom bf17d4d1da
All checks were successful
Server CI/CD / deploy (push) Successful in 38s
fix: username 컬럼 타입을 varchar(100)으로 명시
longtext 타입은 MySQL에서 uniqueIndex를 걸 수 없어
AutoMigrate 실패 및 announcements 테이블 미생성 문제 해결

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-24 14:24:37 +09:00

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'"`
}