Files
2026-03-31 22:12:06 +08:00

75 lines
2.9 KiB
Go

// Code generated by ent, DO NOT EDIT.
package migrate
import (
"entgo.io/ent/dialect/sql/schema"
"entgo.io/ent/schema/field"
)
var (
// UserFollowsColumns holds the columns for the "user_follows" table.
UserFollowsColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt64, Increment: true},
{Name: "follower_id", Type: field.TypeInt64},
{Name: "followee_id", Type: field.TypeInt64},
{Name: "created_at", Type: field.TypeTime},
}
// UserFollowsTable holds the schema information for the "user_follows" table.
UserFollowsTable = &schema.Table{
Name: "user_follows",
Columns: UserFollowsColumns,
PrimaryKey: []*schema.Column{UserFollowsColumns[0]},
}
// UserPreferencesColumns holds the columns for the "user_preferences" table.
UserPreferencesColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "user_id", Type: field.TypeInt64},
{Name: "notification_order", Type: field.TypeBool, Default: true},
{Name: "notification_community", Type: field.TypeBool, Default: true},
{Name: "notification_system", Type: field.TypeBool, Default: true},
{Name: "theme", Type: field.TypeString, Default: "light"},
{Name: "language", Type: field.TypeString, Default: "zh-CN"},
{Name: "updated_at", Type: field.TypeTime},
}
// UserPreferencesTable holds the schema information for the "user_preferences" table.
UserPreferencesTable = &schema.Table{
Name: "user_preferences",
Columns: UserPreferencesColumns,
PrimaryKey: []*schema.Column{UserPreferencesColumns[0]},
}
// UsersColumns holds the columns for the "users" table.
UsersColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt64, Increment: true},
{Name: "username", Type: field.TypeString, Unique: true},
{Name: "password_hash", Type: field.TypeString},
{Name: "email", Type: field.TypeString, Unique: true},
{Name: "phone", Type: field.TypeString, Unique: true},
{Name: "nickname", Type: field.TypeString, Default: ""},
{Name: "avatar", Type: field.TypeString, Default: ""},
{Name: "bio", Type: field.TypeString, Default: ""},
{Name: "current_role", Type: field.TypeString, Default: "consumer"},
{Name: "verification_status", Type: field.TypeJSON, Nullable: true},
{Name: "is_admin", Type: field.TypeBool, Default: false},
{Name: "created_at", Type: field.TypeTime},
{Name: "updated_at", Type: field.TypeTime},
{Name: "deleted_at", Type: field.TypeTime, Nullable: true},
{Name: "verified_roles", Type: field.TypeOther, Nullable: true, SchemaType: map[string]string{"postgres": "text[]"}},
}
// UsersTable holds the schema information for the "users" table.
UsersTable = &schema.Table{
Name: "users",
Columns: UsersColumns,
PrimaryKey: []*schema.Column{UsersColumns[0]},
}
// Tables holds all the tables in the schema.
Tables = []*schema.Table{
UserFollowsTable,
UserPreferencesTable,
UsersTable,
}
)
func init() {
}