mirror of
https://github.com/chaitin/MonkeyCode.git
synced 2026-11-22 19:39:31 +08:00
- 新增 git_bots, git_bot_users, git_bot_tasks, project_git_bots 表 - 添加 user, host, project 到 gitbot 的关联边 - 使用 soft delete 和 created_at 游标
1236 lines
46 KiB
Go
1236 lines
46 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package migrate
|
|
|
|
import (
|
|
"entgo.io/ent/dialect/entsql"
|
|
"entgo.io/ent/dialect/sql/schema"
|
|
"entgo.io/ent/schema/field"
|
|
)
|
|
|
|
var (
|
|
// AuditsColumns holds the columns for the "audits" table.
|
|
AuditsColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeUUID},
|
|
{Name: "operation", Type: field.TypeString},
|
|
{Name: "source_ip", Type: field.TypeString},
|
|
{Name: "user_agent", Type: field.TypeString},
|
|
{Name: "request", Type: field.TypeString},
|
|
{Name: "response", Type: field.TypeString, Nullable: true},
|
|
{Name: "created_at", Type: field.TypeTime},
|
|
{Name: "user_id", Type: field.TypeUUID},
|
|
}
|
|
// AuditsTable holds the schema information for the "audits" table.
|
|
AuditsTable = &schema.Table{
|
|
Name: "audits",
|
|
Columns: AuditsColumns,
|
|
PrimaryKey: []*schema.Column{AuditsColumns[0]},
|
|
ForeignKeys: []*schema.ForeignKey{
|
|
{
|
|
Symbol: "audits_users_audits",
|
|
Columns: []*schema.Column{AuditsColumns[7]},
|
|
RefColumns: []*schema.Column{UsersColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
},
|
|
}
|
|
// GitBotsColumns holds the columns for the "git_bots" table.
|
|
GitBotsColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeUUID},
|
|
{Name: "deleted_at", Type: field.TypeTime, Nullable: true},
|
|
{Name: "user_id", Type: field.TypeUUID},
|
|
{Name: "name", Type: field.TypeString, Nullable: true},
|
|
{Name: "token", Type: field.TypeString, Nullable: true},
|
|
{Name: "secret_token", Type: field.TypeString, Nullable: true},
|
|
{Name: "platform", Type: field.TypeString},
|
|
{Name: "created_at", Type: field.TypeTime},
|
|
{Name: "host_id", Type: field.TypeString},
|
|
}
|
|
// GitBotsTable holds the schema information for the "git_bots" table.
|
|
GitBotsTable = &schema.Table{
|
|
Name: "git_bots",
|
|
Columns: GitBotsColumns,
|
|
PrimaryKey: []*schema.Column{GitBotsColumns[0]},
|
|
ForeignKeys: []*schema.ForeignKey{
|
|
{
|
|
Symbol: "git_bots_hosts_git_bots",
|
|
Columns: []*schema.Column{GitBotsColumns[8]},
|
|
RefColumns: []*schema.Column{HostsColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
},
|
|
}
|
|
// GitBotTasksColumns holds the columns for the "git_bot_tasks" table.
|
|
GitBotTasksColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeUUID},
|
|
{Name: "created_at", Type: field.TypeTime},
|
|
{Name: "git_bot_id", Type: field.TypeUUID},
|
|
{Name: "task_id", Type: field.TypeUUID},
|
|
}
|
|
// GitBotTasksTable holds the schema information for the "git_bot_tasks" table.
|
|
GitBotTasksTable = &schema.Table{
|
|
Name: "git_bot_tasks",
|
|
Columns: GitBotTasksColumns,
|
|
PrimaryKey: []*schema.Column{GitBotTasksColumns[0]},
|
|
ForeignKeys: []*schema.ForeignKey{
|
|
{
|
|
Symbol: "git_bot_tasks_git_bots_git_bot_tasks",
|
|
Columns: []*schema.Column{GitBotTasksColumns[2]},
|
|
RefColumns: []*schema.Column{GitBotsColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
{
|
|
Symbol: "git_bot_tasks_tasks_git_bot_tasks",
|
|
Columns: []*schema.Column{GitBotTasksColumns[3]},
|
|
RefColumns: []*schema.Column{TasksColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
},
|
|
}
|
|
// GitBotUsersColumns holds the columns for the "git_bot_users" table.
|
|
GitBotUsersColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeUUID},
|
|
{Name: "created_at", Type: field.TypeTime},
|
|
{Name: "git_bot_id", Type: field.TypeUUID},
|
|
{Name: "user_id", Type: field.TypeUUID},
|
|
}
|
|
// GitBotUsersTable holds the schema information for the "git_bot_users" table.
|
|
GitBotUsersTable = &schema.Table{
|
|
Name: "git_bot_users",
|
|
Columns: GitBotUsersColumns,
|
|
PrimaryKey: []*schema.Column{GitBotUsersColumns[0]},
|
|
ForeignKeys: []*schema.ForeignKey{
|
|
{
|
|
Symbol: "git_bot_users_git_bots_git_bot",
|
|
Columns: []*schema.Column{GitBotUsersColumns[2]},
|
|
RefColumns: []*schema.Column{GitBotsColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
{
|
|
Symbol: "git_bot_users_users_user",
|
|
Columns: []*schema.Column{GitBotUsersColumns[3]},
|
|
RefColumns: []*schema.Column{UsersColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
},
|
|
Indexes: []*schema.Index{
|
|
{
|
|
Name: "gitbotuser_user_id_git_bot_id",
|
|
Unique: true,
|
|
Columns: []*schema.Column{GitBotUsersColumns[3], GitBotUsersColumns[2]},
|
|
},
|
|
},
|
|
}
|
|
// GitIdentitiesColumns holds the columns for the "git_identities" table.
|
|
GitIdentitiesColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeUUID, Unique: true},
|
|
{Name: "deleted_at", Type: field.TypeTime, Nullable: true},
|
|
{Name: "platform", Type: field.TypeString},
|
|
{Name: "base_url", Type: field.TypeString, Nullable: true},
|
|
{Name: "access_token", Type: field.TypeString, Nullable: true},
|
|
{Name: "username", Type: field.TypeString, Nullable: true},
|
|
{Name: "email", Type: field.TypeString, Nullable: true},
|
|
{Name: "installation_id", Type: field.TypeInt64, Nullable: true},
|
|
{Name: "remark", Type: field.TypeString, Nullable: true},
|
|
{Name: "oauth_refresh_token", Type: field.TypeString, Nullable: true},
|
|
{Name: "oauth_expires_at", Type: field.TypeTime, Nullable: true},
|
|
{Name: "created_at", Type: field.TypeTime},
|
|
{Name: "updated_at", Type: field.TypeTime},
|
|
{Name: "user_id", Type: field.TypeUUID},
|
|
}
|
|
// GitIdentitiesTable holds the schema information for the "git_identities" table.
|
|
GitIdentitiesTable = &schema.Table{
|
|
Name: "git_identities",
|
|
Columns: GitIdentitiesColumns,
|
|
PrimaryKey: []*schema.Column{GitIdentitiesColumns[0]},
|
|
ForeignKeys: []*schema.ForeignKey{
|
|
{
|
|
Symbol: "git_identities_users_git_identities",
|
|
Columns: []*schema.Column{GitIdentitiesColumns[13]},
|
|
RefColumns: []*schema.Column{UsersColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
},
|
|
}
|
|
// HostsColumns holds the columns for the "hosts" table.
|
|
HostsColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeString, Unique: true},
|
|
{Name: "deleted_at", Type: field.TypeTime, Nullable: true},
|
|
{Name: "hostname", Type: field.TypeString, Nullable: true},
|
|
{Name: "arch", Type: field.TypeString, Nullable: true},
|
|
{Name: "cores", Type: field.TypeInt, Nullable: true},
|
|
{Name: "weight", Type: field.TypeInt, Default: 1},
|
|
{Name: "memory", Type: field.TypeInt64, Nullable: true},
|
|
{Name: "disk", Type: field.TypeInt64, Nullable: true},
|
|
{Name: "os", Type: field.TypeString, Nullable: true},
|
|
{Name: "external_ip", Type: field.TypeString, Nullable: true},
|
|
{Name: "internal_ip", Type: field.TypeString, Nullable: true},
|
|
{Name: "version", Type: field.TypeString, Nullable: true},
|
|
{Name: "machine_id", Type: field.TypeString, Nullable: true},
|
|
{Name: "remark", Type: field.TypeString, Nullable: true},
|
|
{Name: "created_at", Type: field.TypeTime},
|
|
{Name: "updated_at", Type: field.TypeTime},
|
|
{Name: "user_id", Type: field.TypeUUID},
|
|
}
|
|
// HostsTable holds the schema information for the "hosts" table.
|
|
HostsTable = &schema.Table{
|
|
Name: "hosts",
|
|
Columns: HostsColumns,
|
|
PrimaryKey: []*schema.Column{HostsColumns[0]},
|
|
ForeignKeys: []*schema.ForeignKey{
|
|
{
|
|
Symbol: "hosts_users_hosts",
|
|
Columns: []*schema.Column{HostsColumns[16]},
|
|
RefColumns: []*schema.Column{UsersColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
},
|
|
}
|
|
// ImagesColumns holds the columns for the "images" table.
|
|
ImagesColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeUUID, Unique: true},
|
|
{Name: "deleted_at", Type: field.TypeTime, Nullable: true},
|
|
{Name: "name", Type: field.TypeString},
|
|
{Name: "remark", Type: field.TypeString, Nullable: true},
|
|
{Name: "created_at", Type: field.TypeTime},
|
|
{Name: "updated_at", Type: field.TypeTime},
|
|
{Name: "user_id", Type: field.TypeUUID},
|
|
}
|
|
// ImagesTable holds the schema information for the "images" table.
|
|
ImagesTable = &schema.Table{
|
|
Name: "images",
|
|
Columns: ImagesColumns,
|
|
PrimaryKey: []*schema.Column{ImagesColumns[0]},
|
|
ForeignKeys: []*schema.ForeignKey{
|
|
{
|
|
Symbol: "images_users_images",
|
|
Columns: []*schema.Column{ImagesColumns[6]},
|
|
RefColumns: []*schema.Column{UsersColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
},
|
|
}
|
|
// ModelsColumns holds the columns for the "models" table.
|
|
ModelsColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeUUID, Unique: true},
|
|
{Name: "deleted_at", Type: field.TypeTime, Nullable: true},
|
|
{Name: "provider", Type: field.TypeString},
|
|
{Name: "api_key", Type: field.TypeString, Size: 2147483647},
|
|
{Name: "base_url", Type: field.TypeString, Size: 2147483647},
|
|
{Name: "model", Type: field.TypeString},
|
|
{Name: "remark", Type: field.TypeString, Nullable: true},
|
|
{Name: "temperature", Type: field.TypeFloat64, Nullable: true},
|
|
{Name: "interface_type", Type: field.TypeString, Nullable: true},
|
|
{Name: "weight", Type: field.TypeInt, Default: 1},
|
|
{Name: "last_check_at", Type: field.TypeTime, Nullable: true},
|
|
{Name: "last_check_success", Type: field.TypeBool, Nullable: true},
|
|
{Name: "last_check_error", Type: field.TypeString, Nullable: true},
|
|
{Name: "created_at", Type: field.TypeTime},
|
|
{Name: "updated_at", Type: field.TypeTime},
|
|
{Name: "user_id", Type: field.TypeUUID},
|
|
}
|
|
// ModelsTable holds the schema information for the "models" table.
|
|
ModelsTable = &schema.Table{
|
|
Name: "models",
|
|
Columns: ModelsColumns,
|
|
PrimaryKey: []*schema.Column{ModelsColumns[0]},
|
|
ForeignKeys: []*schema.ForeignKey{
|
|
{
|
|
Symbol: "models_users_models",
|
|
Columns: []*schema.Column{ModelsColumns[15]},
|
|
RefColumns: []*schema.Column{UsersColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
},
|
|
}
|
|
// NotifyChannelsColumns holds the columns for the "notify_channels" table.
|
|
NotifyChannelsColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeUUID, Unique: true},
|
|
{Name: "deleted_at", Type: field.TypeTime, Nullable: true},
|
|
{Name: "owner_id", Type: field.TypeUUID},
|
|
{Name: "owner_type", Type: field.TypeString, Default: "user"},
|
|
{Name: "name", Type: field.TypeString, Size: 64},
|
|
{Name: "kind", Type: field.TypeString},
|
|
{Name: "webhook_url", Type: field.TypeString, Size: 2147483647},
|
|
{Name: "secret", Type: field.TypeString, Nullable: true, Size: 2147483647, Default: ""},
|
|
{Name: "headers", Type: field.TypeJSON, Nullable: true},
|
|
{Name: "enabled", Type: field.TypeBool, Default: true},
|
|
{Name: "created_at", Type: field.TypeTime},
|
|
{Name: "updated_at", Type: field.TypeTime},
|
|
}
|
|
// NotifyChannelsTable holds the schema information for the "notify_channels" table.
|
|
NotifyChannelsTable = &schema.Table{
|
|
Name: "notify_channels",
|
|
Columns: NotifyChannelsColumns,
|
|
PrimaryKey: []*schema.Column{NotifyChannelsColumns[0]},
|
|
Indexes: []*schema.Index{
|
|
{
|
|
Name: "notifychannel_owner_id_owner_type",
|
|
Unique: false,
|
|
Columns: []*schema.Column{NotifyChannelsColumns[2], NotifyChannelsColumns[3]},
|
|
},
|
|
},
|
|
}
|
|
// NotifySendLogsColumns holds the columns for the "notify_send_logs" table.
|
|
NotifySendLogsColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeUUID, Unique: true},
|
|
{Name: "subscription_id", Type: field.TypeUUID},
|
|
{Name: "channel_id", Type: field.TypeUUID},
|
|
{Name: "event_type", Type: field.TypeString},
|
|
{Name: "event_ref_id", Type: field.TypeString},
|
|
{Name: "status", Type: field.TypeString},
|
|
{Name: "error", Type: field.TypeString, Nullable: true, Size: 2147483647, Default: ""},
|
|
{Name: "created_at", Type: field.TypeTime},
|
|
}
|
|
// NotifySendLogsTable holds the schema information for the "notify_send_logs" table.
|
|
NotifySendLogsTable = &schema.Table{
|
|
Name: "notify_send_logs",
|
|
Columns: NotifySendLogsColumns,
|
|
PrimaryKey: []*schema.Column{NotifySendLogsColumns[0]},
|
|
Indexes: []*schema.Index{
|
|
{
|
|
Name: "notifysendlog_subscription_id_event_type_event_ref_id",
|
|
Unique: false,
|
|
Columns: []*schema.Column{NotifySendLogsColumns[1], NotifySendLogsColumns[3], NotifySendLogsColumns[4]},
|
|
},
|
|
{
|
|
Name: "notifysendlog_status_created_at",
|
|
Unique: false,
|
|
Columns: []*schema.Column{NotifySendLogsColumns[5], NotifySendLogsColumns[7]},
|
|
},
|
|
},
|
|
}
|
|
// NotifySubscriptionsColumns holds the columns for the "notify_subscriptions" table.
|
|
NotifySubscriptionsColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeUUID, Unique: true},
|
|
{Name: "deleted_at", Type: field.TypeTime, Nullable: true},
|
|
{Name: "scope", Type: field.TypeString, Default: "self"},
|
|
{Name: "event_types", Type: field.TypeJSON},
|
|
{Name: "enabled", Type: field.TypeBool, Default: true},
|
|
{Name: "created_at", Type: field.TypeTime},
|
|
{Name: "updated_at", Type: field.TypeTime},
|
|
{Name: "channel_id", Type: field.TypeUUID},
|
|
}
|
|
// NotifySubscriptionsTable holds the schema information for the "notify_subscriptions" table.
|
|
NotifySubscriptionsTable = &schema.Table{
|
|
Name: "notify_subscriptions",
|
|
Columns: NotifySubscriptionsColumns,
|
|
PrimaryKey: []*schema.Column{NotifySubscriptionsColumns[0]},
|
|
ForeignKeys: []*schema.ForeignKey{
|
|
{
|
|
Symbol: "notify_subscriptions_notify_channels_subscriptions",
|
|
Columns: []*schema.Column{NotifySubscriptionsColumns[7]},
|
|
RefColumns: []*schema.Column{NotifyChannelsColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
},
|
|
Indexes: []*schema.Index{
|
|
{
|
|
Name: "notifysubscription_channel_id",
|
|
Unique: false,
|
|
Columns: []*schema.Column{NotifySubscriptionsColumns[7]},
|
|
},
|
|
},
|
|
}
|
|
// ProjectsColumns holds the columns for the "projects" table.
|
|
ProjectsColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeUUID, Unique: true},
|
|
{Name: "deleted_at", Type: field.TypeTime, Nullable: true},
|
|
{Name: "name", Type: field.TypeString},
|
|
{Name: "description", Type: field.TypeString, Nullable: true, Size: 2147483647},
|
|
{Name: "platform", Type: field.TypeString, Nullable: true},
|
|
{Name: "repo_url", Type: field.TypeString, Nullable: true},
|
|
{Name: "branch", Type: field.TypeString, Nullable: true},
|
|
{Name: "env_variables", Type: field.TypeJSON, Nullable: true},
|
|
{Name: "created_at", Type: field.TypeTime},
|
|
{Name: "updated_at", Type: field.TypeTime},
|
|
{Name: "git_identity_id", Type: field.TypeUUID, Nullable: true},
|
|
{Name: "image_id", Type: field.TypeUUID, Nullable: true},
|
|
{Name: "user_id", Type: field.TypeUUID},
|
|
}
|
|
// ProjectsTable holds the schema information for the "projects" table.
|
|
ProjectsTable = &schema.Table{
|
|
Name: "projects",
|
|
Columns: ProjectsColumns,
|
|
PrimaryKey: []*schema.Column{ProjectsColumns[0]},
|
|
ForeignKeys: []*schema.ForeignKey{
|
|
{
|
|
Symbol: "projects_git_identities_projects",
|
|
Columns: []*schema.Column{ProjectsColumns[10]},
|
|
RefColumns: []*schema.Column{GitIdentitiesColumns[0]},
|
|
OnDelete: schema.SetNull,
|
|
},
|
|
{
|
|
Symbol: "projects_images_projects",
|
|
Columns: []*schema.Column{ProjectsColumns[11]},
|
|
RefColumns: []*schema.Column{ImagesColumns[0]},
|
|
OnDelete: schema.SetNull,
|
|
},
|
|
{
|
|
Symbol: "projects_users_projects",
|
|
Columns: []*schema.Column{ProjectsColumns[12]},
|
|
RefColumns: []*schema.Column{UsersColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
},
|
|
}
|
|
// ProjectCollaboratorsColumns holds the columns for the "project_collaborators" table.
|
|
ProjectCollaboratorsColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeUUID, Unique: true},
|
|
{Name: "deleted_at", Type: field.TypeTime, Nullable: true},
|
|
{Name: "role", Type: field.TypeString, Default: "read_only"},
|
|
{Name: "created_at", Type: field.TypeTime},
|
|
{Name: "updated_at", Type: field.TypeTime},
|
|
{Name: "project_id", Type: field.TypeUUID},
|
|
{Name: "user_id", Type: field.TypeUUID},
|
|
}
|
|
// ProjectCollaboratorsTable holds the schema information for the "project_collaborators" table.
|
|
ProjectCollaboratorsTable = &schema.Table{
|
|
Name: "project_collaborators",
|
|
Columns: ProjectCollaboratorsColumns,
|
|
PrimaryKey: []*schema.Column{ProjectCollaboratorsColumns[0]},
|
|
ForeignKeys: []*schema.ForeignKey{
|
|
{
|
|
Symbol: "project_collaborators_projects_collaborators",
|
|
Columns: []*schema.Column{ProjectCollaboratorsColumns[5]},
|
|
RefColumns: []*schema.Column{ProjectsColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
{
|
|
Symbol: "project_collaborators_users_project_collaborators",
|
|
Columns: []*schema.Column{ProjectCollaboratorsColumns[6]},
|
|
RefColumns: []*schema.Column{UsersColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
},
|
|
}
|
|
// ProjectGitBotsColumns holds the columns for the "project_git_bots" table.
|
|
ProjectGitBotsColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeUUID},
|
|
{Name: "created_at", Type: field.TypeTime},
|
|
{Name: "project_id", Type: field.TypeUUID},
|
|
{Name: "git_bot_id", Type: field.TypeUUID},
|
|
}
|
|
// ProjectGitBotsTable holds the schema information for the "project_git_bots" table.
|
|
ProjectGitBotsTable = &schema.Table{
|
|
Name: "project_git_bots",
|
|
Columns: ProjectGitBotsColumns,
|
|
PrimaryKey: []*schema.Column{ProjectGitBotsColumns[0]},
|
|
ForeignKeys: []*schema.ForeignKey{
|
|
{
|
|
Symbol: "project_git_bots_projects_project",
|
|
Columns: []*schema.Column{ProjectGitBotsColumns[2]},
|
|
RefColumns: []*schema.Column{ProjectsColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
{
|
|
Symbol: "project_git_bots_git_bots_git_bot",
|
|
Columns: []*schema.Column{ProjectGitBotsColumns[3]},
|
|
RefColumns: []*schema.Column{GitBotsColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
},
|
|
Indexes: []*schema.Index{
|
|
{
|
|
Name: "projectgitbot_project_id_git_bot_id",
|
|
Unique: true,
|
|
Columns: []*schema.Column{ProjectGitBotsColumns[2], ProjectGitBotsColumns[3]},
|
|
},
|
|
},
|
|
}
|
|
// ProjectIssuesColumns holds the columns for the "project_issues" table.
|
|
ProjectIssuesColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeUUID, Unique: true},
|
|
{Name: "deleted_at", Type: field.TypeTime, Nullable: true},
|
|
{Name: "status", Type: field.TypeString, Default: "open"},
|
|
{Name: "title", Type: field.TypeString, Size: 2147483647},
|
|
{Name: "requirement_document", Type: field.TypeString, Nullable: true, Size: 2147483647},
|
|
{Name: "design_document", Type: field.TypeString, Nullable: true, Size: 2147483647},
|
|
{Name: "summary", Type: field.TypeString, Nullable: true, Size: 2147483647},
|
|
{Name: "priority", Type: field.TypeInt, Default: 2},
|
|
{Name: "created_at", Type: field.TypeTime},
|
|
{Name: "updated_at", Type: field.TypeTime},
|
|
{Name: "project_id", Type: field.TypeUUID},
|
|
{Name: "user_id", Type: field.TypeUUID},
|
|
{Name: "assignee_id", Type: field.TypeUUID, Nullable: true},
|
|
}
|
|
// ProjectIssuesTable holds the schema information for the "project_issues" table.
|
|
ProjectIssuesTable = &schema.Table{
|
|
Name: "project_issues",
|
|
Columns: ProjectIssuesColumns,
|
|
PrimaryKey: []*schema.Column{ProjectIssuesColumns[0]},
|
|
ForeignKeys: []*schema.ForeignKey{
|
|
{
|
|
Symbol: "project_issues_projects_issues",
|
|
Columns: []*schema.Column{ProjectIssuesColumns[10]},
|
|
RefColumns: []*schema.Column{ProjectsColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
{
|
|
Symbol: "project_issues_users_project_issues",
|
|
Columns: []*schema.Column{ProjectIssuesColumns[11]},
|
|
RefColumns: []*schema.Column{UsersColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
{
|
|
Symbol: "project_issues_users_assigned_issues",
|
|
Columns: []*schema.Column{ProjectIssuesColumns[12]},
|
|
RefColumns: []*schema.Column{UsersColumns[0]},
|
|
OnDelete: schema.SetNull,
|
|
},
|
|
},
|
|
}
|
|
// ProjectIssueCommentsColumns holds the columns for the "project_issue_comments" table.
|
|
ProjectIssueCommentsColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeUUID, Unique: true},
|
|
{Name: "deleted_at", Type: field.TypeTime, Nullable: true},
|
|
{Name: "comment", Type: field.TypeString, Size: 2147483647},
|
|
{Name: "created_at", Type: field.TypeTime},
|
|
{Name: "updated_at", Type: field.TypeTime},
|
|
{Name: "issue_id", Type: field.TypeUUID},
|
|
{Name: "parent_id", Type: field.TypeUUID, Nullable: true},
|
|
{Name: "user_id", Type: field.TypeUUID},
|
|
}
|
|
// ProjectIssueCommentsTable holds the schema information for the "project_issue_comments" table.
|
|
ProjectIssueCommentsTable = &schema.Table{
|
|
Name: "project_issue_comments",
|
|
Columns: ProjectIssueCommentsColumns,
|
|
PrimaryKey: []*schema.Column{ProjectIssueCommentsColumns[0]},
|
|
ForeignKeys: []*schema.ForeignKey{
|
|
{
|
|
Symbol: "project_issue_comments_project_issues_comments",
|
|
Columns: []*schema.Column{ProjectIssueCommentsColumns[5]},
|
|
RefColumns: []*schema.Column{ProjectIssuesColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
{
|
|
Symbol: "project_issue_comments_project_issue_comments_replies",
|
|
Columns: []*schema.Column{ProjectIssueCommentsColumns[6]},
|
|
RefColumns: []*schema.Column{ProjectIssueCommentsColumns[0]},
|
|
OnDelete: schema.SetNull,
|
|
},
|
|
{
|
|
Symbol: "project_issue_comments_users_project_issue_comments",
|
|
Columns: []*schema.Column{ProjectIssueCommentsColumns[7]},
|
|
RefColumns: []*schema.Column{UsersColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
},
|
|
}
|
|
// ProjectTasksColumns holds the columns for the "project_tasks" table.
|
|
ProjectTasksColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeUUID},
|
|
{Name: "repo_url", Type: field.TypeString, Nullable: true},
|
|
{Name: "repo_filename", Type: field.TypeString, Nullable: true},
|
|
{Name: "branch", Type: field.TypeString, Nullable: true},
|
|
{Name: "cli_name", Type: field.TypeString},
|
|
{Name: "created_at", Type: field.TypeTime},
|
|
{Name: "git_identity_id", Type: field.TypeUUID, Nullable: true},
|
|
{Name: "image_id", Type: field.TypeUUID},
|
|
{Name: "model_id", Type: field.TypeUUID},
|
|
{Name: "project_id", Type: field.TypeUUID, Nullable: true},
|
|
{Name: "issue_id", Type: field.TypeUUID, Nullable: true},
|
|
{Name: "task_id", Type: field.TypeUUID},
|
|
}
|
|
// ProjectTasksTable holds the schema information for the "project_tasks" table.
|
|
ProjectTasksTable = &schema.Table{
|
|
Name: "project_tasks",
|
|
Columns: ProjectTasksColumns,
|
|
PrimaryKey: []*schema.Column{ProjectTasksColumns[0]},
|
|
ForeignKeys: []*schema.ForeignKey{
|
|
{
|
|
Symbol: "project_tasks_git_identities_project_tasks",
|
|
Columns: []*schema.Column{ProjectTasksColumns[6]},
|
|
RefColumns: []*schema.Column{GitIdentitiesColumns[0]},
|
|
OnDelete: schema.SetNull,
|
|
},
|
|
{
|
|
Symbol: "project_tasks_images_project_tasks",
|
|
Columns: []*schema.Column{ProjectTasksColumns[7]},
|
|
RefColumns: []*schema.Column{ImagesColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
{
|
|
Symbol: "project_tasks_models_project_tasks",
|
|
Columns: []*schema.Column{ProjectTasksColumns[8]},
|
|
RefColumns: []*schema.Column{ModelsColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
{
|
|
Symbol: "project_tasks_projects_project_tasks",
|
|
Columns: []*schema.Column{ProjectTasksColumns[9]},
|
|
RefColumns: []*schema.Column{ProjectsColumns[0]},
|
|
OnDelete: schema.SetNull,
|
|
},
|
|
{
|
|
Symbol: "project_tasks_project_issues_project_tasks",
|
|
Columns: []*schema.Column{ProjectTasksColumns[10]},
|
|
RefColumns: []*schema.Column{ProjectIssuesColumns[0]},
|
|
OnDelete: schema.SetNull,
|
|
},
|
|
{
|
|
Symbol: "project_tasks_tasks_project_tasks",
|
|
Columns: []*schema.Column{ProjectTasksColumns[11]},
|
|
RefColumns: []*schema.Column{TasksColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
},
|
|
}
|
|
// TasksColumns holds the columns for the "tasks" table.
|
|
TasksColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeUUID},
|
|
{Name: "deleted_at", Type: field.TypeTime, Nullable: true},
|
|
{Name: "kind", Type: field.TypeString},
|
|
{Name: "sub_type", Type: field.TypeString, Nullable: true},
|
|
{Name: "content", Type: field.TypeString, Size: 2147483647},
|
|
{Name: "summary", Type: field.TypeString, Nullable: true, Size: 2147483647},
|
|
{Name: "status", Type: field.TypeString},
|
|
{Name: "created_at", Type: field.TypeTime},
|
|
{Name: "updated_at", Type: field.TypeTime},
|
|
{Name: "completed_at", Type: field.TypeTime, Nullable: true},
|
|
{Name: "user_id", Type: field.TypeUUID},
|
|
}
|
|
// TasksTable holds the schema information for the "tasks" table.
|
|
TasksTable = &schema.Table{
|
|
Name: "tasks",
|
|
Columns: TasksColumns,
|
|
PrimaryKey: []*schema.Column{TasksColumns[0]},
|
|
ForeignKeys: []*schema.ForeignKey{
|
|
{
|
|
Symbol: "tasks_users_tasks",
|
|
Columns: []*schema.Column{TasksColumns[10]},
|
|
RefColumns: []*schema.Column{UsersColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
},
|
|
}
|
|
// TaskVirtualmachinesColumns holds the columns for the "task_virtualmachines" table.
|
|
TaskVirtualmachinesColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeUUID},
|
|
{Name: "created_at", Type: field.TypeTime},
|
|
{Name: "task_id", Type: field.TypeUUID},
|
|
{Name: "virtualmachine_id", Type: field.TypeString},
|
|
}
|
|
// TaskVirtualmachinesTable holds the schema information for the "task_virtualmachines" table.
|
|
TaskVirtualmachinesTable = &schema.Table{
|
|
Name: "task_virtualmachines",
|
|
Columns: TaskVirtualmachinesColumns,
|
|
PrimaryKey: []*schema.Column{TaskVirtualmachinesColumns[0]},
|
|
ForeignKeys: []*schema.ForeignKey{
|
|
{
|
|
Symbol: "task_virtualmachines_tasks_task",
|
|
Columns: []*schema.Column{TaskVirtualmachinesColumns[2]},
|
|
RefColumns: []*schema.Column{TasksColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
{
|
|
Symbol: "task_virtualmachines_virtualmachines_virtualmachine",
|
|
Columns: []*schema.Column{TaskVirtualmachinesColumns[3]},
|
|
RefColumns: []*schema.Column{VirtualmachinesColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
},
|
|
Indexes: []*schema.Index{
|
|
{
|
|
Name: "taskvirtualmachine_virtualmachine_id_task_id",
|
|
Unique: true,
|
|
Columns: []*schema.Column{TaskVirtualmachinesColumns[3], TaskVirtualmachinesColumns[2]},
|
|
},
|
|
},
|
|
}
|
|
// TeamsColumns holds the columns for the "teams" table.
|
|
TeamsColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeUUID, Unique: true},
|
|
{Name: "deleted_at", Type: field.TypeTime, Nullable: true},
|
|
{Name: "name", Type: field.TypeString},
|
|
{Name: "member_limit", Type: field.TypeInt},
|
|
{Name: "created_at", Type: field.TypeTime},
|
|
{Name: "updated_at", Type: field.TypeTime},
|
|
}
|
|
// TeamsTable holds the schema information for the "teams" table.
|
|
TeamsTable = &schema.Table{
|
|
Name: "teams",
|
|
Columns: TeamsColumns,
|
|
PrimaryKey: []*schema.Column{TeamsColumns[0]},
|
|
}
|
|
// TeamGroupsColumns holds the columns for the "team_groups" table.
|
|
TeamGroupsColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeUUID, Unique: true},
|
|
{Name: "deleted_at", Type: field.TypeTime, Nullable: true},
|
|
{Name: "name", Type: field.TypeString},
|
|
{Name: "created_at", Type: field.TypeTime},
|
|
{Name: "updated_at", Type: field.TypeTime},
|
|
{Name: "team_id", Type: field.TypeUUID},
|
|
}
|
|
// TeamGroupsTable holds the schema information for the "team_groups" table.
|
|
TeamGroupsTable = &schema.Table{
|
|
Name: "team_groups",
|
|
Columns: TeamGroupsColumns,
|
|
PrimaryKey: []*schema.Column{TeamGroupsColumns[0]},
|
|
ForeignKeys: []*schema.ForeignKey{
|
|
{
|
|
Symbol: "team_groups_teams_groups",
|
|
Columns: []*schema.Column{TeamGroupsColumns[5]},
|
|
RefColumns: []*schema.Column{TeamsColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
},
|
|
}
|
|
// TeamGroupHostsColumns holds the columns for the "team_group_hosts" table.
|
|
TeamGroupHostsColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeUUID, Unique: true},
|
|
{Name: "created_at", Type: field.TypeTime},
|
|
{Name: "group_id", Type: field.TypeUUID},
|
|
{Name: "host_id", Type: field.TypeString},
|
|
}
|
|
// TeamGroupHostsTable holds the schema information for the "team_group_hosts" table.
|
|
TeamGroupHostsTable = &schema.Table{
|
|
Name: "team_group_hosts",
|
|
Columns: TeamGroupHostsColumns,
|
|
PrimaryKey: []*schema.Column{TeamGroupHostsColumns[0]},
|
|
ForeignKeys: []*schema.ForeignKey{
|
|
{
|
|
Symbol: "team_group_hosts_team_groups_group",
|
|
Columns: []*schema.Column{TeamGroupHostsColumns[2]},
|
|
RefColumns: []*schema.Column{TeamGroupsColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
{
|
|
Symbol: "team_group_hosts_hosts_host",
|
|
Columns: []*schema.Column{TeamGroupHostsColumns[3]},
|
|
RefColumns: []*schema.Column{HostsColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
},
|
|
Indexes: []*schema.Index{
|
|
{
|
|
Name: "teamgrouphost_group_id_host_id",
|
|
Unique: true,
|
|
Columns: []*schema.Column{TeamGroupHostsColumns[2], TeamGroupHostsColumns[3]},
|
|
},
|
|
},
|
|
}
|
|
// TeamGroupImagesColumns holds the columns for the "team_group_images" table.
|
|
TeamGroupImagesColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeUUID, Unique: true},
|
|
{Name: "created_at", Type: field.TypeTime},
|
|
{Name: "group_id", Type: field.TypeUUID},
|
|
{Name: "image_id", Type: field.TypeUUID},
|
|
}
|
|
// TeamGroupImagesTable holds the schema information for the "team_group_images" table.
|
|
TeamGroupImagesTable = &schema.Table{
|
|
Name: "team_group_images",
|
|
Columns: TeamGroupImagesColumns,
|
|
PrimaryKey: []*schema.Column{TeamGroupImagesColumns[0]},
|
|
ForeignKeys: []*schema.ForeignKey{
|
|
{
|
|
Symbol: "team_group_images_team_groups_group",
|
|
Columns: []*schema.Column{TeamGroupImagesColumns[2]},
|
|
RefColumns: []*schema.Column{TeamGroupsColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
{
|
|
Symbol: "team_group_images_images_image",
|
|
Columns: []*schema.Column{TeamGroupImagesColumns[3]},
|
|
RefColumns: []*schema.Column{ImagesColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
},
|
|
Indexes: []*schema.Index{
|
|
{
|
|
Name: "teamgroupimage_group_id_image_id",
|
|
Unique: true,
|
|
Columns: []*schema.Column{TeamGroupImagesColumns[2], TeamGroupImagesColumns[3]},
|
|
},
|
|
},
|
|
}
|
|
// TeamGroupMembersColumns holds the columns for the "team_group_members" table.
|
|
TeamGroupMembersColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeUUID, Unique: true},
|
|
{Name: "created_at", Type: field.TypeTime},
|
|
{Name: "group_id", Type: field.TypeUUID},
|
|
{Name: "user_id", Type: field.TypeUUID},
|
|
}
|
|
// TeamGroupMembersTable holds the schema information for the "team_group_members" table.
|
|
TeamGroupMembersTable = &schema.Table{
|
|
Name: "team_group_members",
|
|
Columns: TeamGroupMembersColumns,
|
|
PrimaryKey: []*schema.Column{TeamGroupMembersColumns[0]},
|
|
ForeignKeys: []*schema.ForeignKey{
|
|
{
|
|
Symbol: "team_group_members_team_groups_group",
|
|
Columns: []*schema.Column{TeamGroupMembersColumns[2]},
|
|
RefColumns: []*schema.Column{TeamGroupsColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
{
|
|
Symbol: "team_group_members_users_user",
|
|
Columns: []*schema.Column{TeamGroupMembersColumns[3]},
|
|
RefColumns: []*schema.Column{UsersColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
},
|
|
Indexes: []*schema.Index{
|
|
{
|
|
Name: "teamgroupmember_user_id_group_id",
|
|
Unique: true,
|
|
Columns: []*schema.Column{TeamGroupMembersColumns[3], TeamGroupMembersColumns[2]},
|
|
},
|
|
},
|
|
}
|
|
// TeamGroupModelsColumns holds the columns for the "team_group_models" table.
|
|
TeamGroupModelsColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeUUID, Unique: true},
|
|
{Name: "created_at", Type: field.TypeTime},
|
|
{Name: "group_id", Type: field.TypeUUID},
|
|
{Name: "model_id", Type: field.TypeUUID},
|
|
}
|
|
// TeamGroupModelsTable holds the schema information for the "team_group_models" table.
|
|
TeamGroupModelsTable = &schema.Table{
|
|
Name: "team_group_models",
|
|
Columns: TeamGroupModelsColumns,
|
|
PrimaryKey: []*schema.Column{TeamGroupModelsColumns[0]},
|
|
ForeignKeys: []*schema.ForeignKey{
|
|
{
|
|
Symbol: "team_group_models_team_groups_group",
|
|
Columns: []*schema.Column{TeamGroupModelsColumns[2]},
|
|
RefColumns: []*schema.Column{TeamGroupsColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
{
|
|
Symbol: "team_group_models_models_model",
|
|
Columns: []*schema.Column{TeamGroupModelsColumns[3]},
|
|
RefColumns: []*schema.Column{ModelsColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
},
|
|
Indexes: []*schema.Index{
|
|
{
|
|
Name: "teamgroupmodel_group_id_model_id",
|
|
Unique: true,
|
|
Columns: []*schema.Column{TeamGroupModelsColumns[2], TeamGroupModelsColumns[3]},
|
|
},
|
|
},
|
|
}
|
|
// TeamHostsColumns holds the columns for the "team_hosts" table.
|
|
TeamHostsColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeUUID, Unique: true},
|
|
{Name: "created_at", Type: field.TypeTime},
|
|
{Name: "team_id", Type: field.TypeUUID},
|
|
{Name: "host_id", Type: field.TypeString},
|
|
}
|
|
// TeamHostsTable holds the schema information for the "team_hosts" table.
|
|
TeamHostsTable = &schema.Table{
|
|
Name: "team_hosts",
|
|
Columns: TeamHostsColumns,
|
|
PrimaryKey: []*schema.Column{TeamHostsColumns[0]},
|
|
ForeignKeys: []*schema.ForeignKey{
|
|
{
|
|
Symbol: "team_hosts_teams_team",
|
|
Columns: []*schema.Column{TeamHostsColumns[2]},
|
|
RefColumns: []*schema.Column{TeamsColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
{
|
|
Symbol: "team_hosts_hosts_host",
|
|
Columns: []*schema.Column{TeamHostsColumns[3]},
|
|
RefColumns: []*schema.Column{HostsColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
},
|
|
}
|
|
// TeamImagesColumns holds the columns for the "team_images" table.
|
|
TeamImagesColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeUUID},
|
|
{Name: "created_at", Type: field.TypeTime},
|
|
{Name: "team_id", Type: field.TypeUUID},
|
|
{Name: "image_id", Type: field.TypeUUID},
|
|
}
|
|
// TeamImagesTable holds the schema information for the "team_images" table.
|
|
TeamImagesTable = &schema.Table{
|
|
Name: "team_images",
|
|
Columns: TeamImagesColumns,
|
|
PrimaryKey: []*schema.Column{TeamImagesColumns[0]},
|
|
ForeignKeys: []*schema.ForeignKey{
|
|
{
|
|
Symbol: "team_images_teams_team",
|
|
Columns: []*schema.Column{TeamImagesColumns[2]},
|
|
RefColumns: []*schema.Column{TeamsColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
{
|
|
Symbol: "team_images_images_image",
|
|
Columns: []*schema.Column{TeamImagesColumns[3]},
|
|
RefColumns: []*schema.Column{ImagesColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
},
|
|
Indexes: []*schema.Index{
|
|
{
|
|
Name: "teamimage_team_id_image_id",
|
|
Unique: true,
|
|
Columns: []*schema.Column{TeamImagesColumns[2], TeamImagesColumns[3]},
|
|
},
|
|
},
|
|
}
|
|
// TeamMembersColumns holds the columns for the "team_members" table.
|
|
TeamMembersColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeUUID, Unique: true},
|
|
{Name: "role", Type: field.TypeString},
|
|
{Name: "created_at", Type: field.TypeTime},
|
|
{Name: "team_id", Type: field.TypeUUID},
|
|
{Name: "user_id", Type: field.TypeUUID},
|
|
}
|
|
// TeamMembersTable holds the schema information for the "team_members" table.
|
|
TeamMembersTable = &schema.Table{
|
|
Name: "team_members",
|
|
Columns: TeamMembersColumns,
|
|
PrimaryKey: []*schema.Column{TeamMembersColumns[0]},
|
|
ForeignKeys: []*schema.ForeignKey{
|
|
{
|
|
Symbol: "team_members_teams_team",
|
|
Columns: []*schema.Column{TeamMembersColumns[3]},
|
|
RefColumns: []*schema.Column{TeamsColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
{
|
|
Symbol: "team_members_users_user",
|
|
Columns: []*schema.Column{TeamMembersColumns[4]},
|
|
RefColumns: []*schema.Column{UsersColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
},
|
|
Indexes: []*schema.Index{
|
|
{
|
|
Name: "teammember_user_id_team_id",
|
|
Unique: true,
|
|
Columns: []*schema.Column{TeamMembersColumns[4], TeamMembersColumns[3]},
|
|
},
|
|
},
|
|
}
|
|
// TeamModelsColumns holds the columns for the "team_models" table.
|
|
TeamModelsColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeUUID},
|
|
{Name: "created_at", Type: field.TypeTime},
|
|
{Name: "team_id", Type: field.TypeUUID},
|
|
{Name: "model_id", Type: field.TypeUUID},
|
|
}
|
|
// TeamModelsTable holds the schema information for the "team_models" table.
|
|
TeamModelsTable = &schema.Table{
|
|
Name: "team_models",
|
|
Columns: TeamModelsColumns,
|
|
PrimaryKey: []*schema.Column{TeamModelsColumns[0]},
|
|
ForeignKeys: []*schema.ForeignKey{
|
|
{
|
|
Symbol: "team_models_teams_team",
|
|
Columns: []*schema.Column{TeamModelsColumns[2]},
|
|
RefColumns: []*schema.Column{TeamsColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
{
|
|
Symbol: "team_models_models_model",
|
|
Columns: []*schema.Column{TeamModelsColumns[3]},
|
|
RefColumns: []*schema.Column{ModelsColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
},
|
|
Indexes: []*schema.Index{
|
|
{
|
|
Name: "teammodel_team_id_model_id",
|
|
Unique: true,
|
|
Columns: []*schema.Column{TeamModelsColumns[2], TeamModelsColumns[3]},
|
|
},
|
|
},
|
|
}
|
|
// UsersColumns holds the columns for the "users" table.
|
|
UsersColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeUUID, Unique: true},
|
|
{Name: "deleted_at", Type: field.TypeTime, Nullable: true},
|
|
{Name: "name", Type: field.TypeString},
|
|
{Name: "email", Type: field.TypeString, Nullable: true},
|
|
{Name: "avatar_url", Type: field.TypeString, Nullable: true},
|
|
{Name: "password", Type: field.TypeString, Nullable: true},
|
|
{Name: "role", Type: field.TypeString},
|
|
{Name: "status", Type: field.TypeString},
|
|
{Name: "is_blocked", Type: field.TypeBool, Default: false},
|
|
{Name: "default_configs", Type: field.TypeJSON, Nullable: true},
|
|
{Name: "created_at", Type: field.TypeTime},
|
|
{Name: "updated_at", Type: field.TypeTime},
|
|
}
|
|
// UsersTable holds the schema information for the "users" table.
|
|
UsersTable = &schema.Table{
|
|
Name: "users",
|
|
Columns: UsersColumns,
|
|
PrimaryKey: []*schema.Column{UsersColumns[0]},
|
|
}
|
|
// UserIdentitiesColumns holds the columns for the "user_identities" table.
|
|
UserIdentitiesColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeUUID, Unique: true},
|
|
{Name: "deleted_at", Type: field.TypeTime, Nullable: true},
|
|
{Name: "platform", Type: field.TypeString},
|
|
{Name: "identity_id", Type: field.TypeString},
|
|
{Name: "username", Type: field.TypeString},
|
|
{Name: "email", Type: field.TypeString, Nullable: true},
|
|
{Name: "avatar_url", Type: field.TypeString, Nullable: true},
|
|
{Name: "created_at", Type: field.TypeTime},
|
|
{Name: "updated_at", Type: field.TypeTime, Nullable: true},
|
|
{Name: "user_id", Type: field.TypeUUID},
|
|
}
|
|
// UserIdentitiesTable holds the schema information for the "user_identities" table.
|
|
UserIdentitiesTable = &schema.Table{
|
|
Name: "user_identities",
|
|
Columns: UserIdentitiesColumns,
|
|
PrimaryKey: []*schema.Column{UserIdentitiesColumns[0]},
|
|
ForeignKeys: []*schema.ForeignKey{
|
|
{
|
|
Symbol: "user_identities_users_identities",
|
|
Columns: []*schema.Column{UserIdentitiesColumns[9]},
|
|
RefColumns: []*schema.Column{UsersColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
},
|
|
}
|
|
// VirtualmachinesColumns holds the columns for the "virtualmachines" table.
|
|
VirtualmachinesColumns = []*schema.Column{
|
|
{Name: "id", Type: field.TypeString, Unique: true},
|
|
{Name: "deleted_at", Type: field.TypeTime, Nullable: true},
|
|
{Name: "environment_id", Type: field.TypeString, Nullable: true},
|
|
{Name: "name", Type: field.TypeString},
|
|
{Name: "hostname", Type: field.TypeString, Nullable: true},
|
|
{Name: "arch", Type: field.TypeString, Nullable: true},
|
|
{Name: "cores", Type: field.TypeInt, Nullable: true},
|
|
{Name: "memory", Type: field.TypeInt64, Nullable: true},
|
|
{Name: "os", Type: field.TypeString, Nullable: true},
|
|
{Name: "external_ip", Type: field.TypeString, Nullable: true},
|
|
{Name: "internal_ip", Type: field.TypeString, Nullable: true},
|
|
{Name: "ttl_kind", Type: field.TypeString, Nullable: true},
|
|
{Name: "ttl", Type: field.TypeInt64, Nullable: true},
|
|
{Name: "version", Type: field.TypeString, Nullable: true},
|
|
{Name: "machine_id", Type: field.TypeString, Nullable: true},
|
|
{Name: "repo_url", Type: field.TypeString, Nullable: true},
|
|
{Name: "repo_filename", Type: field.TypeString, Nullable: true},
|
|
{Name: "branch", Type: field.TypeString, Nullable: true},
|
|
{Name: "is_recycled", Type: field.TypeBool, Nullable: true},
|
|
{Name: "conditions", Type: field.TypeJSON, Nullable: true},
|
|
{Name: "created_at", Type: field.TypeTime},
|
|
{Name: "updated_at", Type: field.TypeTime},
|
|
{Name: "host_id", Type: field.TypeString},
|
|
{Name: "model_id", Type: field.TypeUUID, Nullable: true},
|
|
{Name: "user_id", Type: field.TypeUUID, Nullable: true},
|
|
}
|
|
// VirtualmachinesTable holds the schema information for the "virtualmachines" table.
|
|
VirtualmachinesTable = &schema.Table{
|
|
Name: "virtualmachines",
|
|
Columns: VirtualmachinesColumns,
|
|
PrimaryKey: []*schema.Column{VirtualmachinesColumns[0]},
|
|
ForeignKeys: []*schema.ForeignKey{
|
|
{
|
|
Symbol: "virtualmachines_hosts_vms",
|
|
Columns: []*schema.Column{VirtualmachinesColumns[22]},
|
|
RefColumns: []*schema.Column{HostsColumns[0]},
|
|
OnDelete: schema.NoAction,
|
|
},
|
|
{
|
|
Symbol: "virtualmachines_models_vms",
|
|
Columns: []*schema.Column{VirtualmachinesColumns[23]},
|
|
RefColumns: []*schema.Column{ModelsColumns[0]},
|
|
OnDelete: schema.SetNull,
|
|
},
|
|
{
|
|
Symbol: "virtualmachines_users_vms",
|
|
Columns: []*schema.Column{VirtualmachinesColumns[24]},
|
|
RefColumns: []*schema.Column{UsersColumns[0]},
|
|
OnDelete: schema.SetNull,
|
|
},
|
|
},
|
|
}
|
|
// Tables holds all the tables in the schema.
|
|
Tables = []*schema.Table{
|
|
AuditsTable,
|
|
GitBotsTable,
|
|
GitBotTasksTable,
|
|
GitBotUsersTable,
|
|
GitIdentitiesTable,
|
|
HostsTable,
|
|
ImagesTable,
|
|
ModelsTable,
|
|
NotifyChannelsTable,
|
|
NotifySendLogsTable,
|
|
NotifySubscriptionsTable,
|
|
ProjectsTable,
|
|
ProjectCollaboratorsTable,
|
|
ProjectGitBotsTable,
|
|
ProjectIssuesTable,
|
|
ProjectIssueCommentsTable,
|
|
ProjectTasksTable,
|
|
TasksTable,
|
|
TaskVirtualmachinesTable,
|
|
TeamsTable,
|
|
TeamGroupsTable,
|
|
TeamGroupHostsTable,
|
|
TeamGroupImagesTable,
|
|
TeamGroupMembersTable,
|
|
TeamGroupModelsTable,
|
|
TeamHostsTable,
|
|
TeamImagesTable,
|
|
TeamMembersTable,
|
|
TeamModelsTable,
|
|
UsersTable,
|
|
UserIdentitiesTable,
|
|
VirtualmachinesTable,
|
|
}
|
|
)
|
|
|
|
func init() {
|
|
AuditsTable.ForeignKeys[0].RefTable = UsersTable
|
|
AuditsTable.Annotation = &entsql.Annotation{
|
|
Table: "audits",
|
|
}
|
|
GitBotsTable.ForeignKeys[0].RefTable = HostsTable
|
|
GitBotsTable.Annotation = &entsql.Annotation{
|
|
Table: "git_bots",
|
|
}
|
|
GitBotTasksTable.ForeignKeys[0].RefTable = GitBotsTable
|
|
GitBotTasksTable.ForeignKeys[1].RefTable = TasksTable
|
|
GitBotTasksTable.Annotation = &entsql.Annotation{
|
|
Table: "git_bot_tasks",
|
|
}
|
|
GitBotUsersTable.ForeignKeys[0].RefTable = GitBotsTable
|
|
GitBotUsersTable.ForeignKeys[1].RefTable = UsersTable
|
|
GitBotUsersTable.Annotation = &entsql.Annotation{
|
|
Table: "git_bot_users",
|
|
}
|
|
GitIdentitiesTable.ForeignKeys[0].RefTable = UsersTable
|
|
GitIdentitiesTable.Annotation = &entsql.Annotation{
|
|
Table: "git_identities",
|
|
}
|
|
HostsTable.ForeignKeys[0].RefTable = UsersTable
|
|
HostsTable.Annotation = &entsql.Annotation{
|
|
Table: "hosts",
|
|
}
|
|
ImagesTable.ForeignKeys[0].RefTable = UsersTable
|
|
ImagesTable.Annotation = &entsql.Annotation{
|
|
Table: "images",
|
|
}
|
|
ModelsTable.ForeignKeys[0].RefTable = UsersTable
|
|
ModelsTable.Annotation = &entsql.Annotation{
|
|
Table: "models",
|
|
}
|
|
NotifyChannelsTable.Annotation = &entsql.Annotation{
|
|
Table: "notify_channels",
|
|
}
|
|
NotifySendLogsTable.Annotation = &entsql.Annotation{
|
|
Table: "notify_send_logs",
|
|
}
|
|
NotifySubscriptionsTable.ForeignKeys[0].RefTable = NotifyChannelsTable
|
|
NotifySubscriptionsTable.Annotation = &entsql.Annotation{
|
|
Table: "notify_subscriptions",
|
|
}
|
|
ProjectsTable.ForeignKeys[0].RefTable = GitIdentitiesTable
|
|
ProjectsTable.ForeignKeys[1].RefTable = ImagesTable
|
|
ProjectsTable.ForeignKeys[2].RefTable = UsersTable
|
|
ProjectsTable.Annotation = &entsql.Annotation{
|
|
Table: "projects",
|
|
}
|
|
ProjectCollaboratorsTable.ForeignKeys[0].RefTable = ProjectsTable
|
|
ProjectCollaboratorsTable.ForeignKeys[1].RefTable = UsersTable
|
|
ProjectCollaboratorsTable.Annotation = &entsql.Annotation{
|
|
Table: "project_collaborators",
|
|
}
|
|
ProjectGitBotsTable.ForeignKeys[0].RefTable = ProjectsTable
|
|
ProjectGitBotsTable.ForeignKeys[1].RefTable = GitBotsTable
|
|
ProjectGitBotsTable.Annotation = &entsql.Annotation{
|
|
Table: "project_git_bots",
|
|
}
|
|
ProjectIssuesTable.ForeignKeys[0].RefTable = ProjectsTable
|
|
ProjectIssuesTable.ForeignKeys[1].RefTable = UsersTable
|
|
ProjectIssuesTable.ForeignKeys[2].RefTable = UsersTable
|
|
ProjectIssuesTable.Annotation = &entsql.Annotation{
|
|
Table: "project_issues",
|
|
}
|
|
ProjectIssueCommentsTable.ForeignKeys[0].RefTable = ProjectIssuesTable
|
|
ProjectIssueCommentsTable.ForeignKeys[1].RefTable = ProjectIssueCommentsTable
|
|
ProjectIssueCommentsTable.ForeignKeys[2].RefTable = UsersTable
|
|
ProjectIssueCommentsTable.Annotation = &entsql.Annotation{
|
|
Table: "project_issue_comments",
|
|
}
|
|
ProjectTasksTable.ForeignKeys[0].RefTable = GitIdentitiesTable
|
|
ProjectTasksTable.ForeignKeys[1].RefTable = ImagesTable
|
|
ProjectTasksTable.ForeignKeys[2].RefTable = ModelsTable
|
|
ProjectTasksTable.ForeignKeys[3].RefTable = ProjectsTable
|
|
ProjectTasksTable.ForeignKeys[4].RefTable = ProjectIssuesTable
|
|
ProjectTasksTable.ForeignKeys[5].RefTable = TasksTable
|
|
ProjectTasksTable.Annotation = &entsql.Annotation{
|
|
Table: "project_tasks",
|
|
}
|
|
TasksTable.ForeignKeys[0].RefTable = UsersTable
|
|
TasksTable.Annotation = &entsql.Annotation{
|
|
Table: "tasks",
|
|
}
|
|
TaskVirtualmachinesTable.ForeignKeys[0].RefTable = TasksTable
|
|
TaskVirtualmachinesTable.ForeignKeys[1].RefTable = VirtualmachinesTable
|
|
TaskVirtualmachinesTable.Annotation = &entsql.Annotation{
|
|
Table: "task_virtualmachines",
|
|
}
|
|
TeamsTable.Annotation = &entsql.Annotation{
|
|
Table: "teams",
|
|
}
|
|
TeamGroupsTable.ForeignKeys[0].RefTable = TeamsTable
|
|
TeamGroupsTable.Annotation = &entsql.Annotation{
|
|
Table: "team_groups",
|
|
}
|
|
TeamGroupHostsTable.ForeignKeys[0].RefTable = TeamGroupsTable
|
|
TeamGroupHostsTable.ForeignKeys[1].RefTable = HostsTable
|
|
TeamGroupHostsTable.Annotation = &entsql.Annotation{
|
|
Table: "team_group_hosts",
|
|
}
|
|
TeamGroupImagesTable.ForeignKeys[0].RefTable = TeamGroupsTable
|
|
TeamGroupImagesTable.ForeignKeys[1].RefTable = ImagesTable
|
|
TeamGroupImagesTable.Annotation = &entsql.Annotation{
|
|
Table: "team_group_images",
|
|
}
|
|
TeamGroupMembersTable.ForeignKeys[0].RefTable = TeamGroupsTable
|
|
TeamGroupMembersTable.ForeignKeys[1].RefTable = UsersTable
|
|
TeamGroupMembersTable.Annotation = &entsql.Annotation{
|
|
Table: "team_group_members",
|
|
}
|
|
TeamGroupModelsTable.ForeignKeys[0].RefTable = TeamGroupsTable
|
|
TeamGroupModelsTable.ForeignKeys[1].RefTable = ModelsTable
|
|
TeamGroupModelsTable.Annotation = &entsql.Annotation{
|
|
Table: "team_group_models",
|
|
}
|
|
TeamHostsTable.ForeignKeys[0].RefTable = TeamsTable
|
|
TeamHostsTable.ForeignKeys[1].RefTable = HostsTable
|
|
TeamHostsTable.Annotation = &entsql.Annotation{
|
|
Table: "team_hosts",
|
|
}
|
|
TeamImagesTable.ForeignKeys[0].RefTable = TeamsTable
|
|
TeamImagesTable.ForeignKeys[1].RefTable = ImagesTable
|
|
TeamImagesTable.Annotation = &entsql.Annotation{
|
|
Table: "team_images",
|
|
}
|
|
TeamMembersTable.ForeignKeys[0].RefTable = TeamsTable
|
|
TeamMembersTable.ForeignKeys[1].RefTable = UsersTable
|
|
TeamMembersTable.Annotation = &entsql.Annotation{
|
|
Table: "team_members",
|
|
}
|
|
TeamModelsTable.ForeignKeys[0].RefTable = TeamsTable
|
|
TeamModelsTable.ForeignKeys[1].RefTable = ModelsTable
|
|
TeamModelsTable.Annotation = &entsql.Annotation{
|
|
Table: "team_models",
|
|
}
|
|
UsersTable.Annotation = &entsql.Annotation{
|
|
Table: "users",
|
|
}
|
|
UserIdentitiesTable.ForeignKeys[0].RefTable = UsersTable
|
|
UserIdentitiesTable.Annotation = &entsql.Annotation{
|
|
Table: "user_identities",
|
|
}
|
|
VirtualmachinesTable.ForeignKeys[0].RefTable = HostsTable
|
|
VirtualmachinesTable.ForeignKeys[1].RefTable = ModelsTable
|
|
VirtualmachinesTable.ForeignKeys[2].RefTable = UsersTable
|
|
VirtualmachinesTable.Annotation = &entsql.Annotation{
|
|
Table: "virtualmachines",
|
|
}
|
|
}
|