You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The below name is allowed :
type Patient struct {
ID string json:"id" gorm:"primaryKey;column:id;"
Name string json:"name" gorm:"column:name"
Age int json:"age" gorm:"check:'chk_age_nine',age>99;column:age"
Gender string json:"gender" gorm:"column:gender"
CreatedAt int // Set to current time if it is zero on creating
UpdatedAt int // Set to current unix seconds on updating or if it is zero on creating
Deleted gorm.DeletedAt
}
Expected answer
The below name throws error :
type Patient struct {
ID string json:"id" gorm:"primaryKey;column:id;"
Name string json:"name" gorm:"column:name"
Age int json:"age" gorm:"check:'chk_age_99',age>99;column:age"
Gender string json:"gender" gorm:"column:gender"
CreatedAt int // Set to current time if it is zero on creating
UpdatedAt int // Set to current unix seconds on updating or if it is zero on creating
Deleted gorm.DeletedAt
}
The text was updated successfully, but these errors were encountered:
Document Link
Your Question
The below name is allowed :
type Patient struct {
ID string
json:"id" gorm:"primaryKey;column:id;"
Name string
json:"name" gorm:"column:name"
Age int
json:"age" gorm:"check:'chk_age_nine',age>99;column:age"
Gender string
json:"gender" gorm:"column:gender"
CreatedAt int // Set to current time if it is zero on creating
UpdatedAt int // Set to current unix seconds on updating or if it is zero on creating
Deleted gorm.DeletedAt
}
Expected answer
The below name throws error :
type Patient struct {
ID string
json:"id" gorm:"primaryKey;column:id;"
Name string
json:"name" gorm:"column:name"
Age int
json:"age" gorm:"check:'chk_age_99',age>99;column:age"
Gender string
json:"gender" gorm:"column:gender"
CreatedAt int // Set to current time if it is zero on creating
UpdatedAt int // Set to current unix seconds on updating or if it is zero on creating
Deleted gorm.DeletedAt
}
The text was updated successfully, but these errors were encountered: