github.com/octohelm/storage@v0.0.0-20240516030302-1ac2cc1ea347/testdata/model/user.go (about)

     1  package model
     2  
     3  // User
     4  // +gengo:table
     5  // @def primary ID
     6  // @def unique_index i_name Name DeletedAt
     7  // @def unique_index i_age Age DeletedAt
     8  // @def index i_nickname Nickname
     9  // @def index i_created_at CreatedAt
    10  type User struct {
    11  	ID uint64 `db:"f_id,autoincrement"`
    12  	// 姓名
    13  	Name     string `db:"f_name,size=255,default=''"`
    14  	Nickname string `db:"f_nickname,size=255,default=''"`
    15  	Username string `db:"f_username,default=''"`
    16  	Gender   Gender `db:"f_gender,default='0'"`
    17  	Age      int64  `db:"f_age,default='0'"`
    18  	OperateTimeWithDeleted
    19  }