122 lines
4.6 KiB
Go
122 lines
4.6 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package migrate
|
|
|
|
import (
|
|
"entgo.io/ent/dialect/sql/schema"
|
|
"entgo.io/ent/schema/field"
|
|
)
|
|
|
|
var (
|
|
// ContactsColumns holds the columns for the "contacts" table.
|
|
ContactsColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeInt, Increment: true},
|
|
{Name: "type", Type: field.TypeString},
|
|
{Name: "icon", Type: field.TypeString},
|
|
{Name: "url", Type: field.TypeString, Nullable: true},
|
|
{Name: "qr_code", Type: field.TypeString, Nullable: true},
|
|
{Name: "hover_color", Type: field.TypeString, Nullable: true},
|
|
{Name: "sort_order", Type: field.TypeInt, Default: 0},
|
|
}
|
|
// ContactsTable holds the schema information for the "contacts" table.
|
|
ContactsTable = &schema.Table{
|
|
Name: "contacts",
|
|
Columns: ContactsColumns,
|
|
PrimaryKey: []*schema.Column{ContactsColumns[0]},
|
|
}
|
|
// LoginHistoriesColumns holds the columns for the "login_histories" table.
|
|
LoginHistoriesColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeInt, Increment: true},
|
|
{Name: "username", Type: field.TypeString},
|
|
{Name: "ip", Type: field.TypeString},
|
|
{Name: "location", Type: field.TypeString, Nullable: true},
|
|
{Name: "user_agent", Type: field.TypeString, Nullable: true},
|
|
{Name: "login_time", Type: field.TypeTime},
|
|
{Name: "success", Type: field.TypeBool, Default: true},
|
|
}
|
|
// LoginHistoriesTable holds the schema information for the "login_histories" table.
|
|
LoginHistoriesTable = &schema.Table{
|
|
Name: "login_histories",
|
|
Columns: LoginHistoriesColumns,
|
|
PrimaryKey: []*schema.Column{LoginHistoriesColumns[0]},
|
|
}
|
|
// SitesColumns holds the columns for the "sites" table.
|
|
SitesColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeInt, Increment: true},
|
|
{Name: "name", Type: field.TypeString},
|
|
{Name: "url", Type: field.TypeString},
|
|
{Name: "icon", Type: field.TypeString},
|
|
{Name: "sort_order", Type: field.TypeInt, Default: 0},
|
|
}
|
|
// SitesTable holds the schema information for the "sites" table.
|
|
SitesTable = &schema.Table{
|
|
Name: "sites",
|
|
Columns: SitesColumns,
|
|
PrimaryKey: []*schema.Column{SitesColumns[0]},
|
|
}
|
|
// SiteConfigsColumns holds the columns for the "site_configs" table.
|
|
SiteConfigsColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeInt, Increment: true},
|
|
{Name: "site_name", Type: field.TypeString},
|
|
{Name: "site_url", Type: field.TypeString},
|
|
{Name: "site_icon", Type: field.TypeString},
|
|
{Name: "site_description", Type: field.TypeString},
|
|
{Name: "site_keywords", Type: field.TypeString},
|
|
{Name: "user_name", Type: field.TypeString},
|
|
{Name: "profile_image_url", Type: field.TypeString, Nullable: true},
|
|
{Name: "icp_number", Type: field.TypeString, Nullable: true},
|
|
{Name: "police_number", Type: field.TypeString, Nullable: true},
|
|
{Name: "page_title", Type: field.TypeString, Nullable: true},
|
|
{Name: "favicon", Type: field.TypeString, Nullable: true},
|
|
{Name: "umami_script", Type: field.TypeString, Nullable: true},
|
|
{Name: "umami_website_id", Type: field.TypeString, Nullable: true},
|
|
{Name: "icon_library", Type: field.TypeString, Nullable: true},
|
|
{Name: "font_library", Type: field.TypeString, Nullable: true},
|
|
}
|
|
// SiteConfigsTable holds the schema information for the "site_configs" table.
|
|
SiteConfigsTable = &schema.Table{
|
|
Name: "site_configs",
|
|
Columns: SiteConfigsColumns,
|
|
PrimaryKey: []*schema.Column{SiteConfigsColumns[0]},
|
|
}
|
|
// UsersColumns holds the columns for the "users" table.
|
|
UsersColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeInt, Increment: true},
|
|
{Name: "username", Type: field.TypeString, Unique: true},
|
|
{Name: "password", Type: field.TypeString},
|
|
}
|
|
// UsersTable holds the schema information for the "users" table.
|
|
UsersTable = &schema.Table{
|
|
Name: "users",
|
|
Columns: UsersColumns,
|
|
PrimaryKey: []*schema.Column{UsersColumns[0]},
|
|
}
|
|
// VisitsColumns holds the columns for the "visits" table.
|
|
VisitsColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeInt, Increment: true},
|
|
{Name: "path", Type: field.TypeString},
|
|
{Name: "ip", Type: field.TypeString},
|
|
{Name: "user_agent", Type: field.TypeString, Nullable: true},
|
|
{Name: "referer", Type: field.TypeString, Nullable: true},
|
|
{Name: "visit_time", Type: field.TypeTime},
|
|
}
|
|
// VisitsTable holds the schema information for the "visits" table.
|
|
VisitsTable = &schema.Table{
|
|
Name: "visits",
|
|
Columns: VisitsColumns,
|
|
PrimaryKey: []*schema.Column{VisitsColumns[0]},
|
|
}
|
|
// Tables holds all the tables in the schema.
|
|
Tables = []*schema.Table{
|
|
ContactsTable,
|
|
LoginHistoriesTable,
|
|
SitesTable,
|
|
SiteConfigsTable,
|
|
UsersTable,
|
|
VisitsTable,
|
|
}
|
|
)
|
|
|
|
func init() {
|
|
}
|