// 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 (
	// DisputeTimelineColumns holds the columns for the "dispute_timeline" table.
	DisputeTimelineColumns = []*schema.Column{
		{Name: "id", Type: field.TypeInt64, Increment: true},
		{Name: "dispute_id", Type: field.TypeInt64},
		{Name: "event_type", Type: field.TypeString, Size: 30},
		{Name: "actor_id", Type: field.TypeInt64, Nullable: true},
		{Name: "actor_name", Type: field.TypeString, Nullable: true, Size: 100},
		{Name: "details", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}},
		{Name: "created_at", Type: field.TypeTime},
	}
	// DisputeTimelineTable holds the schema information for the "dispute_timeline" table.
	DisputeTimelineTable = &schema.Table{
		Name:       "dispute_timeline",
		Columns:    DisputeTimelineColumns,
		PrimaryKey: []*schema.Column{DisputeTimelineColumns[0]},
		Indexes: []*schema.Index{
			{
				Name:    "disputetimeline_dispute_id_created_at",
				Unique:  false,
				Columns: []*schema.Column{DisputeTimelineColumns[1], DisputeTimelineColumns[6]},
			},
		},
	}
	// DisputesColumns holds the columns for the "disputes" table.
	DisputesColumns = []*schema.Column{
		{Name: "id", Type: field.TypeInt64, Increment: true},
		{Name: "order_id", Type: field.TypeInt64, Unique: true},
		{Name: "initiator_id", Type: field.TypeInt64},
		{Name: "initiator_name", Type: field.TypeString, Size: 100},
		{Name: "respondent_id", Type: field.TypeInt64},
		{Name: "reason", Type: field.TypeString},
		{Name: "evidence", Type: field.TypeOther, Nullable: true, SchemaType: map[string]string{"postgres": "text[]"}},
		{Name: "status", Type: field.TypeString, Size: 20, Default: "open"},
		{Name: "result", Type: field.TypeString, Nullable: true, Size: 30},
		{Name: "respondent_reason", Type: field.TypeString, Nullable: true},
		{Name: "respondent_evidence", Type: field.TypeOther, Nullable: true, SchemaType: map[string]string{"postgres": "text[]"}},
		{Name: "appeal_reason", Type: field.TypeString, Nullable: true},
		{Name: "appealed_at", Type: field.TypeTime, Nullable: true},
		{Name: "resolved_by", Type: field.TypeInt64, Nullable: true},
		{Name: "resolved_at", Type: field.TypeTime, Nullable: true},
		{Name: "created_at", Type: field.TypeTime},
		{Name: "updated_at", Type: field.TypeTime},
	}
	// DisputesTable holds the schema information for the "disputes" table.
	DisputesTable = &schema.Table{
		Name:       "disputes",
		Columns:    DisputesColumns,
		PrimaryKey: []*schema.Column{DisputesColumns[0]},
		Indexes: []*schema.Index{
			{
				Name:    "disputes_order_id",
				Unique:  false,
				Columns: []*schema.Column{DisputesColumns[1]},
			},
			{
				Name:    "disputes_status_created_at",
				Unique:  false,
				Columns: []*schema.Column{DisputesColumns[7], DisputesColumns[15]},
			},
			{
				Name:    "disputes_initiator_id",
				Unique:  false,
				Columns: []*schema.Column{DisputesColumns[2]},
			},
			{
				Name:    "disputes_initiator_id_status_created_at",
				Unique:  false,
				Columns: []*schema.Column{DisputesColumns[2], DisputesColumns[7], DisputesColumns[15]},
			},
			{
				Name:    "disputes_respondent_id_status_created_at",
				Unique:  false,
				Columns: []*schema.Column{DisputesColumns[4], DisputesColumns[7], DisputesColumns[15]},
			},
		},
	}
	// Tables holds all the tables in the schema.
	Tables = []*schema.Table{
		DisputeTimelineTable,
		DisputesTable,
	}
)

func init() {
	DisputeTimelineTable.Annotation = &entsql.Annotation{
		Table: "dispute_timeline",
	}
}
