// Code generated by entc, DO NOT EDIT.

package migrate

import (
	"entgo.io/ent/dialect/sql/schema"
	"entgo.io/ent/schema/field"
)

var (
	// CaseTriagesColumns holds the columns for the "case_triages" table.
	CaseTriagesColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUint64, Increment: true},
		{Name: "created_at", Type: field.TypeTime, Default: "CURRENT_TIMESTAMP(6)", SchemaType: map[string]string{"mysql": "datetime(6)"}},
		{Name: "updated_at", Type: field.TypeTime, Default: "CURRENT_TIMESTAMP(6)", SchemaType: map[string]string{"mysql": "datetime(6)"}},
		{Name: "plan_execution_id", Type: field.TypeUint64},
		{Name: "plan_id", Type: field.TypeUint64},
		{Name: "case_execution_id", Type: field.TypeUint64},
		{Name: "case_id", Type: field.TypeUint64},
		{Name: "reason", Type: field.TypeEnum, Enums: []string{"CASE", "PRODUCT", "ENV"}, Default: "CASE"},
		{Name: "solution", Type: field.TypeEnum, Enums: []string{"KEEP", "FIX", "PAUSE", "STOP"}, Default: "KEEP"},
		{Name: "issue_link", Type: field.TypeString, Size: 1023, Default: ""},
		{Name: "note", Type: field.TypeString, Size: 2047, Default: ""},
		{Name: "forked_from", Type: field.TypeUint64, Default: 0},
	}
	// CaseTriagesTable holds the schema information for the "case_triages" table.
	CaseTriagesTable = &schema.Table{
		Name:       "case_triages",
		Columns:    CaseTriagesColumns,
		PrimaryKey: []*schema.Column{CaseTriagesColumns[0]},
		Indexes: []*schema.Index{
			{
				Name:    "uniq_case_execution_id",
				Unique:  true,
				Columns: []*schema.Column{CaseTriagesColumns[5]},
			},
			{
				Name:    "idx_forked_from",
				Unique:  false,
				Columns: []*schema.Column{CaseTriagesColumns[11]},
			},
		},
	}
	// ResourceDurationsColumns holds the columns for the "resource_durations" table.
	ResourceDurationsColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUint64, Increment: true},
		{Name: "created_at", Type: field.TypeTime, Default: "CURRENT_TIMESTAMP(6)", SchemaType: map[string]string{"mysql": "datetime(6)"}},
		{Name: "updated_at", Type: field.TypeTime, Default: "CURRENT_TIMESTAMP(6)", SchemaType: map[string]string{"mysql": "datetime(6)"}},
		{Name: "plan_execution_id", Type: field.TypeUint64},
		{Name: "type", Type: field.TypeEnum, Enums: []string{"PREPARE_ERROR", "PREPARE", "RUNNING", "WAIT_TRIAGE", "TRIAGE"}, Default: "PREPARE_ERROR"},
		{Name: "cpu_duration", Type: field.TypeUint64},
		{Name: "memory_duration", Type: field.TypeUint64},
	}
	// ResourceDurationsTable holds the schema information for the "resource_durations" table.
	ResourceDurationsTable = &schema.Table{
		Name:       "resource_durations",
		Columns:    ResourceDurationsColumns,
		PrimaryKey: []*schema.Column{ResourceDurationsColumns[0]},
		Indexes: []*schema.Index{
			{
				Name:    "uniq_plan_execution_id_and_type",
				Unique:  true,
				Columns: []*schema.Column{ResourceDurationsColumns[3], ResourceDurationsColumns[4]},
			},
			{
				Name:    "idx_type",
				Unique:  false,
				Columns: []*schema.Column{ResourceDurationsColumns[4]},
			},
		},
	}
	// TestbedInfosColumns holds the columns for the "testbed_infos" table.
	TestbedInfosColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUint64, Increment: true},
		{Name: "created_at", Type: field.TypeTime, Default: "CURRENT_TIMESTAMP(6)", SchemaType: map[string]string{"mysql": "datetime(6)"}},
		{Name: "updated_at", Type: field.TypeTime, Default: "CURRENT_TIMESTAMP(6)", SchemaType: map[string]string{"mysql": "datetime(6)"}},
		{Name: "name", Type: field.TypeString, Size: 255},
		{Name: "status", Type: field.TypeEnum, Enums: []string{"INITIATING", "READY", "RELEASED", "ERROR"}, Default: "INITIATING"},
		{Name: "plan_execution_id", Type: field.TypeUint64},
		{Name: "url", Type: field.TypeString, Default: ""},
		{Name: "lease_ddl", Type: field.TypeTime, Nullable: true, SchemaType: map[string]string{"mysql": "datetime(6)"}},
		{Name: "initiated_at", Type: field.TypeTime, Nullable: true, SchemaType: map[string]string{"mysql": "datetime(6)"}},
		{Name: "released_at", Type: field.TypeTime, Nullable: true, SchemaType: map[string]string{"mysql": "datetime(6)"}},
		{Name: "released_by", Type: field.TypeUint64, Nullable: true},
		{Name: "physical_resource_request", Type: field.TypeJSON, Nullable: true},
		{Name: "resource_items", Type: field.TypeJSON, Nullable: true},
		{Name: "type", Type: field.TypeEnum, Enums: []string{"NORMAL", "RESTORE_MONITOR"}, Default: "NORMAL"},
		{Name: "set_up_log_url", Type: field.TypeString, Default: ""},
		{Name: "resource_pool_id", Type: field.TypeUint64},
	}
	// TestbedInfosTable holds the schema information for the "testbed_infos" table.
	TestbedInfosTable = &schema.Table{
		Name:       "testbed_infos",
		Columns:    TestbedInfosColumns,
		PrimaryKey: []*schema.Column{TestbedInfosColumns[0]},
		Indexes: []*schema.Index{
			{
				Name:    "uniq_plan_execution_id_and_name",
				Unique:  true,
				Columns: []*schema.Column{TestbedInfosColumns[5], TestbedInfosColumns[3]},
			},
			{
				Name:    "idx_plan_execution_id",
				Unique:  false,
				Columns: []*schema.Column{TestbedInfosColumns[5]},
			},
			{
				Name:    "idx_status",
				Unique:  false,
				Columns: []*schema.Column{TestbedInfosColumns[4]},
			},
		},
	}
	// TriagesColumns holds the columns for the "triages" table.
	TriagesColumns = []*schema.Column{
		{Name: "id", Type: field.TypeUint64, Increment: true},
		{Name: "created_at", Type: field.TypeTime, Default: "CURRENT_TIMESTAMP(6)", SchemaType: map[string]string{"mysql": "datetime(6)"}},
		{Name: "updated_at", Type: field.TypeTime, Default: "CURRENT_TIMESTAMP(6)", SchemaType: map[string]string{"mysql": "datetime(6)"}},
		{Name: "plan_execution_id", Type: field.TypeUint64},
		{Name: "plan_id", Type: field.TypeUint64},
		{Name: "triaging_users", Type: field.TypeJSON},
		{Name: "to_triage_case_exec_ids", Type: field.TypeJSON},
		{Name: "triaged_case_exec_ids", Type: field.TypeJSON},
		{Name: "triage_phase", Type: field.TypeEnum, Enums: []string{"TO_TRIAGE", "TRIAGING", "TRIAGED"}, Default: "TO_TRIAGE"},
		{Name: "started_at", Type: field.TypeTime, Nullable: true, SchemaType: map[string]string{"mysql": "datetime(6)"}},
		{Name: "triaged_at", Type: field.TypeTime, Nullable: true, SchemaType: map[string]string{"mysql": "datetime(6)"}},
		{Name: "reasons", Type: field.TypeJSON},
		{Name: "solution", Type: field.TypeEnum, Enums: []string{"KEEP", "FIX", "PAUSE", "STOP"}, Default: "KEEP"},
		{Name: "note", Type: field.TypeString, Size: 2047, Default: ""},
	}
	// TriagesTable holds the schema information for the "triages" table.
	TriagesTable = &schema.Table{
		Name:       "triages",
		Columns:    TriagesColumns,
		PrimaryKey: []*schema.Column{TriagesColumns[0]},
		Indexes: []*schema.Index{
			{
				Name:    "uniq_plan_execution_id",
				Unique:  true,
				Columns: []*schema.Column{TriagesColumns[3]},
			},
		},
	}
	// Tables holds all the tables in the schema.
	Tables = []*schema.Table{
		CaseTriagesTable,
		ResourceDurationsTable,
		TestbedInfosTable,
		TriagesTable,
	}
)

func init() {
}
