Line data Source code
1 : // Package entity は ユーザーの変数を表すドメインエンティティです
2 : package entity
3 :
4 : import (
5 : "time"
6 :
7 : "gorm.io/gorm"
8 : )
9 :
10 : // UserVariable はユーザーの変数を表すドメインエンティティです
11 : type UserVariable struct {
12 : ID uint64 `gorm:"primaryKey;autoIncrement"`
13 : UserID uint64 `gorm:"not null"`
14 : VariableText string `gorm:"size:160;not null"`
15 : VariableTextNorm string `gorm:"size:160;not null"`
16 : SortOrder int `gorm:"not null;default:0;index"`
17 : CreatedAt time.Time `gorm:"autoCreateTime"`
18 : UpdatedAt time.Time `gorm:"autoUpdateTime"`
19 : DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;index"`
20 : }
21 :
22 : // TableName は テーブル名を返すメソッド
23 0 : func (UserVariable) TableName() string { return "user_variables" }
|