154 lines
2.9 KiB
Go
154 lines
2.9 KiB
Go
// =================================================================================
|
|
// This file is auto-generated by the GoFrame CLI tool. You may modify it as needed.
|
|
// =================================================================================
|
|
|
|
package table
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/gogf/gf/v2/database/gdb"
|
|
)
|
|
|
|
// User defines the fields of table "user" with their properties.
|
|
// This map is used internally by GoFrame ORM to understand table structure.
|
|
var User = map[string]*gdb.TableField{
|
|
"id": {
|
|
Index: 0,
|
|
Name: "id",
|
|
Type: "bigint unsigned",
|
|
Null: false,
|
|
Key: "PRI",
|
|
Default: nil,
|
|
Extra: "auto_increment",
|
|
Comment: "",
|
|
},
|
|
"union_id": {
|
|
Index: 1,
|
|
Name: "union_id",
|
|
Type: "varchar(64)",
|
|
Null: false,
|
|
Key: "",
|
|
Default: "",
|
|
Extra: "",
|
|
Comment: "",
|
|
},
|
|
"open_id": {
|
|
Index: 2,
|
|
Name: "open_id",
|
|
Type: "varchar(64)",
|
|
Null: false,
|
|
Key: "UNI",
|
|
Default: "",
|
|
Extra: "",
|
|
Comment: "",
|
|
},
|
|
"mobile": {
|
|
Index: 3,
|
|
Name: "mobile",
|
|
Type: "varchar(20)",
|
|
Null: false,
|
|
Key: "UNI",
|
|
Default: "",
|
|
Extra: "",
|
|
Comment: "",
|
|
},
|
|
"account": {
|
|
Index: 4,
|
|
Name: "account",
|
|
Type: "varchar(64)",
|
|
Null: false,
|
|
Key: "UNI",
|
|
Default: "",
|
|
Extra: "",
|
|
Comment: "",
|
|
},
|
|
"password_hash": {
|
|
Index: 5,
|
|
Name: "password_hash",
|
|
Type: "varchar(100)",
|
|
Null: false,
|
|
Key: "",
|
|
Default: "",
|
|
Extra: "",
|
|
Comment: "",
|
|
},
|
|
"nickname": {
|
|
Index: 6,
|
|
Name: "nickname",
|
|
Type: "varchar(64)",
|
|
Null: false,
|
|
Key: "",
|
|
Default: "",
|
|
Extra: "",
|
|
Comment: "",
|
|
},
|
|
"avatar": {
|
|
Index: 7,
|
|
Name: "avatar",
|
|
Type: "varchar(512)",
|
|
Null: false,
|
|
Key: "",
|
|
Default: "",
|
|
Extra: "",
|
|
Comment: "",
|
|
},
|
|
"status": {
|
|
Index: 8,
|
|
Name: "status",
|
|
Type: "tinyint",
|
|
Null: false,
|
|
Key: "MUL",
|
|
Default: "1",
|
|
Extra: "",
|
|
Comment: "",
|
|
},
|
|
"last_login_at": {
|
|
Index: 9,
|
|
Name: "last_login_at",
|
|
Type: "datetime",
|
|
Null: true,
|
|
Key: "",
|
|
Default: nil,
|
|
Extra: "",
|
|
Comment: "",
|
|
},
|
|
"created_at": {
|
|
Index: 10,
|
|
Name: "created_at",
|
|
Type: "datetime",
|
|
Null: false,
|
|
Key: "",
|
|
Default: nil,
|
|
Extra: "",
|
|
Comment: "",
|
|
},
|
|
"updated_at": {
|
|
Index: 11,
|
|
Name: "updated_at",
|
|
Type: "datetime",
|
|
Null: false,
|
|
Key: "",
|
|
Default: nil,
|
|
Extra: "",
|
|
Comment: "",
|
|
},
|
|
"deleted_at": {
|
|
Index: 12,
|
|
Name: "deleted_at",
|
|
Type: "datetime",
|
|
Null: true,
|
|
Key: "MUL",
|
|
Default: nil,
|
|
Extra: "",
|
|
Comment: "",
|
|
},
|
|
}
|
|
|
|
// SetUserTableFields registers the table fields definition to the database instance.
|
|
// db: database instance that implements gdb.DB interface.
|
|
// schema: optional schema/namespace name, especially for databases that support schemas.
|
|
func SetUserTableFields(ctx context.Context, db gdb.DB, schema ...string) error {
|
|
return db.GetCore().SetTableFields(ctx, "user", User, schema...)
|
|
}
|