model

package
v1.3.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID          int       `gorm:"primaryKey;column:id;type:int;not null" json:"id"`
	FirstName   string    `gorm:"column:first_name;type:varchar(20);not null" json:"firstName"`
	LastName    string    `gorm:"column:last_name;type:varchar(20);not null" json:"lastName"`
	Username    string    `gorm:"unique;column:username;type:varchar(20);not null" json:"username"`
	Password    string    `gorm:"column:password;type:varchar(20);not null" json:"password"`
	Phone       string    `gorm:"column:phone;type:varchar(20)" json:"phone"`
	Email       string    `gorm:"column:email;type:varchar(30)" json:"email"`
	Enabled     bool      `gorm:"column:enabled;type:tinyint(1)" json:"enabled"`
	Gender      string    `gorm:"column:gender;type:varchar(10)" json:"gender"`
	CreatedTime time.Time `gorm:"column:created_time;type:timestamp;default:CURRENT_TIMESTAMP" json:"createdTime"`
	UpdatedTime time.Time `gorm:"column:updated_time;type:timestamp;default:CURRENT_TIMESTAMP" json:"updatedTime"`
}

*****sql****** CREATE TABLE `account` (

`id` int NOT NULL AUTO_INCREMENT,
`first_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`last_name` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`username` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`password` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NOT NULL,
`phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
`email` varchar(30) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
`enabled` tinyint(1) DEFAULT NULL,
`gender` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
`created_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `account_username_uindex` (`username`) USING BTREE

) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci ******sql***** Account [...]

type Base added in v1.3.7

type Base struct {
	ID          uint64    `gorm:"primaryKey;column:id"`
	CreatedTime time.Time `gorm:"column:created_time;type:timestamp;default:CURRENT_TIMESTAMP"`
	UpdatedTime time.Time `gorm:"column:updated_time;type:timestamp;default:CURRENT_TIMESTAMP"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL