94 lines
2.0 KiB
Go
94 lines
2.0 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"
|
|
)
|
|
|
|
// Content defines the fields of table "content" with their properties.
|
|
// This map is used internally by GoFrame ORM to understand table structure.
|
|
var Content = map[string]*gdb.TableField{
|
|
"id": {
|
|
Index: 0,
|
|
Name: "id",
|
|
Type: "bigint unsigned",
|
|
Null: false,
|
|
Key: "PRI",
|
|
Default: nil,
|
|
Extra: "auto_increment",
|
|
Comment: "",
|
|
},
|
|
"title": {
|
|
Index: 1,
|
|
Name: "title",
|
|
Type: "varchar(200)",
|
|
Null: false,
|
|
Key: "",
|
|
Default: nil,
|
|
Extra: "",
|
|
Comment: "",
|
|
},
|
|
"body": {
|
|
Index: 2,
|
|
Name: "body",
|
|
Type: "longtext",
|
|
Null: true,
|
|
Key: "",
|
|
Default: nil,
|
|
Extra: "",
|
|
Comment: "",
|
|
},
|
|
"status": {
|
|
Index: 3,
|
|
Name: "status",
|
|
Type: "tinyint",
|
|
Null: false,
|
|
Key: "MUL",
|
|
Default: "1",
|
|
Extra: "",
|
|
Comment: "",
|
|
},
|
|
"created_at": {
|
|
Index: 4,
|
|
Name: "created_at",
|
|
Type: "datetime",
|
|
Null: false,
|
|
Key: "",
|
|
Default: nil,
|
|
Extra: "",
|
|
Comment: "",
|
|
},
|
|
"updated_at": {
|
|
Index: 5,
|
|
Name: "updated_at",
|
|
Type: "datetime",
|
|
Null: false,
|
|
Key: "",
|
|
Default: nil,
|
|
Extra: "",
|
|
Comment: "",
|
|
},
|
|
"deleted_at": {
|
|
Index: 6,
|
|
Name: "deleted_at",
|
|
Type: "datetime",
|
|
Null: true,
|
|
Key: "MUL",
|
|
Default: nil,
|
|
Extra: "",
|
|
Comment: "",
|
|
},
|
|
}
|
|
|
|
// SetContentTableFields 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 SetContentTableFields(ctx context.Context, db gdb.DB, schema ...string) error {
|
|
return db.GetCore().SetTableFields(ctx, "content", Content, schema...)
|
|
}
|