Documentation ¶
Index ¶
Constants ¶
View Source
const ( GenderMale = true GenderFemale = false )
View Source
const ( LanguageCodeRussian = "RU" LanguageCodeEnglish = "EN" )
Variables ¶
View Source
var DB *gorm.DB
Functions ¶
Types ¶
type BaseModel ¶
type BaseModel struct { ID uuid.UUID `gorm:"column:id;primaryKey;type:uuid;not null"` CreatedAt time.Time `gorm:"column:created_at;type:timestamp without time zone;not null;index"` UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp without time zone;not null"` DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;type:timestamp without time zone;default:null;index"` }
type Customer ¶
type Customer struct { BaseModel FirstName string `gorm:"column:first_name;type:varchar(100);not null"` LastName string `gorm:"column:last_name;type:varchar(100);not null"` BirthDate time.Time `gorm:"column:birth_date;type:date;not null"` Gender bool `gorm:"column:gender;type:boolean;not null"` Email string `gorm:"column:email;type:varchar(255);not null;index:idx_customers_email_user_id_unique,unique"` Address *string `gorm:"column:address;type:varchar(200);default:null"` UserID uuid.UUID `gorm:"column:user_id;type:uuid;not null;index:idx_customers_email_user_id_unique,unique;index"` }
type User ¶
type User struct { BaseModel Email string `gorm:"column:email;type:varchar(255);not null;uniqueIndex"` Password string `gorm:"column:password;type:char(60);not null"` AccessToken *uuid.UUID `gorm:"column:access_token;type:uuid;default:null"` Language string `gorm:"column:language;type:char(2);not null"` CreatedAt time.Time `gorm:"column:created_at;type:timestamp without time zone;not null"` UpdatedAt time.Time `gorm:"column:updated_at;type:timestamp without time zone;not null"` DeletedAt *time.Time `gorm:"column:deleted_at;type:timestamp without time zone;default:null;index"` Customers []Customer `gorm:"ForeignKey:UserID"` }
Click to show internal directories.
Click to hide internal directories.