Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // WithGlobalUniqueID sets the universal ids options to the migration. // If this option is enabled, ent migration will allocate a 1<<32 range // for the ids of each entity (table). // Note that this option cannot be applied on tables that already exist. WithGlobalUniqueID = schema.WithGlobalUniqueID // WithDropColumn sets the drop column option to the migration. // If this option is enabled, ent migration will drop old columns // that were used for both fields and edges. This defaults to false. WithDropColumn = schema.WithDropColumn // WithDropIndex sets the drop index option to the migration. // If this option is enabled, ent migration will drop old indexes // that were defined in the schema. This defaults to false. // Note that unique constraints are defined using `UNIQUE INDEX`, // and therefore, it's recommended to enable this option to get more // flexibility in the schema changes. WithDropIndex = schema.WithDropIndex // WithForeignKeys enables creating foreign-key in schema DDL. This defaults to true. WithForeignKeys = schema.WithForeignKeys )
View Source
var ( // ActivityEventsColumns holds the columns for the "activity_events" table. ActivityEventsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "event_type", Type: field.TypeString}, {Name: "message", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "metadata", Type: field.TypeJSON}, {Name: "created_at", Type: field.TypeTime}, {Name: "agent_id", Type: field.TypeUUID, Nullable: true}, {Name: "project_id", Type: field.TypeUUID}, {Name: "ticket_id", Type: field.TypeUUID, Nullable: true}, } // ActivityEventsTable holds the schema information for the "activity_events" table. ActivityEventsTable = &schema.Table{ Name: "activity_events", Columns: ActivityEventsColumns, PrimaryKey: []*schema.Column{ActivityEventsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "activity_events_agents_activity_events", Columns: []*schema.Column{ActivityEventsColumns[5]}, RefColumns: []*schema.Column{AgentsColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "activity_events_projects_activity_events", Columns: []*schema.Column{ActivityEventsColumns[6]}, RefColumns: []*schema.Column{ProjectsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "activity_events_tickets_activity_events", Columns: []*schema.Column{ActivityEventsColumns[7]}, RefColumns: []*schema.Column{TicketsColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "activityevent_ticket_id_created_at", Unique: false, Columns: []*schema.Column{ActivityEventsColumns[7], ActivityEventsColumns[4]}, }, { Name: "activityevent_project_id_created_at", Unique: false, Columns: []*schema.Column{ActivityEventsColumns[6], ActivityEventsColumns[4]}, }, }, } // AgentsColumns holds the columns for the "agents" table. AgentsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "name", Type: field.TypeString}, {Name: "runtime_control_state", Type: field.TypeEnum, Enums: []string{"active", "pause_requested", "paused", "retired"}, Default: "active"}, {Name: "total_tokens_used", Type: field.TypeInt64, Default: 0}, {Name: "total_tickets_completed", Type: field.TypeInt, Default: 0}, {Name: "provider_id", Type: field.TypeUUID}, {Name: "project_id", Type: field.TypeUUID}, } // AgentsTable holds the schema information for the "agents" table. AgentsTable = &schema.Table{ Name: "agents", Columns: AgentsColumns, PrimaryKey: []*schema.Column{AgentsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "agents_agent_providers_agents", Columns: []*schema.Column{AgentsColumns[5]}, RefColumns: []*schema.Column{AgentProvidersColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "agents_projects_agents", Columns: []*schema.Column{AgentsColumns[6]}, RefColumns: []*schema.Column{ProjectsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "agent_project_id_name", Unique: true, Columns: []*schema.Column{AgentsColumns[6], AgentsColumns[1]}, }, { Name: "agent_project_id_runtime_control_state", Unique: false, Columns: []*schema.Column{AgentsColumns[6], AgentsColumns[2]}, }, }, } // AgentProvidersColumns holds the columns for the "agent_providers" table. AgentProvidersColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "name", Type: field.TypeString}, {Name: "adapter_type", Type: field.TypeEnum, Enums: []string{"claude-code-cli", "codex-app-server", "gemini-cli", "custom"}}, {Name: "permission_profile", Type: field.TypeEnum, Enums: []string{"standard", "unrestricted"}, Default: "unrestricted"}, {Name: "cli_command", Type: field.TypeString}, {Name: "cli_args", Type: field.TypeOther, Nullable: true, SchemaType: map[string]string{"postgres": "text[]"}}, {Name: "auth_config", Type: field.TypeJSON}, {Name: "cli_rate_limit", Type: field.TypeJSON}, {Name: "cli_rate_limit_updated_at", Type: field.TypeTime, Nullable: true}, {Name: "model_name", Type: field.TypeString}, {Name: "model_temperature", Type: field.TypeFloat64, Default: 0}, {Name: "model_max_tokens", Type: field.TypeInt, Default: 16384}, {Name: "max_parallel_runs", Type: field.TypeInt, Default: 0}, {Name: "cost_per_input_token", Type: field.TypeFloat64, Default: 0, SchemaType: map[string]string{"postgres": "numeric(18,8)"}}, {Name: "cost_per_output_token", Type: field.TypeFloat64, Default: 0, SchemaType: map[string]string{"postgres": "numeric(18,8)"}}, {Name: "pricing_config", Type: field.TypeJSON}, {Name: "machine_id", Type: field.TypeUUID}, {Name: "organization_id", Type: field.TypeUUID}, } // AgentProvidersTable holds the schema information for the "agent_providers" table. AgentProvidersTable = &schema.Table{ Name: "agent_providers", Columns: AgentProvidersColumns, PrimaryKey: []*schema.Column{AgentProvidersColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "agent_providers_machines_providers", Columns: []*schema.Column{AgentProvidersColumns[16]}, RefColumns: []*schema.Column{MachinesColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "agent_providers_organizations_providers", Columns: []*schema.Column{AgentProvidersColumns[17]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "agentprovider_organization_id_name", Unique: true, Columns: []*schema.Column{AgentProvidersColumns[17], AgentProvidersColumns[1]}, }, }, } // AgentRunsColumns holds the columns for the "agent_runs" table. AgentRunsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "skill_version_ids", Type: field.TypeOther, Nullable: true, SchemaType: map[string]string{"postgres": "text[]"}}, {Name: "status", Type: field.TypeEnum, Enums: []string{"launching", "ready", "executing", "completed", "errored", "terminated"}}, {Name: "session_id", Type: field.TypeString, Nullable: true}, {Name: "runtime_started_at", Type: field.TypeTime, Nullable: true}, {Name: "terminal_at", Type: field.TypeTime, Nullable: true}, {Name: "snapshot_materialized_at", Type: field.TypeTime, Nullable: true}, {Name: "last_error", Type: field.TypeString, Nullable: true}, {Name: "last_heartbeat_at", Type: field.TypeTime, Nullable: true}, {Name: "input_tokens", Type: field.TypeInt64, Default: 0}, {Name: "output_tokens", Type: field.TypeInt64, Default: 0}, {Name: "cached_input_tokens", Type: field.TypeInt64, Default: 0}, {Name: "cache_creation_input_tokens", Type: field.TypeInt64, Default: 0}, {Name: "reasoning_tokens", Type: field.TypeInt64, Default: 0}, {Name: "prompt_tokens", Type: field.TypeInt64, Default: 0}, {Name: "candidate_tokens", Type: field.TypeInt64, Default: 0}, {Name: "tool_tokens", Type: field.TypeInt64, Default: 0}, {Name: "total_tokens", Type: field.TypeInt64, Default: 0}, {Name: "current_step_status", Type: field.TypeString, Nullable: true}, {Name: "current_step_summary", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "current_step_changed_at", Type: field.TypeTime, Nullable: true}, {Name: "completion_summary_status", Type: field.TypeEnum, Nullable: true, Enums: []string{"pending", "completed", "failed"}}, {Name: "completion_summary_markdown", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "completion_summary_json", Type: field.TypeJSON, Nullable: true}, {Name: "completion_summary_input", Type: field.TypeJSON, Nullable: true}, {Name: "completion_summary_generated_at", Type: field.TypeTime, Nullable: true}, {Name: "completion_summary_error", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "created_at", Type: field.TypeTime}, {Name: "agent_id", Type: field.TypeUUID}, {Name: "provider_id", Type: field.TypeUUID}, {Name: "ticket_id", Type: field.TypeUUID}, {Name: "workflow_id", Type: field.TypeUUID}, {Name: "workflow_version_id", Type: field.TypeUUID, Nullable: true}, } // AgentRunsTable holds the schema information for the "agent_runs" table. AgentRunsTable = &schema.Table{ Name: "agent_runs", Columns: AgentRunsColumns, PrimaryKey: []*schema.Column{AgentRunsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "agent_runs_agents_runs", Columns: []*schema.Column{AgentRunsColumns[28]}, RefColumns: []*schema.Column{AgentsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "agent_runs_agent_providers_agent_runs", Columns: []*schema.Column{AgentRunsColumns[29]}, RefColumns: []*schema.Column{AgentProvidersColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "agent_runs_tickets_agent_runs", Columns: []*schema.Column{AgentRunsColumns[30]}, RefColumns: []*schema.Column{TicketsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "agent_runs_workflows_agent_runs", Columns: []*schema.Column{AgentRunsColumns[31]}, RefColumns: []*schema.Column{WorkflowsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "agent_runs_workflow_versions_agent_runs", Columns: []*schema.Column{AgentRunsColumns[32]}, RefColumns: []*schema.Column{WorkflowVersionsColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "agentrun_agent_id_status_last_heartbeat_at", Unique: false, Columns: []*schema.Column{AgentRunsColumns[28], AgentRunsColumns[2], AgentRunsColumns[8]}, }, { Name: "agentrun_provider_id_status", Unique: false, Columns: []*schema.Column{AgentRunsColumns[29], AgentRunsColumns[2]}, }, { Name: "agentrun_ticket_id_created_at", Unique: false, Columns: []*schema.Column{AgentRunsColumns[30], AgentRunsColumns[27]}, }, { Name: "agentrun_ticket_id_terminal_at", Unique: false, Columns: []*schema.Column{AgentRunsColumns[30], AgentRunsColumns[5]}, }, }, } // AgentStepEventsColumns holds the columns for the "agent_step_events" table. AgentStepEventsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "step_status", Type: field.TypeString}, {Name: "summary", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "created_at", Type: field.TypeTime}, {Name: "agent_id", Type: field.TypeUUID}, {Name: "agent_run_id", Type: field.TypeUUID}, {Name: "source_trace_event_id", Type: field.TypeUUID, Nullable: true}, {Name: "project_id", Type: field.TypeUUID}, {Name: "ticket_id", Type: field.TypeUUID}, } // AgentStepEventsTable holds the schema information for the "agent_step_events" table. AgentStepEventsTable = &schema.Table{ Name: "agent_step_events", Columns: AgentStepEventsColumns, PrimaryKey: []*schema.Column{AgentStepEventsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "agent_step_events_agents_agent_step_events", Columns: []*schema.Column{AgentStepEventsColumns[4]}, RefColumns: []*schema.Column{AgentsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "agent_step_events_agent_runs_agent_step_events", Columns: []*schema.Column{AgentStepEventsColumns[5]}, RefColumns: []*schema.Column{AgentRunsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "agent_step_events_agent_trace_events_step_events", Columns: []*schema.Column{AgentStepEventsColumns[6]}, RefColumns: []*schema.Column{AgentTraceEventsColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "agent_step_events_projects_agent_step_events", Columns: []*schema.Column{AgentStepEventsColumns[7]}, RefColumns: []*schema.Column{ProjectsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "agent_step_events_tickets_agent_step_events", Columns: []*schema.Column{AgentStepEventsColumns[8]}, RefColumns: []*schema.Column{TicketsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "agentstepevent_agent_run_id_created_at", Unique: false, Columns: []*schema.Column{AgentStepEventsColumns[5], AgentStepEventsColumns[3]}, }, { Name: "agentstepevent_ticket_id_created_at", Unique: false, Columns: []*schema.Column{AgentStepEventsColumns[8], AgentStepEventsColumns[3]}, }, { Name: "agentstepevent_project_id_created_at", Unique: false, Columns: []*schema.Column{AgentStepEventsColumns[7], AgentStepEventsColumns[3]}, }, }, } // AgentTokensColumns holds the columns for the "agent_tokens" table. AgentTokensColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "principal_kind", Type: field.TypeEnum, Enums: []string{"ticket_agent", "project_conversation"}}, {Name: "principal_id", Type: field.TypeUUID}, {Name: "principal_name", Type: field.TypeString}, {Name: "token_hash", Type: field.TypeString}, {Name: "scopes", Type: field.TypeJSON}, {Name: "expires_at", Type: field.TypeTime}, {Name: "created_at", Type: field.TypeTime}, {Name: "last_used_at", Type: field.TypeTime, Nullable: true}, {Name: "agent_id", Type: field.TypeUUID, Nullable: true}, {Name: "conversation_id", Type: field.TypeUUID, Nullable: true}, {Name: "project_id", Type: field.TypeUUID}, {Name: "ticket_id", Type: field.TypeUUID, Nullable: true}, } // AgentTokensTable holds the schema information for the "agent_tokens" table. AgentTokensTable = &schema.Table{ Name: "agent_tokens", Columns: AgentTokensColumns, PrimaryKey: []*schema.Column{AgentTokensColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "agent_tokens_agents_tokens", Columns: []*schema.Column{AgentTokensColumns[9]}, RefColumns: []*schema.Column{AgentsColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "agent_tokens_chat_conversations_agent_tokens", Columns: []*schema.Column{AgentTokensColumns[10]}, RefColumns: []*schema.Column{ChatConversationsColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "agent_tokens_projects_agent_tokens", Columns: []*schema.Column{AgentTokensColumns[11]}, RefColumns: []*schema.Column{ProjectsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "agent_tokens_tickets_agent_tokens", Columns: []*schema.Column{AgentTokensColumns[12]}, RefColumns: []*schema.Column{TicketsColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "agenttoken_token_hash", Unique: true, Columns: []*schema.Column{AgentTokensColumns[4]}, }, { Name: "agenttoken_project_id_ticket_id", Unique: false, Columns: []*schema.Column{AgentTokensColumns[11], AgentTokensColumns[12]}, }, { Name: "agenttoken_project_id_conversation_id", Unique: false, Columns: []*schema.Column{AgentTokensColumns[11], AgentTokensColumns[10]}, }, { Name: "agenttoken_principal_kind_principal_id", Unique: false, Columns: []*schema.Column{AgentTokensColumns[1], AgentTokensColumns[2]}, }, { Name: "agenttoken_expires_at", Unique: false, Columns: []*schema.Column{AgentTokensColumns[6]}, }, }, } // AgentTraceEventsColumns holds the columns for the "agent_trace_events" table. AgentTraceEventsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "sequence", Type: field.TypeInt64}, {Name: "provider", Type: field.TypeString}, {Name: "kind", Type: field.TypeString}, {Name: "stream", Type: field.TypeString}, {Name: "text", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "payload", Type: field.TypeJSON}, {Name: "created_at", Type: field.TypeTime}, {Name: "agent_id", Type: field.TypeUUID}, {Name: "agent_run_id", Type: field.TypeUUID}, {Name: "project_id", Type: field.TypeUUID}, {Name: "ticket_id", Type: field.TypeUUID}, } // AgentTraceEventsTable holds the schema information for the "agent_trace_events" table. AgentTraceEventsTable = &schema.Table{ Name: "agent_trace_events", Columns: AgentTraceEventsColumns, PrimaryKey: []*schema.Column{AgentTraceEventsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "agent_trace_events_agents_agent_trace_events", Columns: []*schema.Column{AgentTraceEventsColumns[8]}, RefColumns: []*schema.Column{AgentsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "agent_trace_events_agent_runs_agent_trace_events", Columns: []*schema.Column{AgentTraceEventsColumns[9]}, RefColumns: []*schema.Column{AgentRunsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "agent_trace_events_projects_agent_trace_events", Columns: []*schema.Column{AgentTraceEventsColumns[10]}, RefColumns: []*schema.Column{ProjectsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "agent_trace_events_tickets_agent_trace_events", Columns: []*schema.Column{AgentTraceEventsColumns[11]}, RefColumns: []*schema.Column{TicketsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "agenttraceevent_agent_run_id_sequence", Unique: true, Columns: []*schema.Column{AgentTraceEventsColumns[9], AgentTraceEventsColumns[1]}, }, { Name: "agenttraceevent_ticket_id_created_at", Unique: false, Columns: []*schema.Column{AgentTraceEventsColumns[11], AgentTraceEventsColumns[7]}, }, { Name: "agenttraceevent_agent_id_created_at", Unique: false, Columns: []*schema.Column{AgentTraceEventsColumns[8], AgentTraceEventsColumns[7]}, }, { Name: "agenttraceevent_project_id_created_at", Unique: false, Columns: []*schema.Column{AgentTraceEventsColumns[10], AgentTraceEventsColumns[7]}, }, }, } // ApprovalPolicyRulesColumns holds the columns for the "approval_policy_rules" table. ApprovalPolicyRulesColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "scope_kind", Type: field.TypeEnum, Enums: []string{"instance", "organization", "project"}}, {Name: "scope_id", Type: field.TypeString, Default: ""}, {Name: "action_key", Type: field.TypeString}, {Name: "require_role_key", Type: field.TypeString, Default: ""}, {Name: "require_ticket_status", Type: field.TypeString, Default: ""}, {Name: "enabled", Type: field.TypeBool, Default: true}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, } // ApprovalPolicyRulesTable holds the schema information for the "approval_policy_rules" table. ApprovalPolicyRulesTable = &schema.Table{ Name: "approval_policy_rules", Columns: ApprovalPolicyRulesColumns, PrimaryKey: []*schema.Column{ApprovalPolicyRulesColumns[0]}, Indexes: []*schema.Index{ { Name: "approvalpolicyrule_scope_kind_scope_id_action_key", Unique: true, Columns: []*schema.Column{ApprovalPolicyRulesColumns[1], ApprovalPolicyRulesColumns[2], ApprovalPolicyRulesColumns[3]}, }, }, } // BrowserSessionsColumns holds the columns for the "browser_sessions" table. BrowserSessionsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "user_id", Type: field.TypeUUID}, {Name: "session_hash", Type: field.TypeString}, {Name: "expires_at", Type: field.TypeTime}, {Name: "idle_expires_at", Type: field.TypeTime}, {Name: "csrf_secret", Type: field.TypeString}, {Name: "user_agent_hash", Type: field.TypeString, Default: ""}, {Name: "ip_prefix", Type: field.TypeString, Default: ""}, {Name: "revoked_at", Type: field.TypeTime, Nullable: true}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, } // BrowserSessionsTable holds the schema information for the "browser_sessions" table. BrowserSessionsTable = &schema.Table{ Name: "browser_sessions", Columns: BrowserSessionsColumns, PrimaryKey: []*schema.Column{BrowserSessionsColumns[0]}, Indexes: []*schema.Index{ { Name: "browsersession_session_hash", Unique: true, Columns: []*schema.Column{BrowserSessionsColumns[2]}, }, { Name: "browsersession_user_id", Unique: false, Columns: []*schema.Column{BrowserSessionsColumns[1]}, }, { Name: "browsersession_expires_at", Unique: false, Columns: []*schema.Column{BrowserSessionsColumns[3]}, }, }, } // ChatConversationsColumns holds the columns for the "chat_conversations" table. ChatConversationsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "user_id", Type: field.TypeString}, {Name: "source", Type: field.TypeString}, {Name: "provider_id", Type: field.TypeUUID}, {Name: "status", Type: field.TypeString, Default: "active"}, {Name: "provider_thread_id", Type: field.TypeString, Nullable: true}, {Name: "last_turn_id", Type: field.TypeString, Nullable: true}, {Name: "provider_thread_status", Type: field.TypeString, Nullable: true}, {Name: "provider_thread_active_flags", Type: field.TypeJSON, Nullable: true}, {Name: "rolling_summary", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "last_activity_at", Type: field.TypeTime}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "project_id", Type: field.TypeUUID}, } // ChatConversationsTable holds the schema information for the "chat_conversations" table. ChatConversationsTable = &schema.Table{ Name: "chat_conversations", Columns: ChatConversationsColumns, PrimaryKey: []*schema.Column{ChatConversationsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "chat_conversations_projects_chat_conversations", Columns: []*schema.Column{ChatConversationsColumns[13]}, RefColumns: []*schema.Column{ProjectsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "chatconversation_project_id_user_id_source_provider_id_last_activity_at", Unique: false, Columns: []*schema.Column{ChatConversationsColumns[13], ChatConversationsColumns[1], ChatConversationsColumns[2], ChatConversationsColumns[3], ChatConversationsColumns[10]}, }, }, } // ChatEntriesColumns holds the columns for the "chat_entries" table. ChatEntriesColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "seq", Type: field.TypeInt}, {Name: "kind", Type: field.TypeString}, {Name: "payload_json", Type: field.TypeJSON}, {Name: "created_at", Type: field.TypeTime}, {Name: "conversation_id", Type: field.TypeUUID}, {Name: "turn_id", Type: field.TypeUUID, Nullable: true}, } // ChatEntriesTable holds the schema information for the "chat_entries" table. ChatEntriesTable = &schema.Table{ Name: "chat_entries", Columns: ChatEntriesColumns, PrimaryKey: []*schema.Column{ChatEntriesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "chat_entries_chat_conversations_entries", Columns: []*schema.Column{ChatEntriesColumns[5]}, RefColumns: []*schema.Column{ChatConversationsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "chat_entries_chat_turns_entries", Columns: []*schema.Column{ChatEntriesColumns[6]}, RefColumns: []*schema.Column{ChatTurnsColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "chatentry_conversation_id_seq", Unique: true, Columns: []*schema.Column{ChatEntriesColumns[5], ChatEntriesColumns[1]}, }, { Name: "chatentry_turn_id_seq", Unique: false, Columns: []*schema.Column{ChatEntriesColumns[6], ChatEntriesColumns[1]}, }, }, } // ChatPendingInterruptsColumns holds the columns for the "chat_pending_interrupts" table. ChatPendingInterruptsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "provider_request_id", Type: field.TypeString}, {Name: "kind", Type: field.TypeString}, {Name: "payload_json", Type: field.TypeJSON}, {Name: "status", Type: field.TypeString, Default: "pending"}, {Name: "decision", Type: field.TypeString, Nullable: true}, {Name: "response_json", Type: field.TypeJSON, Nullable: true}, {Name: "resolved_at", Type: field.TypeTime, Nullable: true}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "conversation_id", Type: field.TypeUUID}, {Name: "turn_id", Type: field.TypeUUID}, } // ChatPendingInterruptsTable holds the schema information for the "chat_pending_interrupts" table. ChatPendingInterruptsTable = &schema.Table{ Name: "chat_pending_interrupts", Columns: ChatPendingInterruptsColumns, PrimaryKey: []*schema.Column{ChatPendingInterruptsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "chat_pending_interrupts_chat_conversations_pending_interrupts", Columns: []*schema.Column{ChatPendingInterruptsColumns[10]}, RefColumns: []*schema.Column{ChatConversationsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "chat_pending_interrupts_chat_turns_pending_interrupts", Columns: []*schema.Column{ChatPendingInterruptsColumns[11]}, RefColumns: []*schema.Column{ChatTurnsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "chatpendinginterrupt_conversation_id_status_created_at", Unique: false, Columns: []*schema.Column{ChatPendingInterruptsColumns[10], ChatPendingInterruptsColumns[4], ChatPendingInterruptsColumns[8]}, }, { Name: "chatpendinginterrupt_conversation_id_provider_request_id", Unique: true, Columns: []*schema.Column{ChatPendingInterruptsColumns[10], ChatPendingInterruptsColumns[1]}, }, }, } // ChatTurnsColumns holds the columns for the "chat_turns" table. ChatTurnsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "turn_index", Type: field.TypeInt}, {Name: "provider_turn_id", Type: field.TypeString, Nullable: true}, {Name: "status", Type: field.TypeString, Default: "pending"}, {Name: "started_at", Type: field.TypeTime}, {Name: "completed_at", Type: field.TypeTime, Nullable: true}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "conversation_id", Type: field.TypeUUID}, } // ChatTurnsTable holds the schema information for the "chat_turns" table. ChatTurnsTable = &schema.Table{ Name: "chat_turns", Columns: ChatTurnsColumns, PrimaryKey: []*schema.Column{ChatTurnsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "chat_turns_chat_conversations_turns", Columns: []*schema.Column{ChatTurnsColumns[8]}, RefColumns: []*schema.Column{ChatConversationsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "chatturn_conversation_id_turn_index", Unique: true, Columns: []*schema.Column{ChatTurnsColumns[8], ChatTurnsColumns[1]}, }, { Name: "chatturn_conversation_id_started_at", Unique: false, Columns: []*schema.Column{ChatTurnsColumns[8], ChatTurnsColumns[4]}, }, }, } // MachinesColumns holds the columns for the "machines" table. MachinesColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "name", Type: field.TypeString}, {Name: "host", Type: field.TypeString}, {Name: "port", Type: field.TypeInt, Default: 22}, {Name: "connection_mode", Type: field.TypeEnum, Enums: []string{"local", "ssh", "ws_reverse", "ws_listener"}, Default: "ssh"}, {Name: "transport_capabilities", Type: field.TypeOther, Nullable: true, SchemaType: map[string]string{"postgres": "text[]"}}, {Name: "ssh_user", Type: field.TypeString, Nullable: true}, {Name: "ssh_key_path", Type: field.TypeString, Nullable: true}, {Name: "advertised_endpoint", Type: field.TypeString, Nullable: true}, {Name: "daemon_registered", Type: field.TypeBool, Default: false}, {Name: "daemon_last_registered_at", Type: field.TypeTime, Nullable: true}, {Name: "daemon_session_id", Type: field.TypeString, Nullable: true}, {Name: "daemon_session_state", Type: field.TypeEnum, Enums: []string{"unknown", "connected", "disconnected", "unavailable"}, Default: "unknown"}, {Name: "detected_os", Type: field.TypeEnum, Enums: []string{"darwin", "linux", "unknown"}, Default: "unknown"}, {Name: "detected_arch", Type: field.TypeEnum, Enums: []string{"amd64", "arm64", "unknown"}, Default: "unknown"}, {Name: "detection_status", Type: field.TypeEnum, Enums: []string{"pending", "ok", "degraded", "unknown"}, Default: "unknown"}, {Name: "channel_credential_kind", Type: field.TypeEnum, Enums: []string{"none", "token", "certificate"}, Default: "none"}, {Name: "channel_token_id", Type: field.TypeString, Nullable: true}, {Name: "channel_certificate_id", Type: field.TypeString, Nullable: true}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "labels", Type: field.TypeOther, Nullable: true, SchemaType: map[string]string{"postgres": "text[]"}}, {Name: "status", Type: field.TypeEnum, Enums: []string{"online", "offline", "degraded", "maintenance"}, Default: "maintenance"}, {Name: "workspace_root", Type: field.TypeString, Nullable: true}, {Name: "agent_cli_path", Type: field.TypeString, Nullable: true}, {Name: "env_vars", Type: field.TypeOther, Nullable: true, SchemaType: map[string]string{"postgres": "text[]"}}, {Name: "last_heartbeat_at", Type: field.TypeTime, Nullable: true}, {Name: "resources", Type: field.TypeJSON}, {Name: "organization_id", Type: field.TypeUUID}, } // MachinesTable holds the schema information for the "machines" table. MachinesTable = &schema.Table{ Name: "machines", Columns: MachinesColumns, PrimaryKey: []*schema.Column{MachinesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "machines_organizations_machines", Columns: []*schema.Column{MachinesColumns[27]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "machine_organization_id_name", Unique: true, Columns: []*schema.Column{MachinesColumns[27], MachinesColumns[1]}, }, { Name: "machine_organization_id_host", Unique: false, Columns: []*schema.Column{MachinesColumns[27], MachinesColumns[2]}, }, { Name: "machine_labels", Unique: false, Columns: []*schema.Column{MachinesColumns[20]}, Annotation: &entsql.IndexAnnotation{ Type: "GIN", }, }, }, } // MachineChannelTokensColumns holds the columns for the "machine_channel_tokens" table. MachineChannelTokensColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "token_hash", Type: field.TypeString}, {Name: "status", Type: field.TypeEnum, Enums: []string{"active", "revoked"}, Default: "active"}, {Name: "expires_at", Type: field.TypeTime}, {Name: "created_at", Type: field.TypeTime}, {Name: "last_used_at", Type: field.TypeTime, Nullable: true}, {Name: "revoked_at", Type: field.TypeTime, Nullable: true}, {Name: "machine_id", Type: field.TypeUUID}, } // MachineChannelTokensTable holds the schema information for the "machine_channel_tokens" table. MachineChannelTokensTable = &schema.Table{ Name: "machine_channel_tokens", Columns: MachineChannelTokensColumns, PrimaryKey: []*schema.Column{MachineChannelTokensColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "machine_channel_tokens_machines_channel_tokens", Columns: []*schema.Column{MachineChannelTokensColumns[7]}, RefColumns: []*schema.Column{MachinesColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "machinechanneltoken_token_hash", Unique: true, Columns: []*schema.Column{MachineChannelTokensColumns[1]}, }, { Name: "machinechanneltoken_machine_id_status", Unique: false, Columns: []*schema.Column{MachineChannelTokensColumns[7], MachineChannelTokensColumns[2]}, }, { Name: "machinechanneltoken_expires_at", Unique: false, Columns: []*schema.Column{MachineChannelTokensColumns[3]}, }, }, } // NotificationChannelsColumns holds the columns for the "notification_channels" table. NotificationChannelsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "name", Type: field.TypeString}, {Name: "type", Type: field.TypeString}, {Name: "config", Type: field.TypeJSON}, {Name: "is_enabled", Type: field.TypeBool, Default: true}, {Name: "created_at", Type: field.TypeTime}, {Name: "organization_id", Type: field.TypeUUID}, } // NotificationChannelsTable holds the schema information for the "notification_channels" table. NotificationChannelsTable = &schema.Table{ Name: "notification_channels", Columns: NotificationChannelsColumns, PrimaryKey: []*schema.Column{NotificationChannelsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "notification_channels_organizations_notification_channels", Columns: []*schema.Column{NotificationChannelsColumns[6]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "notificationchannel_organization_id_name", Unique: true, Columns: []*schema.Column{NotificationChannelsColumns[6], NotificationChannelsColumns[1]}, }, { Name: "notificationchannel_organization_id_type", Unique: false, Columns: []*schema.Column{NotificationChannelsColumns[6], NotificationChannelsColumns[2]}, }, }, } // NotificationRulesColumns holds the columns for the "notification_rules" table. NotificationRulesColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "name", Type: field.TypeString}, {Name: "event_type", Type: field.TypeString}, {Name: "filter", Type: field.TypeJSON}, {Name: "template", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "is_enabled", Type: field.TypeBool, Default: true}, {Name: "created_at", Type: field.TypeTime}, {Name: "channel_id", Type: field.TypeUUID}, {Name: "project_id", Type: field.TypeUUID}, } // NotificationRulesTable holds the schema information for the "notification_rules" table. NotificationRulesTable = &schema.Table{ Name: "notification_rules", Columns: NotificationRulesColumns, PrimaryKey: []*schema.Column{NotificationRulesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "notification_rules_notification_channels_notification_rules", Columns: []*schema.Column{NotificationRulesColumns[7]}, RefColumns: []*schema.Column{NotificationChannelsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "notification_rules_projects_notification_rules", Columns: []*schema.Column{NotificationRulesColumns[8]}, RefColumns: []*schema.Column{ProjectsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "notificationrule_project_id_name", Unique: true, Columns: []*schema.Column{NotificationRulesColumns[8], NotificationRulesColumns[1]}, }, { Name: "notificationrule_project_id_event_type", Unique: false, Columns: []*schema.Column{NotificationRulesColumns[8], NotificationRulesColumns[2]}, }, { Name: "notificationrule_channel_id", Unique: false, Columns: []*schema.Column{NotificationRulesColumns[7]}, }, }, } // OrganizationsColumns holds the columns for the "organizations" table. OrganizationsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "name", Type: field.TypeString}, {Name: "slug", Type: field.TypeString}, {Name: "status", Type: field.TypeEnum, Enums: []string{"active", "archived"}, Default: "active"}, {Name: "github_outbound_credential", Type: field.TypeJSON, Nullable: true}, {Name: "github_token_probe", Type: field.TypeJSON, Nullable: true}, {Name: "default_agent_provider_id", Type: field.TypeUUID, Nullable: true}, } // OrganizationsTable holds the schema information for the "organizations" table. OrganizationsTable = &schema.Table{ Name: "organizations", Columns: OrganizationsColumns, PrimaryKey: []*schema.Column{OrganizationsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "organizations_agent_providers_default_agent_provider", Columns: []*schema.Column{OrganizationsColumns[6]}, RefColumns: []*schema.Column{AgentProvidersColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "organization_slug", Unique: true, Columns: []*schema.Column{OrganizationsColumns[2]}, }, }, } // OrganizationDailyTokenUsagesColumns holds the columns for the "organization_daily_token_usages" table. OrganizationDailyTokenUsagesColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "usage_date", Type: field.TypeTime, SchemaType: map[string]string{"postgres": "date"}}, {Name: "input_tokens", Type: field.TypeInt64, Default: 0}, {Name: "output_tokens", Type: field.TypeInt64, Default: 0}, {Name: "cached_input_tokens", Type: field.TypeInt64, Default: 0}, {Name: "reasoning_tokens", Type: field.TypeInt64, Default: 0}, {Name: "total_tokens", Type: field.TypeInt64, Default: 0}, {Name: "finalized_run_count", Type: field.TypeInt, Default: 0}, {Name: "recomputed_at", Type: field.TypeTime}, {Name: "source_mode", Type: field.TypeEnum, Enums: []string{"materialized", "lazy_backfill"}, Default: "materialized"}, {Name: "organization_id", Type: field.TypeUUID}, } // OrganizationDailyTokenUsagesTable holds the schema information for the "organization_daily_token_usages" table. OrganizationDailyTokenUsagesTable = &schema.Table{ Name: "organization_daily_token_usages", Columns: OrganizationDailyTokenUsagesColumns, PrimaryKey: []*schema.Column{OrganizationDailyTokenUsagesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "organization_daily_token_usages_organizations_daily_token_usage", Columns: []*schema.Column{OrganizationDailyTokenUsagesColumns[10]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "organizationdailytokenusage_organization_id_usage_date", Unique: true, Columns: []*schema.Column{OrganizationDailyTokenUsagesColumns[10], OrganizationDailyTokenUsagesColumns[1]}, }, { Name: "organizationdailytokenusage_usage_date", Unique: false, Columns: []*schema.Column{OrganizationDailyTokenUsagesColumns[1]}, }, }, } // ProjectsColumns holds the columns for the "projects" table. ProjectsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "name", Type: field.TypeString}, {Name: "slug", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "status", Type: field.TypeString, Default: "Planned"}, {Name: "github_outbound_credential", Type: field.TypeJSON, Nullable: true}, {Name: "github_token_probe", Type: field.TypeJSON, Nullable: true}, {Name: "accessible_machine_ids", Type: field.TypeJSON}, {Name: "max_concurrent_agents", Type: field.TypeInt, Default: 0}, {Name: "agent_run_summary_prompt", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "organization_id", Type: field.TypeUUID}, {Name: "default_agent_provider_id", Type: field.TypeUUID, Nullable: true}, } // 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_organizations_projects", Columns: []*schema.Column{ProjectsColumns[10]}, RefColumns: []*schema.Column{OrganizationsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "projects_agent_providers_default_agent_provider", Columns: []*schema.Column{ProjectsColumns[11]}, RefColumns: []*schema.Column{AgentProvidersColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "project_organization_id_slug", Unique: true, Columns: []*schema.Column{ProjectsColumns[10], ProjectsColumns[2]}, }, }, } // ProjectConversationPrincipalsColumns holds the columns for the "project_conversation_principals" table. ProjectConversationPrincipalsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "conversation_id", Type: field.TypeUUID, Unique: true}, {Name: "project_id", Type: field.TypeUUID}, {Name: "provider_id", Type: field.TypeUUID}, {Name: "name", Type: field.TypeString}, {Name: "status", Type: field.TypeEnum, Enums: []string{"active", "closed"}, Default: "active"}, {Name: "runtime_state", Type: field.TypeEnum, Enums: []string{"inactive", "ready", "executing", "interrupted"}, Default: "inactive"}, {Name: "current_session_id", Type: field.TypeString, Nullable: true}, {Name: "current_workspace_path", Type: field.TypeString, Nullable: true}, {Name: "current_run_id", Type: field.TypeUUID, Nullable: true}, {Name: "last_heartbeat_at", Type: field.TypeTime, Nullable: true}, {Name: "current_step_status", Type: field.TypeString, Nullable: true}, {Name: "current_step_summary", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "current_step_changed_at", Type: field.TypeTime, Nullable: true}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "closed_at", Type: field.TypeTime, Nullable: true}, } // ProjectConversationPrincipalsTable holds the schema information for the "project_conversation_principals" table. ProjectConversationPrincipalsTable = &schema.Table{ Name: "project_conversation_principals", Columns: ProjectConversationPrincipalsColumns, PrimaryKey: []*schema.Column{ProjectConversationPrincipalsColumns[0]}, Indexes: []*schema.Index{ { Name: "projectconversationprincipal_project_id_status", Unique: false, Columns: []*schema.Column{ProjectConversationPrincipalsColumns[2], ProjectConversationPrincipalsColumns[5]}, }, { Name: "projectconversationprincipal_project_id_runtime_state", Unique: false, Columns: []*schema.Column{ProjectConversationPrincipalsColumns[2], ProjectConversationPrincipalsColumns[6]}, }, { Name: "projectconversationprincipal_current_run_id", Unique: false, Columns: []*schema.Column{ProjectConversationPrincipalsColumns[9]}, }, }, } // ProjectConversationRunsColumns holds the columns for the "project_conversation_runs" table. ProjectConversationRunsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "principal_id", Type: field.TypeUUID}, {Name: "conversation_id", Type: field.TypeUUID}, {Name: "project_id", Type: field.TypeUUID}, {Name: "provider_id", Type: field.TypeUUID}, {Name: "turn_id", Type: field.TypeUUID, Nullable: true}, {Name: "status", Type: field.TypeEnum, Enums: []string{"launching", "executing", "interrupted", "completed", "failed", "terminated"}}, {Name: "session_id", Type: field.TypeString, Nullable: true}, {Name: "workspace_path", Type: field.TypeString, Nullable: true}, {Name: "provider_thread_id", Type: field.TypeString, Nullable: true}, {Name: "provider_turn_id", Type: field.TypeString, Nullable: true}, {Name: "runtime_started_at", Type: field.TypeTime, Nullable: true}, {Name: "terminal_at", Type: field.TypeTime, Nullable: true}, {Name: "last_error", Type: field.TypeString, Nullable: true}, {Name: "last_heartbeat_at", Type: field.TypeTime, Nullable: true}, {Name: "cost_amount", Type: field.TypeFloat64, Default: 0}, {Name: "input_tokens", Type: field.TypeInt64, Default: 0}, {Name: "output_tokens", Type: field.TypeInt64, Default: 0}, {Name: "cached_input_tokens", Type: field.TypeInt64, Default: 0}, {Name: "cache_creation_tokens", Type: field.TypeInt64, Default: 0}, {Name: "reasoning_tokens", Type: field.TypeInt64, Default: 0}, {Name: "prompt_tokens", Type: field.TypeInt64, Default: 0}, {Name: "candidate_tokens", Type: field.TypeInt64, Default: 0}, {Name: "tool_tokens", Type: field.TypeInt64, Default: 0}, {Name: "total_tokens", Type: field.TypeInt64, Default: 0}, {Name: "current_step_status", Type: field.TypeString, Nullable: true}, {Name: "current_step_summary", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "current_step_changed_at", Type: field.TypeTime, Nullable: true}, {Name: "created_at", Type: field.TypeTime}, } // ProjectConversationRunsTable holds the schema information for the "project_conversation_runs" table. ProjectConversationRunsTable = &schema.Table{ Name: "project_conversation_runs", Columns: ProjectConversationRunsColumns, PrimaryKey: []*schema.Column{ProjectConversationRunsColumns[0]}, Indexes: []*schema.Index{ { Name: "projectconversationrun_principal_id_created_at", Unique: false, Columns: []*schema.Column{ProjectConversationRunsColumns[1], ProjectConversationRunsColumns[28]}, }, { Name: "projectconversationrun_conversation_id_created_at", Unique: false, Columns: []*schema.Column{ProjectConversationRunsColumns[2], ProjectConversationRunsColumns[28]}, }, { Name: "projectconversationrun_status_last_heartbeat_at", Unique: false, Columns: []*schema.Column{ProjectConversationRunsColumns[6], ProjectConversationRunsColumns[14]}, }, { Name: "projectconversationrun_turn_id", Unique: true, Columns: []*schema.Column{ProjectConversationRunsColumns[5]}, }, }, } // ProjectConversationStepEventsColumns holds the columns for the "project_conversation_step_events" table. ProjectConversationStepEventsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "principal_id", Type: field.TypeUUID}, {Name: "run_id", Type: field.TypeUUID}, {Name: "conversation_id", Type: field.TypeUUID}, {Name: "project_id", Type: field.TypeUUID}, {Name: "step_status", Type: field.TypeString}, {Name: "summary", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "source_trace_event_id", Type: field.TypeUUID, Nullable: true}, {Name: "created_at", Type: field.TypeTime}, } // ProjectConversationStepEventsTable holds the schema information for the "project_conversation_step_events" table. ProjectConversationStepEventsTable = &schema.Table{ Name: "project_conversation_step_events", Columns: ProjectConversationStepEventsColumns, PrimaryKey: []*schema.Column{ProjectConversationStepEventsColumns[0]}, Indexes: []*schema.Index{ { Name: "projectconversationstepevent_run_id_created_at", Unique: false, Columns: []*schema.Column{ProjectConversationStepEventsColumns[2], ProjectConversationStepEventsColumns[8]}, }, { Name: "projectconversationstepevent_conversation_id_created_at", Unique: false, Columns: []*schema.Column{ProjectConversationStepEventsColumns[3], ProjectConversationStepEventsColumns[8]}, }, { Name: "projectconversationstepevent_principal_id_created_at", Unique: false, Columns: []*schema.Column{ProjectConversationStepEventsColumns[1], ProjectConversationStepEventsColumns[8]}, }, }, } // ProjectConversationTraceEventsColumns holds the columns for the "project_conversation_trace_events" table. ProjectConversationTraceEventsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "principal_id", Type: field.TypeUUID}, {Name: "run_id", Type: field.TypeUUID}, {Name: "conversation_id", Type: field.TypeUUID}, {Name: "project_id", Type: field.TypeUUID}, {Name: "sequence", Type: field.TypeInt64}, {Name: "provider", Type: field.TypeString}, {Name: "kind", Type: field.TypeString}, {Name: "stream", Type: field.TypeString}, {Name: "text", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "payload", Type: field.TypeJSON}, {Name: "created_at", Type: field.TypeTime}, } // ProjectConversationTraceEventsTable holds the schema information for the "project_conversation_trace_events" table. ProjectConversationTraceEventsTable = &schema.Table{ Name: "project_conversation_trace_events", Columns: ProjectConversationTraceEventsColumns, PrimaryKey: []*schema.Column{ProjectConversationTraceEventsColumns[0]}, Indexes: []*schema.Index{ { Name: "projectconversationtraceevent_run_id_sequence", Unique: true, Columns: []*schema.Column{ProjectConversationTraceEventsColumns[2], ProjectConversationTraceEventsColumns[5]}, }, { Name: "projectconversationtraceevent_conversation_id_created_at", Unique: false, Columns: []*schema.Column{ProjectConversationTraceEventsColumns[3], ProjectConversationTraceEventsColumns[11]}, }, { Name: "projectconversationtraceevent_principal_id_created_at", Unique: false, Columns: []*schema.Column{ProjectConversationTraceEventsColumns[1], ProjectConversationTraceEventsColumns[11]}, }, }, } // ProjectReposColumns holds the columns for the "project_repos" table. ProjectReposColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "name", Type: field.TypeString}, {Name: "repository_url", Type: field.TypeString}, {Name: "default_branch", Type: field.TypeString, Default: "main"}, {Name: "workspace_dirname", Type: field.TypeString, Default: ""}, {Name: "labels", Type: field.TypeOther, Nullable: true, SchemaType: map[string]string{"postgres": "text[]"}}, {Name: "project_id", Type: field.TypeUUID}, } // ProjectReposTable holds the schema information for the "project_repos" table. ProjectReposTable = &schema.Table{ Name: "project_repos", Columns: ProjectReposColumns, PrimaryKey: []*schema.Column{ProjectReposColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "project_repos_projects_repos", Columns: []*schema.Column{ProjectReposColumns[6]}, RefColumns: []*schema.Column{ProjectsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "projectrepo_project_id_name", Unique: true, Columns: []*schema.Column{ProjectReposColumns[6], ProjectReposColumns[1]}, }, { Name: "projectrepo_labels", Unique: false, Columns: []*schema.Column{ProjectReposColumns[5]}, Annotation: &entsql.IndexAnnotation{ Type: "GIN", }, }, }, } // ProjectUpdateCommentsColumns holds the columns for the "project_update_comments" table. ProjectUpdateCommentsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "body_markdown", Type: field.TypeString, Size: 2147483647}, {Name: "created_by", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "edited_at", Type: field.TypeTime, Nullable: true}, {Name: "edit_count", Type: field.TypeInt, Default: 0}, {Name: "last_edited_by", Type: field.TypeString, Nullable: true}, {Name: "is_deleted", Type: field.TypeBool, Default: false}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "thread_id", Type: field.TypeUUID}, } // ProjectUpdateCommentsTable holds the schema information for the "project_update_comments" table. ProjectUpdateCommentsTable = &schema.Table{ Name: "project_update_comments", Columns: ProjectUpdateCommentsColumns, PrimaryKey: []*schema.Column{ProjectUpdateCommentsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "project_update_comments_project_update_threads_comments", Columns: []*schema.Column{ProjectUpdateCommentsColumns[11]}, RefColumns: []*schema.Column{ProjectUpdateThreadsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "projectupdatecomment_thread_id_created_at_id", Unique: false, Columns: []*schema.Column{ProjectUpdateCommentsColumns[11], ProjectUpdateCommentsColumns[3], ProjectUpdateCommentsColumns[0]}, }, }, } // ProjectUpdateCommentRevisionsColumns holds the columns for the "project_update_comment_revisions" table. ProjectUpdateCommentRevisionsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "revision_number", Type: field.TypeInt}, {Name: "body_markdown", Type: field.TypeString, Size: 2147483647}, {Name: "edited_by", Type: field.TypeString}, {Name: "edited_at", Type: field.TypeTime}, {Name: "edit_reason", Type: field.TypeString, Nullable: true}, {Name: "comment_id", Type: field.TypeUUID}, } // ProjectUpdateCommentRevisionsTable holds the schema information for the "project_update_comment_revisions" table. ProjectUpdateCommentRevisionsTable = &schema.Table{ Name: "project_update_comment_revisions", Columns: ProjectUpdateCommentRevisionsColumns, PrimaryKey: []*schema.Column{ProjectUpdateCommentRevisionsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "project_update_comment_revisions_project_update_comments_revisions", Columns: []*schema.Column{ProjectUpdateCommentRevisionsColumns[6]}, RefColumns: []*schema.Column{ProjectUpdateCommentsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "projectupdatecommentrevision_comment_id_revision_number", Unique: true, Columns: []*schema.Column{ProjectUpdateCommentRevisionsColumns[6], ProjectUpdateCommentRevisionsColumns[1]}, }, { Name: "projectupdatecommentrevision_comment_id_edited_at_id", Unique: false, Columns: []*schema.Column{ProjectUpdateCommentRevisionsColumns[6], ProjectUpdateCommentRevisionsColumns[4], ProjectUpdateCommentRevisionsColumns[0]}, }, }, } // ProjectUpdateThreadsColumns holds the columns for the "project_update_threads" table. ProjectUpdateThreadsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "status", Type: field.TypeEnum, Enums: []string{"on_track", "at_risk", "off_track"}}, {Name: "title", Type: field.TypeString}, {Name: "body_markdown", Type: field.TypeString, Size: 2147483647}, {Name: "created_by", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "edited_at", Type: field.TypeTime, Nullable: true}, {Name: "edit_count", Type: field.TypeInt, Default: 0}, {Name: "last_edited_by", Type: field.TypeString, Nullable: true}, {Name: "is_deleted", Type: field.TypeBool, Default: false}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "last_activity_at", Type: field.TypeTime}, {Name: "comment_count", Type: field.TypeInt, Default: 0}, {Name: "project_id", Type: field.TypeUUID}, } // ProjectUpdateThreadsTable holds the schema information for the "project_update_threads" table. ProjectUpdateThreadsTable = &schema.Table{ Name: "project_update_threads", Columns: ProjectUpdateThreadsColumns, PrimaryKey: []*schema.Column{ProjectUpdateThreadsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "project_update_threads_projects_update_threads", Columns: []*schema.Column{ProjectUpdateThreadsColumns[15]}, RefColumns: []*schema.Column{ProjectsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "projectupdatethread_project_id_last_activity_at_id", Unique: false, Columns: []*schema.Column{ProjectUpdateThreadsColumns[15], ProjectUpdateThreadsColumns[13], ProjectUpdateThreadsColumns[0]}, }, { Name: "projectupdatethread_project_id_created_at_id", Unique: false, Columns: []*schema.Column{ProjectUpdateThreadsColumns[15], ProjectUpdateThreadsColumns[5], ProjectUpdateThreadsColumns[0]}, }, }, } // ProjectUpdateThreadRevisionsColumns holds the columns for the "project_update_thread_revisions" table. ProjectUpdateThreadRevisionsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "revision_number", Type: field.TypeInt}, {Name: "status", Type: field.TypeEnum, Enums: []string{"on_track", "at_risk", "off_track"}}, {Name: "title", Type: field.TypeString}, {Name: "body_markdown", Type: field.TypeString, Size: 2147483647}, {Name: "edited_by", Type: field.TypeString}, {Name: "edited_at", Type: field.TypeTime}, {Name: "edit_reason", Type: field.TypeString, Nullable: true}, {Name: "thread_id", Type: field.TypeUUID}, } // ProjectUpdateThreadRevisionsTable holds the schema information for the "project_update_thread_revisions" table. ProjectUpdateThreadRevisionsTable = &schema.Table{ Name: "project_update_thread_revisions", Columns: ProjectUpdateThreadRevisionsColumns, PrimaryKey: []*schema.Column{ProjectUpdateThreadRevisionsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "project_update_thread_revisions_project_update_threads_revisions", Columns: []*schema.Column{ProjectUpdateThreadRevisionsColumns[8]}, RefColumns: []*schema.Column{ProjectUpdateThreadsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "projectupdatethreadrevision_thread_id_revision_number", Unique: true, Columns: []*schema.Column{ProjectUpdateThreadRevisionsColumns[8], ProjectUpdateThreadRevisionsColumns[1]}, }, { Name: "projectupdatethreadrevision_thread_id_edited_at_id", Unique: false, Columns: []*schema.Column{ProjectUpdateThreadRevisionsColumns[8], ProjectUpdateThreadRevisionsColumns[6], ProjectUpdateThreadRevisionsColumns[0]}, }, }, } // RoleBindingsColumns holds the columns for the "role_bindings" table. RoleBindingsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "scope_kind", Type: field.TypeEnum, Enums: []string{"instance", "organization", "project"}}, {Name: "scope_id", Type: field.TypeString, Default: ""}, {Name: "subject_kind", Type: field.TypeEnum, Enums: []string{"user", "group"}}, {Name: "subject_key", Type: field.TypeString}, {Name: "role_key", Type: field.TypeString}, {Name: "granted_by", Type: field.TypeString, Default: ""}, {Name: "expires_at", Type: field.TypeTime, Nullable: true}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, } // RoleBindingsTable holds the schema information for the "role_bindings" table. RoleBindingsTable = &schema.Table{ Name: "role_bindings", Columns: RoleBindingsColumns, PrimaryKey: []*schema.Column{RoleBindingsColumns[0]}, Indexes: []*schema.Index{ { Name: "rolebinding_scope_kind_scope_id_subject_kind_subject_key_role_key", Unique: true, Columns: []*schema.Column{RoleBindingsColumns[1], RoleBindingsColumns[2], RoleBindingsColumns[3], RoleBindingsColumns[4], RoleBindingsColumns[5]}, }, { Name: "rolebinding_subject_kind_subject_key", Unique: false, Columns: []*schema.Column{RoleBindingsColumns[3], RoleBindingsColumns[4]}, }, { Name: "rolebinding_scope_kind_scope_id", Unique: false, Columns: []*schema.Column{RoleBindingsColumns[1], RoleBindingsColumns[2]}, }, }, } // ScheduledJobsColumns holds the columns for the "scheduled_jobs" table. ScheduledJobsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "name", Type: field.TypeString}, {Name: "cron_expression", Type: field.TypeString}, {Name: "ticket_template", Type: field.TypeJSON}, {Name: "is_enabled", Type: field.TypeBool, Default: true}, {Name: "last_run_at", Type: field.TypeTime, Nullable: true}, {Name: "next_run_at", Type: field.TypeTime, Nullable: true}, {Name: "project_id", Type: field.TypeUUID}, {Name: "workflow_id", Type: field.TypeUUID, Nullable: true}, } // ScheduledJobsTable holds the schema information for the "scheduled_jobs" table. ScheduledJobsTable = &schema.Table{ Name: "scheduled_jobs", Columns: ScheduledJobsColumns, PrimaryKey: []*schema.Column{ScheduledJobsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "scheduled_jobs_projects_scheduled_jobs", Columns: []*schema.Column{ScheduledJobsColumns[7]}, RefColumns: []*schema.Column{ProjectsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "scheduled_jobs_workflows_scheduled_jobs", Columns: []*schema.Column{ScheduledJobsColumns[8]}, RefColumns: []*schema.Column{WorkflowsColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "scheduledjob_project_id_name", Unique: true, Columns: []*schema.Column{ScheduledJobsColumns[7], ScheduledJobsColumns[1]}, }, { Name: "scheduledjob_next_run_at", Unique: false, Columns: []*schema.Column{ScheduledJobsColumns[6]}, Annotation: &entsql.IndexAnnotation{ Where: "is_enabled = true", }, }, }, } // SkillsColumns holds the columns for the "skills" table. SkillsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "name", Type: field.TypeString}, {Name: "description", Type: field.TypeString}, {Name: "is_builtin", Type: field.TypeBool, Default: false}, {Name: "is_enabled", Type: field.TypeBool, Default: true}, {Name: "created_by", Type: field.TypeString, Default: "user:manual"}, {Name: "archived_at", Type: field.TypeTime, Nullable: true}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "project_id", Type: field.TypeUUID}, {Name: "current_version_id", Type: field.TypeUUID, Nullable: true}, } // SkillsTable holds the schema information for the "skills" table. SkillsTable = &schema.Table{ Name: "skills", Columns: SkillsColumns, PrimaryKey: []*schema.Column{SkillsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "skills_projects_skills", Columns: []*schema.Column{SkillsColumns[9]}, RefColumns: []*schema.Column{ProjectsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "skills_skill_versions_current_version", Columns: []*schema.Column{SkillsColumns[10]}, RefColumns: []*schema.Column{SkillVersionsColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "skill_project_id_name", Unique: true, Columns: []*schema.Column{SkillsColumns[9], SkillsColumns[1]}, }, { Name: "skill_project_id_archived_at", Unique: false, Columns: []*schema.Column{SkillsColumns[9], SkillsColumns[6]}, }, }, } // SkillBlobsColumns holds the columns for the "skill_blobs" table. SkillBlobsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "sha256", Type: field.TypeString}, {Name: "size_bytes", Type: field.TypeInt64, Default: 0}, {Name: "compression", Type: field.TypeEnum, Enums: []string{"none", "gzip"}, Default: "none"}, {Name: "content_bytes", Type: field.TypeBytes}, {Name: "created_at", Type: field.TypeTime}, } // SkillBlobsTable holds the schema information for the "skill_blobs" table. SkillBlobsTable = &schema.Table{ Name: "skill_blobs", Columns: SkillBlobsColumns, PrimaryKey: []*schema.Column{SkillBlobsColumns[0]}, Indexes: []*schema.Index{ { Name: "skillblob_sha256", Unique: true, Columns: []*schema.Column{SkillBlobsColumns[1]}, }, }, } // SkillVersionsColumns holds the columns for the "skill_versions" table. SkillVersionsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "version", Type: field.TypeInt}, {Name: "content_markdown", Type: field.TypeString, Size: 2147483647}, {Name: "content_hash", Type: field.TypeString}, {Name: "bundle_hash", Type: field.TypeString, Nullable: true}, {Name: "manifest_json", Type: field.TypeJSON}, {Name: "size_bytes", Type: field.TypeInt64, Default: 0}, {Name: "file_count", Type: field.TypeInt, Default: 0}, {Name: "created_by", Type: field.TypeString, Default: "system:workflow-service"}, {Name: "created_at", Type: field.TypeTime}, {Name: "skill_id", Type: field.TypeUUID}, } // SkillVersionsTable holds the schema information for the "skill_versions" table. SkillVersionsTable = &schema.Table{ Name: "skill_versions", Columns: SkillVersionsColumns, PrimaryKey: []*schema.Column{SkillVersionsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "skill_versions_skills_versions", Columns: []*schema.Column{SkillVersionsColumns[10]}, RefColumns: []*schema.Column{SkillsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "skillversion_skill_id_version", Unique: true, Columns: []*schema.Column{SkillVersionsColumns[10], SkillVersionsColumns[1]}, }, }, } // SkillVersionFilesColumns holds the columns for the "skill_version_files" table. SkillVersionFilesColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "path", Type: field.TypeString}, {Name: "file_kind", Type: field.TypeEnum, Enums: []string{"entrypoint", "metadata", "script", "reference", "asset"}, Default: "asset"}, {Name: "media_type", Type: field.TypeString, Default: "application/octet-stream"}, {Name: "encoding", Type: field.TypeEnum, Enums: []string{"utf8", "base64", "binary"}, Default: "binary"}, {Name: "is_executable", Type: field.TypeBool, Default: false}, {Name: "size_bytes", Type: field.TypeInt64, Default: 0}, {Name: "sha256", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime}, {Name: "content_blob_id", Type: field.TypeUUID}, {Name: "skill_version_id", Type: field.TypeUUID}, } // SkillVersionFilesTable holds the schema information for the "skill_version_files" table. SkillVersionFilesTable = &schema.Table{ Name: "skill_version_files", Columns: SkillVersionFilesColumns, PrimaryKey: []*schema.Column{SkillVersionFilesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "skill_version_files_skill_blobs_files", Columns: []*schema.Column{SkillVersionFilesColumns[9]}, RefColumns: []*schema.Column{SkillBlobsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "skill_version_files_skill_versions_files", Columns: []*schema.Column{SkillVersionFilesColumns[10]}, RefColumns: []*schema.Column{SkillVersionsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "skillversionfile_skill_version_id_path", Unique: true, Columns: []*schema.Column{SkillVersionFilesColumns[10], SkillVersionFilesColumns[1]}, }, { Name: "skillversionfile_content_blob_id", Unique: false, Columns: []*schema.Column{SkillVersionFilesColumns[9]}, }, }, } // TicketsColumns holds the columns for the "tickets" table. TicketsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "identifier", Type: field.TypeString}, {Name: "title", Type: field.TypeString}, {Name: "description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "archived", Type: field.TypeBool, Default: false}, {Name: "priority", Type: field.TypeEnum, Nullable: true, Enums: []string{"urgent", "high", "medium", "low"}}, {Name: "type", Type: field.TypeEnum, Enums: []string{"feature", "bugfix", "refactor", "chore", "epic"}, Default: "feature"}, {Name: "created_by", Type: field.TypeString}, {Name: "external_ref", Type: field.TypeString, Nullable: true}, {Name: "attempt_count", Type: field.TypeInt, Default: 0}, {Name: "consecutive_errors", Type: field.TypeInt, Default: 0}, {Name: "next_retry_at", Type: field.TypeTime, Nullable: true}, {Name: "retry_paused", Type: field.TypeBool, Default: false}, {Name: "pause_reason", Type: field.TypeString, Nullable: true}, {Name: "stall_count", Type: field.TypeInt, Default: 0}, {Name: "retry_token", Type: field.TypeString, Nullable: true}, {Name: "harness_version", Type: field.TypeInt, Default: 0}, {Name: "budget_usd", Type: field.TypeFloat64, Default: 0, SchemaType: map[string]string{"postgres": "numeric(18,6)"}}, {Name: "cost_tokens_input", Type: field.TypeInt64, Default: 0}, {Name: "cost_tokens_output", Type: field.TypeInt64, Default: 0}, {Name: "cost_amount", Type: field.TypeFloat64, Default: 0, SchemaType: map[string]string{"postgres": "numeric(18,6)"}}, {Name: "metadata", Type: field.TypeJSON}, {Name: "started_at", Type: field.TypeTime, Nullable: true}, {Name: "completed_at", Type: field.TypeTime, Nullable: true}, {Name: "created_at", Type: field.TypeTime}, {Name: "current_run_id", Type: field.TypeUUID, Nullable: true}, {Name: "target_machine_id", Type: field.TypeUUID, Nullable: true}, {Name: "project_id", Type: field.TypeUUID}, {Name: "parent_ticket_id", Type: field.TypeUUID, Nullable: true}, {Name: "status_id", Type: field.TypeUUID}, {Name: "workflow_id", Type: field.TypeUUID, Nullable: true}, } // TicketsTable holds the schema information for the "tickets" table. TicketsTable = &schema.Table{ Name: "tickets", Columns: TicketsColumns, PrimaryKey: []*schema.Column{TicketsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "tickets_agent_runs_current_for_ticket", Columns: []*schema.Column{TicketsColumns[25]}, RefColumns: []*schema.Column{AgentRunsColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "tickets_machines_target_tickets", Columns: []*schema.Column{TicketsColumns[26]}, RefColumns: []*schema.Column{MachinesColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "tickets_projects_tickets", Columns: []*schema.Column{TicketsColumns[27]}, RefColumns: []*schema.Column{ProjectsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "tickets_tickets_children", Columns: []*schema.Column{TicketsColumns[28]}, RefColumns: []*schema.Column{TicketsColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "tickets_ticket_status_tickets", Columns: []*schema.Column{TicketsColumns[29]}, RefColumns: []*schema.Column{TicketStatusColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "tickets_workflows_tickets", Columns: []*schema.Column{TicketsColumns[30]}, RefColumns: []*schema.Column{WorkflowsColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "ticket_project_id_identifier", Unique: true, Columns: []*schema.Column{TicketsColumns[27], TicketsColumns[1]}, }, { Name: "ticket_project_id_status_id_current_run_id_priority_created_at", Unique: false, Columns: []*schema.Column{TicketsColumns[27], TicketsColumns[29], TicketsColumns[25], TicketsColumns[5], TicketsColumns[24]}, }, { Name: "ticket_project_id_status_id", Unique: false, Columns: []*schema.Column{TicketsColumns[27], TicketsColumns[29]}, }, { Name: "ticket_project_id_archived_created_at", Unique: false, Columns: []*schema.Column{TicketsColumns[27], TicketsColumns[4], TicketsColumns[24]}, }, { Name: "ticket_project_id_external_ref", Unique: false, Columns: []*schema.Column{TicketsColumns[27], TicketsColumns[8]}, }, }, } // TicketCommentsColumns holds the columns for the "ticket_comments" table. TicketCommentsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "body", Type: field.TypeString, Size: 2147483647}, {Name: "created_by", Type: field.TypeString}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "edited_at", Type: field.TypeTime, Nullable: true}, {Name: "edit_count", Type: field.TypeInt, Default: 0}, {Name: "last_edited_by", Type: field.TypeString, Nullable: true}, {Name: "is_deleted", Type: field.TypeBool, Default: false}, {Name: "deleted_at", Type: field.TypeTime, Nullable: true}, {Name: "deleted_by", Type: field.TypeString, Nullable: true}, {Name: "ticket_id", Type: field.TypeUUID}, } // TicketCommentsTable holds the schema information for the "ticket_comments" table. TicketCommentsTable = &schema.Table{ Name: "ticket_comments", Columns: TicketCommentsColumns, PrimaryKey: []*schema.Column{TicketCommentsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "ticket_comments_tickets_comments", Columns: []*schema.Column{TicketCommentsColumns[11]}, RefColumns: []*schema.Column{TicketsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "ticketcomment_ticket_id_created_at_id", Unique: false, Columns: []*schema.Column{TicketCommentsColumns[11], TicketCommentsColumns[3], TicketCommentsColumns[0]}, }, }, } // TicketCommentRevisionsColumns holds the columns for the "ticket_comment_revisions" table. TicketCommentRevisionsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "revision_number", Type: field.TypeInt}, {Name: "body_markdown", Type: field.TypeString, Size: 2147483647}, {Name: "edited_by", Type: field.TypeString}, {Name: "edited_at", Type: field.TypeTime}, {Name: "edit_reason", Type: field.TypeString, Nullable: true}, {Name: "comment_id", Type: field.TypeUUID}, } // TicketCommentRevisionsTable holds the schema information for the "ticket_comment_revisions" table. TicketCommentRevisionsTable = &schema.Table{ Name: "ticket_comment_revisions", Columns: TicketCommentRevisionsColumns, PrimaryKey: []*schema.Column{TicketCommentRevisionsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "ticket_comment_revisions_ticket_comments_revisions", Columns: []*schema.Column{TicketCommentRevisionsColumns[6]}, RefColumns: []*schema.Column{TicketCommentsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "ticketcommentrevision_comment_id_revision_number", Unique: true, Columns: []*schema.Column{TicketCommentRevisionsColumns[6], TicketCommentRevisionsColumns[1]}, }, { Name: "ticketcommentrevision_comment_id_edited_at_id", Unique: false, Columns: []*schema.Column{TicketCommentRevisionsColumns[6], TicketCommentRevisionsColumns[4], TicketCommentRevisionsColumns[0]}, }, }, } // TicketDependenciesColumns holds the columns for the "ticket_dependencies" table. TicketDependenciesColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "type", Type: field.TypeEnum, Enums: []string{"blocks", "sub-issue"}, Default: "blocks"}, {Name: "source_ticket_id", Type: field.TypeUUID}, {Name: "target_ticket_id", Type: field.TypeUUID}, } // TicketDependenciesTable holds the schema information for the "ticket_dependencies" table. TicketDependenciesTable = &schema.Table{ Name: "ticket_dependencies", Columns: TicketDependenciesColumns, PrimaryKey: []*schema.Column{TicketDependenciesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "ticket_dependencies_tickets_outgoing_dependencies", Columns: []*schema.Column{TicketDependenciesColumns[2]}, RefColumns: []*schema.Column{TicketsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "ticket_dependencies_tickets_incoming_dependencies", Columns: []*schema.Column{TicketDependenciesColumns[3]}, RefColumns: []*schema.Column{TicketsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "ticketdependency_source_ticket_id_target_ticket_id_type", Unique: true, Columns: []*schema.Column{TicketDependenciesColumns[2], TicketDependenciesColumns[3], TicketDependenciesColumns[1]}, }, { Name: "ticketdependency_target_ticket_id_type", Unique: false, Columns: []*schema.Column{TicketDependenciesColumns[3], TicketDependenciesColumns[1]}, }, { Name: "ticketdependency_source_ticket_id", Unique: false, Columns: []*schema.Column{TicketDependenciesColumns[2]}, }, }, } // TicketExternalLinksColumns holds the columns for the "ticket_external_links" table. TicketExternalLinksColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "link_type", Type: field.TypeEnum, Enums: []string{"github_issue", "gitlab_issue", "jira_ticket", "github_pr", "gitlab_mr", "custom"}}, {Name: "url", Type: field.TypeString}, {Name: "external_id", Type: field.TypeString}, {Name: "title", Type: field.TypeString, Nullable: true}, {Name: "status", Type: field.TypeString, Nullable: true}, {Name: "relation", Type: field.TypeEnum, Enums: []string{"resolves", "related", "caused_by"}, Default: "related"}, {Name: "created_at", Type: field.TypeTime}, {Name: "ticket_id", Type: field.TypeUUID}, } // TicketExternalLinksTable holds the schema information for the "ticket_external_links" table. TicketExternalLinksTable = &schema.Table{ Name: "ticket_external_links", Columns: TicketExternalLinksColumns, PrimaryKey: []*schema.Column{TicketExternalLinksColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "ticket_external_links_tickets_external_links", Columns: []*schema.Column{TicketExternalLinksColumns[8]}, RefColumns: []*schema.Column{TicketsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "ticketexternallink_ticket_id_external_id", Unique: true, Columns: []*schema.Column{TicketExternalLinksColumns[8], TicketExternalLinksColumns[3]}, }, { Name: "ticketexternallink_external_id", Unique: false, Columns: []*schema.Column{TicketExternalLinksColumns[3]}, }, }, } // TicketRepoScopesColumns holds the columns for the "ticket_repo_scopes" table. TicketRepoScopesColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "branch_name", Type: field.TypeString}, {Name: "pull_request_url", Type: field.TypeString, Nullable: true}, {Name: "pr_status", Type: field.TypeEnum, Enums: []string{"none", "open", "changes_requested", "approved", "merged", "closed"}, Default: "none"}, {Name: "ci_status", Type: field.TypeEnum, Enums: []string{"pending", "passing", "failing"}, Default: "pending"}, {Name: "repo_id", Type: field.TypeUUID}, {Name: "ticket_id", Type: field.TypeUUID}, } // TicketRepoScopesTable holds the schema information for the "ticket_repo_scopes" table. TicketRepoScopesTable = &schema.Table{ Name: "ticket_repo_scopes", Columns: TicketRepoScopesColumns, PrimaryKey: []*schema.Column{TicketRepoScopesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "ticket_repo_scopes_project_repos_ticket_scopes", Columns: []*schema.Column{TicketRepoScopesColumns[5]}, RefColumns: []*schema.Column{ProjectReposColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "ticket_repo_scopes_tickets_repo_scopes", Columns: []*schema.Column{TicketRepoScopesColumns[6]}, RefColumns: []*schema.Column{TicketsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "ticketreposcope_ticket_id_repo_id", Unique: true, Columns: []*schema.Column{TicketRepoScopesColumns[6], TicketRepoScopesColumns[5]}, }, { Name: "ticketreposcope_repo_id_branch_name", Unique: false, Columns: []*schema.Column{TicketRepoScopesColumns[5], TicketRepoScopesColumns[1]}, }, { Name: "ticketreposcope_ticket_id", Unique: false, Columns: []*schema.Column{TicketRepoScopesColumns[6]}, }, }, } // TicketRepoWorkspacesColumns holds the columns for the "ticket_repo_workspaces" table. TicketRepoWorkspacesColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "workspace_root", Type: field.TypeString}, {Name: "repo_path", Type: field.TypeString}, {Name: "branch_name", Type: field.TypeString}, {Name: "state", Type: field.TypeEnum, Enums: []string{"planned", "materializing", "ready", "dirty", "verifying", "completed", "failed", "cleaning", "cleaned"}, Default: "planned"}, {Name: "head_commit", Type: field.TypeString, Nullable: true}, {Name: "last_error", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "prepared_at", Type: field.TypeTime, Nullable: true}, {Name: "cleaned_at", Type: field.TypeTime, Nullable: true}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, {Name: "agent_run_id", Type: field.TypeUUID}, {Name: "repo_id", Type: field.TypeUUID}, {Name: "ticket_id", Type: field.TypeUUID}, } // TicketRepoWorkspacesTable holds the schema information for the "ticket_repo_workspaces" table. TicketRepoWorkspacesTable = &schema.Table{ Name: "ticket_repo_workspaces", Columns: TicketRepoWorkspacesColumns, PrimaryKey: []*schema.Column{TicketRepoWorkspacesColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "ticket_repo_workspaces_agent_runs_ticket_repo_workspaces", Columns: []*schema.Column{TicketRepoWorkspacesColumns[11]}, RefColumns: []*schema.Column{AgentRunsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "ticket_repo_workspaces_project_repos_ticket_repo_workspaces", Columns: []*schema.Column{TicketRepoWorkspacesColumns[12]}, RefColumns: []*schema.Column{ProjectReposColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "ticket_repo_workspaces_tickets_repo_workspaces", Columns: []*schema.Column{TicketRepoWorkspacesColumns[13]}, RefColumns: []*schema.Column{TicketsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "ticketrepoworkspace_agent_run_id_repo_id", Unique: true, Columns: []*schema.Column{TicketRepoWorkspacesColumns[11], TicketRepoWorkspacesColumns[12]}, }, { Name: "ticketrepoworkspace_ticket_id_state", Unique: false, Columns: []*schema.Column{TicketRepoWorkspacesColumns[13], TicketRepoWorkspacesColumns[4]}, }, }, } // TicketStatusColumns holds the columns for the "ticket_status" table. TicketStatusColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "name", Type: field.TypeString}, {Name: "stage", Type: field.TypeEnum, Enums: []string{"backlog", "unstarted", "started", "completed", "canceled"}, Default: "unstarted"}, {Name: "color", Type: field.TypeString}, {Name: "icon", Type: field.TypeString, Nullable: true}, {Name: "position", Type: field.TypeInt, Default: 0}, {Name: "max_active_runs", Type: field.TypeInt, Nullable: true}, {Name: "is_default", Type: field.TypeBool, Default: false}, {Name: "description", Type: field.TypeString, Nullable: true}, {Name: "project_id", Type: field.TypeUUID}, } // TicketStatusTable holds the schema information for the "ticket_status" table. TicketStatusTable = &schema.Table{ Name: "ticket_status", Columns: TicketStatusColumns, PrimaryKey: []*schema.Column{TicketStatusColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "ticket_status_projects_statuses", Columns: []*schema.Column{TicketStatusColumns[9]}, RefColumns: []*schema.Column{ProjectsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "ticketstatus_project_id_name", Unique: true, Columns: []*schema.Column{TicketStatusColumns[9], TicketStatusColumns[1]}, }, { Name: "ticketstatus_project_id_position", Unique: false, Columns: []*schema.Column{TicketStatusColumns[9], TicketStatusColumns[5]}, }, }, } // UsersColumns holds the columns for the "users" table. UsersColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "status", Type: field.TypeEnum, Enums: []string{"active", "disabled"}, Default: "active"}, {Name: "primary_email", Type: field.TypeString, Default: ""}, {Name: "display_name", Type: field.TypeString, Default: ""}, {Name: "avatar_url", Type: field.TypeString, Default: ""}, {Name: "last_login_at", Type: field.TypeTime, 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]}, Indexes: []*schema.Index{ { Name: "user_primary_email", Unique: false, Columns: []*schema.Column{UsersColumns[2]}, }, }, } // UserGroupMembershipsColumns holds the columns for the "user_group_memberships" table. UserGroupMembershipsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "user_id", Type: field.TypeUUID}, {Name: "issuer", Type: field.TypeString}, {Name: "group_key", Type: field.TypeString}, {Name: "group_name", Type: field.TypeString, Default: ""}, {Name: "last_synced_at", Type: field.TypeTime}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, } // UserGroupMembershipsTable holds the schema information for the "user_group_memberships" table. UserGroupMembershipsTable = &schema.Table{ Name: "user_group_memberships", Columns: UserGroupMembershipsColumns, PrimaryKey: []*schema.Column{UserGroupMembershipsColumns[0]}, Indexes: []*schema.Index{ { Name: "usergroupmembership_user_id_issuer_group_key", Unique: true, Columns: []*schema.Column{UserGroupMembershipsColumns[1], UserGroupMembershipsColumns[2], UserGroupMembershipsColumns[3]}, }, { Name: "usergroupmembership_group_key", Unique: false, Columns: []*schema.Column{UserGroupMembershipsColumns[3]}, }, }, } // UserIdentitiesColumns holds the columns for the "user_identities" table. UserIdentitiesColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "user_id", Type: field.TypeUUID}, {Name: "issuer", Type: field.TypeString}, {Name: "subject", Type: field.TypeString}, {Name: "email", Type: field.TypeString, Default: ""}, {Name: "email_verified", Type: field.TypeBool, Default: false}, {Name: "claims_version", Type: field.TypeInt, Default: 1}, {Name: "raw_claims_json", Type: field.TypeString, Size: 2147483647, Default: "{}"}, {Name: "last_synced_at", Type: field.TypeTime}, {Name: "created_at", Type: field.TypeTime}, {Name: "updated_at", Type: field.TypeTime}, } // UserIdentitiesTable holds the schema information for the "user_identities" table. UserIdentitiesTable = &schema.Table{ Name: "user_identities", Columns: UserIdentitiesColumns, PrimaryKey: []*schema.Column{UserIdentitiesColumns[0]}, Indexes: []*schema.Index{ { Name: "useridentity_issuer_subject", Unique: true, Columns: []*schema.Column{UserIdentitiesColumns[2], UserIdentitiesColumns[3]}, }, { Name: "useridentity_user_id", Unique: false, Columns: []*schema.Column{UserIdentitiesColumns[1]}, }, { Name: "useridentity_email", Unique: false, Columns: []*schema.Column{UserIdentitiesColumns[4]}, }, }, } // WorkflowsColumns holds the columns for the "workflows" table. WorkflowsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "name", Type: field.TypeString}, {Name: "type", Type: field.TypeString}, {Name: "role_slug", Type: field.TypeString, Nullable: true}, {Name: "role_name", Type: field.TypeString, Nullable: true}, {Name: "role_description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "platform_access_allowed", Type: field.TypeOther, Nullable: true, SchemaType: map[string]string{"postgres": "text[]"}}, {Name: "harness_path", Type: field.TypeString}, {Name: "hooks", Type: field.TypeJSON}, {Name: "max_concurrent", Type: field.TypeInt, Default: 0}, {Name: "max_retry_attempts", Type: field.TypeInt, Default: 3}, {Name: "timeout_minutes", Type: field.TypeInt, Default: 60}, {Name: "stall_timeout_minutes", Type: field.TypeInt, Default: 5}, {Name: "version", Type: field.TypeInt, Default: 1}, {Name: "is_active", Type: field.TypeBool, Default: true}, {Name: "agent_id", Type: field.TypeUUID, Nullable: true}, {Name: "project_id", Type: field.TypeUUID}, {Name: "current_version_id", Type: field.TypeUUID, Nullable: true}, } // WorkflowsTable holds the schema information for the "workflows" table. WorkflowsTable = &schema.Table{ Name: "workflows", Columns: WorkflowsColumns, PrimaryKey: []*schema.Column{WorkflowsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "workflows_agents_workflows", Columns: []*schema.Column{WorkflowsColumns[15]}, RefColumns: []*schema.Column{AgentsColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "workflows_projects_workflows", Columns: []*schema.Column{WorkflowsColumns[16]}, RefColumns: []*schema.Column{ProjectsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "workflows_workflow_versions_current_version", Columns: []*schema.Column{WorkflowsColumns[17]}, RefColumns: []*schema.Column{WorkflowVersionsColumns[0]}, OnDelete: schema.SetNull, }, }, Indexes: []*schema.Index{ { Name: "workflow_project_id_name", Unique: true, Columns: []*schema.Column{WorkflowsColumns[16], WorkflowsColumns[1]}, }, { Name: "workflow_project_id_is_active", Unique: false, Columns: []*schema.Column{WorkflowsColumns[16], WorkflowsColumns[14]}, }, }, } // WorkflowSkillBindingsColumns holds the columns for the "workflow_skill_bindings" table. WorkflowSkillBindingsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "created_at", Type: field.TypeTime}, {Name: "skill_id", Type: field.TypeUUID}, {Name: "required_version_id", Type: field.TypeUUID, Nullable: true}, {Name: "workflow_id", Type: field.TypeUUID}, } // WorkflowSkillBindingsTable holds the schema information for the "workflow_skill_bindings" table. WorkflowSkillBindingsTable = &schema.Table{ Name: "workflow_skill_bindings", Columns: WorkflowSkillBindingsColumns, PrimaryKey: []*schema.Column{WorkflowSkillBindingsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "workflow_skill_bindings_skills_workflow_bindings", Columns: []*schema.Column{WorkflowSkillBindingsColumns[2]}, RefColumns: []*schema.Column{SkillsColumns[0]}, OnDelete: schema.NoAction, }, { Symbol: "workflow_skill_bindings_skill_versions_required_by_bindings", Columns: []*schema.Column{WorkflowSkillBindingsColumns[3]}, RefColumns: []*schema.Column{SkillVersionsColumns[0]}, OnDelete: schema.SetNull, }, { Symbol: "workflow_skill_bindings_workflows_skill_bindings", Columns: []*schema.Column{WorkflowSkillBindingsColumns[4]}, RefColumns: []*schema.Column{WorkflowsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "workflowskillbinding_workflow_id_skill_id", Unique: true, Columns: []*schema.Column{WorkflowSkillBindingsColumns[4], WorkflowSkillBindingsColumns[2]}, }, { Name: "workflowskillbinding_skill_id_workflow_id", Unique: false, Columns: []*schema.Column{WorkflowSkillBindingsColumns[2], WorkflowSkillBindingsColumns[4]}, }, }, } // WorkflowVersionsColumns holds the columns for the "workflow_versions" table. WorkflowVersionsColumns = []*schema.Column{ {Name: "id", Type: field.TypeUUID}, {Name: "version", Type: field.TypeInt}, {Name: "content_markdown", Type: field.TypeString, Size: 2147483647}, {Name: "name", Type: field.TypeString}, {Name: "type", Type: field.TypeString}, {Name: "role_slug", Type: field.TypeString, Nullable: true}, {Name: "role_name", Type: field.TypeString, Nullable: true}, {Name: "role_description", Type: field.TypeString, Nullable: true, Size: 2147483647}, {Name: "pickup_status_ids", Type: field.TypeOther, Nullable: true, SchemaType: map[string]string{"postgres": "text[]"}}, {Name: "finish_status_ids", Type: field.TypeOther, Nullable: true, SchemaType: map[string]string{"postgres": "text[]"}}, {Name: "harness_path", Type: field.TypeString}, {Name: "hooks", Type: field.TypeJSON}, {Name: "platform_access_allowed", Type: field.TypeOther, Nullable: true, SchemaType: map[string]string{"postgres": "text[]"}}, {Name: "max_concurrent", Type: field.TypeInt, Default: 0}, {Name: "max_retry_attempts", Type: field.TypeInt, Default: 3}, {Name: "timeout_minutes", Type: field.TypeInt, Default: 60}, {Name: "stall_timeout_minutes", Type: field.TypeInt, Default: 5}, {Name: "is_active", Type: field.TypeBool, Default: true}, {Name: "content_hash", Type: field.TypeString}, {Name: "created_by", Type: field.TypeString, Default: "system:workflow-service"}, {Name: "created_at", Type: field.TypeTime}, {Name: "workflow_id", Type: field.TypeUUID}, } // WorkflowVersionsTable holds the schema information for the "workflow_versions" table. WorkflowVersionsTable = &schema.Table{ Name: "workflow_versions", Columns: WorkflowVersionsColumns, PrimaryKey: []*schema.Column{WorkflowVersionsColumns[0]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "workflow_versions_workflows_versions", Columns: []*schema.Column{WorkflowVersionsColumns[21]}, RefColumns: []*schema.Column{WorkflowsColumns[0]}, OnDelete: schema.NoAction, }, }, Indexes: []*schema.Index{ { Name: "workflowversion_workflow_id_version", Unique: true, Columns: []*schema.Column{WorkflowVersionsColumns[21], WorkflowVersionsColumns[1]}, }, }, } // WorkflowPickupStatusesColumns holds the columns for the "workflow_pickup_statuses" table. WorkflowPickupStatusesColumns = []*schema.Column{ {Name: "workflow_id", Type: field.TypeUUID}, {Name: "ticket_status_id", Type: field.TypeUUID}, } // WorkflowPickupStatusesTable holds the schema information for the "workflow_pickup_statuses" table. WorkflowPickupStatusesTable = &schema.Table{ Name: "workflow_pickup_statuses", Columns: WorkflowPickupStatusesColumns, PrimaryKey: []*schema.Column{WorkflowPickupStatusesColumns[0], WorkflowPickupStatusesColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "workflow_pickup_statuses_workflow_id", Columns: []*schema.Column{WorkflowPickupStatusesColumns[0]}, RefColumns: []*schema.Column{WorkflowsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "workflow_pickup_statuses_ticket_status_id", Columns: []*schema.Column{WorkflowPickupStatusesColumns[1]}, RefColumns: []*schema.Column{TicketStatusColumns[0]}, OnDelete: schema.Cascade, }, }, } // WorkflowFinishStatusesColumns holds the columns for the "workflow_finish_statuses" table. WorkflowFinishStatusesColumns = []*schema.Column{ {Name: "workflow_id", Type: field.TypeUUID}, {Name: "ticket_status_id", Type: field.TypeUUID}, } // WorkflowFinishStatusesTable holds the schema information for the "workflow_finish_statuses" table. WorkflowFinishStatusesTable = &schema.Table{ Name: "workflow_finish_statuses", Columns: WorkflowFinishStatusesColumns, PrimaryKey: []*schema.Column{WorkflowFinishStatusesColumns[0], WorkflowFinishStatusesColumns[1]}, ForeignKeys: []*schema.ForeignKey{ { Symbol: "workflow_finish_statuses_workflow_id", Columns: []*schema.Column{WorkflowFinishStatusesColumns[0]}, RefColumns: []*schema.Column{WorkflowsColumns[0]}, OnDelete: schema.Cascade, }, { Symbol: "workflow_finish_statuses_ticket_status_id", Columns: []*schema.Column{WorkflowFinishStatusesColumns[1]}, RefColumns: []*schema.Column{TicketStatusColumns[0]}, OnDelete: schema.Cascade, }, }, } // Tables holds all the tables in the schema. Tables = []*schema.Table{ ActivityEventsTable, AgentsTable, AgentProvidersTable, AgentRunsTable, AgentStepEventsTable, AgentTokensTable, AgentTraceEventsTable, ApprovalPolicyRulesTable, BrowserSessionsTable, ChatConversationsTable, ChatEntriesTable, ChatPendingInterruptsTable, ChatTurnsTable, MachinesTable, MachineChannelTokensTable, NotificationChannelsTable, NotificationRulesTable, OrganizationsTable, OrganizationDailyTokenUsagesTable, ProjectsTable, ProjectConversationPrincipalsTable, ProjectConversationRunsTable, ProjectConversationStepEventsTable, ProjectConversationTraceEventsTable, ProjectReposTable, ProjectUpdateCommentsTable, ProjectUpdateCommentRevisionsTable, ProjectUpdateThreadsTable, ProjectUpdateThreadRevisionsTable, RoleBindingsTable, ScheduledJobsTable, SkillsTable, SkillBlobsTable, SkillVersionsTable, SkillVersionFilesTable, TicketsTable, TicketCommentsTable, TicketCommentRevisionsTable, TicketDependenciesTable, TicketExternalLinksTable, TicketRepoScopesTable, TicketRepoWorkspacesTable, TicketStatusTable, UsersTable, UserGroupMembershipsTable, UserIdentitiesTable, WorkflowsTable, WorkflowSkillBindingsTable, WorkflowVersionsTable, WorkflowPickupStatusesTable, WorkflowFinishStatusesTable, } )
Functions ¶
Types ¶
type Schema ¶
type Schema struct {
// contains filtered or unexported fields
}
Schema is the API for creating, migrating and dropping a schema.
Click to show internal directories.
Click to hide internal directories.