diff --git a/packages/db/src/migrations/0058_social_connect.sql b/packages/db/src/migrations/0058_social_connect.sql deleted file mode 100644 index 13ea63141..000000000 --- a/packages/db/src/migrations/0058_social_connect.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE "kilocode_users" ADD COLUMN "discord_server_membership_verified_at" timestamp with time zone;--> statement-breakpoint -ALTER TABLE "user_auth_provider" ADD COLUMN "display_name" text; \ No newline at end of file diff --git a/packages/db/src/migrations/meta/0058_snapshot.json b/packages/db/src/migrations/meta/0057_snapshot.json similarity index 94% rename from packages/db/src/migrations/meta/0058_snapshot.json rename to packages/db/src/migrations/meta/0057_snapshot.json index 363f9f034..4b6c977c1 100644 --- a/packages/db/src/migrations/meta/0058_snapshot.json +++ b/packages/db/src/migrations/meta/0057_snapshot.json @@ -1,6 +1,6 @@ { - "id": "8a7e0cef-ce7d-4f9c-8138-65120a8fc17f", - "prevId": "9f8097fb-5b85-4082-b143-b8363447c8c8", + "id": "9f8097fb-5b85-4082-b143-b8363447c8c8", + "prevId": "77ed4897-2d6a-4bd0-875b-092a0ccbfb99", "version": "7", "dialect": "postgresql", "tables": { @@ -93,9 +93,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_agent_configs_owned_by_user_id": { "name": "IDX_agent_configs_owned_by_user_id", @@ -108,9 +108,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_agent_configs_agent_type": { "name": "IDX_agent_configs_agent_type", @@ -123,9 +123,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_agent_configs_platform": { "name": "IDX_agent_configs_platform", @@ -138,58 +138,58 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "agent_configs_owned_by_organization_id_organizations_id_fk": { "name": "agent_configs_owned_by_organization_id_organizations_id_fk", "tableFrom": "agent_configs", - "tableTo": "organizations", "columnsFrom": [ "owned_by_organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "agent_configs_owned_by_user_id_kilocode_users_id_fk": { "name": "agent_configs_owned_by_user_id_kilocode_users_id_fk", "tableFrom": "agent_configs", - "tableTo": "kilocode_users", "columnsFrom": [ "owned_by_user_id" ], + "tableTo": "kilocode_users", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "UQ_agent_configs_org_agent_platform": { "name": "UQ_agent_configs_org_agent_platform", - "nullsNotDistinct": false, "columns": [ "owned_by_organization_id", "agent_type", "platform" - ] + ], + "nullsNotDistinct": false }, "UQ_agent_configs_user_agent_platform": { "name": "UQ_agent_configs_user_agent_platform", - "nullsNotDistinct": false, "columns": [ "owned_by_user_id", "agent_type", "platform" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -254,35 +254,35 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "agent_environment_profile_commands_profile_id_agent_environment_profiles_id_fk": { "name": "agent_environment_profile_commands_profile_id_agent_environment_profiles_id_fk", "tableFrom": "agent_environment_profile_commands", - "tableTo": "agent_environment_profiles", "columnsFrom": [ "profile_id" ], + "tableTo": "agent_environment_profiles", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "UQ_agent_env_profile_commands_profile_sequence": { "name": "UQ_agent_env_profile_commands_profile_sequence", - "nullsNotDistinct": false, "columns": [ "profile_id", "sequence" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -352,35 +352,35 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "agent_environment_profile_vars_profile_id_agent_environment_profiles_id_fk": { "name": "agent_environment_profile_vars_profile_id_agent_environment_profiles_id_fk", "tableFrom": "agent_environment_profile_vars", - "tableTo": "agent_environment_profiles", "columnsFrom": [ "profile_id" ], + "tableTo": "agent_environment_profiles", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "UQ_agent_env_profile_vars_profile_key": { "name": "UQ_agent_env_profile_vars_profile_key", - "nullsNotDistinct": false, "columns": [ "profile_id", "key" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -462,10 +462,10 @@ } ], "isUnique": true, - "where": "\"agent_environment_profiles\".\"owned_by_organization_id\" is not null", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"agent_environment_profiles\".\"owned_by_organization_id\" is not null", + "concurrently": false }, "UQ_agent_env_profiles_user_name": { "name": "UQ_agent_env_profiles_user_name", @@ -484,10 +484,10 @@ } ], "isUnique": true, - "where": "\"agent_environment_profiles\".\"owned_by_user_id\" is not null", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"agent_environment_profiles\".\"owned_by_user_id\" is not null", + "concurrently": false }, "UQ_agent_env_profiles_org_default": { "name": "UQ_agent_env_profiles_org_default", @@ -500,10 +500,10 @@ } ], "isUnique": true, - "where": "\"agent_environment_profiles\".\"is_default\" = true AND \"agent_environment_profiles\".\"owned_by_organization_id\" IS NOT NULL", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"agent_environment_profiles\".\"is_default\" = true AND \"agent_environment_profiles\".\"owned_by_organization_id\" IS NOT NULL", + "concurrently": false }, "UQ_agent_env_profiles_user_default": { "name": "UQ_agent_env_profiles_user_default", @@ -516,10 +516,10 @@ } ], "isUnique": true, - "where": "\"agent_environment_profiles\".\"is_default\" = true AND \"agent_environment_profiles\".\"owned_by_user_id\" IS NOT NULL", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"agent_environment_profiles\".\"is_default\" = true AND \"agent_environment_profiles\".\"owned_by_user_id\" IS NOT NULL", + "concurrently": false }, "IDX_agent_env_profiles_org_id": { "name": "IDX_agent_env_profiles_org_id", @@ -532,9 +532,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_agent_env_profiles_user_id": { "name": "IDX_agent_env_profiles_user_id", @@ -547,37 +547,37 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "agent_environment_profiles_owned_by_organization_id_organizations_id_fk": { "name": "agent_environment_profiles_owned_by_organization_id_organizations_id_fk", "tableFrom": "agent_environment_profiles", - "tableTo": "organizations", "columnsFrom": [ "owned_by_organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "agent_environment_profiles_owned_by_user_id_kilocode_users_id_fk": { "name": "agent_environment_profiles_owned_by_user_id_kilocode_users_id_fk", "tableFrom": "agent_environment_profiles", - "tableTo": "kilocode_users", "columnsFrom": [ "owned_by_user_id" ], + "tableTo": "kilocode_users", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, @@ -620,9 +620,9 @@ } ], "isUnique": true, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": {}, @@ -704,9 +704,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": {}, @@ -801,9 +801,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_app_builder_feedback_kilo_user_id": { "name": "IDX_app_builder_feedback_kilo_user_id", @@ -816,9 +816,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_app_builder_feedback_project_id": { "name": "IDX_app_builder_feedback_project_id", @@ -831,37 +831,37 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "app_builder_feedback_kilo_user_id_kilocode_users_id_fk": { "name": "app_builder_feedback_kilo_user_id_kilocode_users_id_fk", "tableFrom": "app_builder_feedback", - "tableTo": "kilocode_users", "columnsFrom": [ "kilo_user_id" ], + "tableTo": "kilocode_users", "columnsTo": [ "id" ], - "onDelete": "set null", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "set null" }, "app_builder_feedback_project_id_app_builder_projects_id_fk": { "name": "app_builder_feedback_project_id_app_builder_projects_id_fk", "tableFrom": "app_builder_feedback", - "tableTo": "app_builder_projects", "columnsFrom": [ "project_id" ], + "tableTo": "app_builder_projects", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, @@ -932,34 +932,34 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "app_builder_project_sessions_project_id_app_builder_projects_id_fk": { "name": "app_builder_project_sessions_project_id_app_builder_projects_id_fk", "tableFrom": "app_builder_project_sessions", - "tableTo": "app_builder_projects", "columnsFrom": [ "project_id" ], + "tableTo": "app_builder_projects", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "UQ_app_builder_project_sessions_cloud_agent_session_id": { "name": "UQ_app_builder_project_sessions_cloud_agent_session_id", - "nullsNotDistinct": false, "columns": [ "cloud_agent_session_id" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -1076,9 +1076,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_app_builder_projects_owned_by_user_id": { "name": "IDX_app_builder_projects_owned_by_user_id", @@ -1091,9 +1091,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_app_builder_projects_owned_by_organization_id": { "name": "IDX_app_builder_projects_owned_by_organization_id", @@ -1106,9 +1106,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_app_builder_projects_created_at": { "name": "IDX_app_builder_projects_created_at", @@ -1121,9 +1121,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_app_builder_projects_last_message_at": { "name": "IDX_app_builder_projects_last_message_at", @@ -1136,63 +1136,63 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "app_builder_projects_owned_by_user_id_kilocode_users_id_fk": { "name": "app_builder_projects_owned_by_user_id_kilocode_users_id_fk", "tableFrom": "app_builder_projects", - "tableTo": "kilocode_users", "columnsFrom": [ "owned_by_user_id" ], + "tableTo": "kilocode_users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "app_builder_projects_owned_by_organization_id_organizations_id_fk": { "name": "app_builder_projects_owned_by_organization_id_organizations_id_fk", "tableFrom": "app_builder_projects", - "tableTo": "organizations", "columnsFrom": [ "owned_by_organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "app_builder_projects_deployment_id_deployments_id_fk": { "name": "app_builder_projects_deployment_id_deployments_id_fk", "tableFrom": "app_builder_projects", - "tableTo": "deployments", "columnsFrom": [ "deployment_id" ], + "tableTo": "deployments", "columnsTo": [ "id" ], - "onDelete": "set null", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "set null" }, "app_builder_projects_git_platform_integration_id_platform_integrations_id_fk": { "name": "app_builder_projects_git_platform_integration_id_platform_integrations_id_fk", "tableFrom": "app_builder_projects", - "tableTo": "platform_integrations", "columnsFrom": [ "git_platform_integration_id" ], + "tableTo": "platform_integrations", "columnsTo": [ "id" ], - "onDelete": "set null", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "set null" } }, "compositePrimaryKeys": {}, @@ -1266,15 +1266,15 @@ "app_reported_messages_cli_session_id_cli_sessions_session_id_fk": { "name": "app_reported_messages_cli_session_id_cli_sessions_session_id_fk", "tableFrom": "app_reported_messages", - "tableTo": "cli_sessions", "columnsFrom": [ "cli_session_id" ], + "tableTo": "cli_sessions", "columnsTo": [ "session_id" ], - "onDelete": "set null", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "set null" } }, "compositePrimaryKeys": {}, @@ -1523,10 +1523,10 @@ } ], "isUnique": true, - "where": "\"auto_fix_tickets\".\"trigger_source\" = 'label'", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"auto_fix_tickets\".\"trigger_source\" = 'label'", + "concurrently": false }, "UQ_auto_fix_tickets_repo_review_comment": { "name": "UQ_auto_fix_tickets_repo_review_comment", @@ -1545,10 +1545,10 @@ } ], "isUnique": true, - "where": "\"auto_fix_tickets\".\"review_comment_id\" IS NOT NULL", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"auto_fix_tickets\".\"review_comment_id\" IS NOT NULL", + "concurrently": false }, "IDX_auto_fix_tickets_owned_by_org": { "name": "IDX_auto_fix_tickets_owned_by_org", @@ -1561,9 +1561,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_auto_fix_tickets_owned_by_user": { "name": "IDX_auto_fix_tickets_owned_by_user", @@ -1576,9 +1576,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_auto_fix_tickets_status": { "name": "IDX_auto_fix_tickets_status", @@ -1591,9 +1591,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_auto_fix_tickets_created_at": { "name": "IDX_auto_fix_tickets_created_at", @@ -1606,9 +1606,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_auto_fix_tickets_triage_ticket_id": { "name": "IDX_auto_fix_tickets_triage_ticket_id", @@ -1621,9 +1621,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_auto_fix_tickets_session_id": { "name": "IDX_auto_fix_tickets_session_id", @@ -1636,76 +1636,76 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "auto_fix_tickets_owned_by_organization_id_organizations_id_fk": { "name": "auto_fix_tickets_owned_by_organization_id_organizations_id_fk", "tableFrom": "auto_fix_tickets", - "tableTo": "organizations", "columnsFrom": [ "owned_by_organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "auto_fix_tickets_owned_by_user_id_kilocode_users_id_fk": { "name": "auto_fix_tickets_owned_by_user_id_kilocode_users_id_fk", "tableFrom": "auto_fix_tickets", - "tableTo": "kilocode_users", "columnsFrom": [ "owned_by_user_id" ], + "tableTo": "kilocode_users", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "auto_fix_tickets_platform_integration_id_platform_integrations_id_fk": { "name": "auto_fix_tickets_platform_integration_id_platform_integrations_id_fk", "tableFrom": "auto_fix_tickets", - "tableTo": "platform_integrations", "columnsFrom": [ "platform_integration_id" ], + "tableTo": "platform_integrations", "columnsTo": [ "id" ], - "onDelete": "set null", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "set null" }, "auto_fix_tickets_triage_ticket_id_auto_triage_tickets_id_fk": { "name": "auto_fix_tickets_triage_ticket_id_auto_triage_tickets_id_fk", "tableFrom": "auto_fix_tickets", - "tableTo": "auto_triage_tickets", "columnsFrom": [ "triage_ticket_id" ], + "tableTo": "auto_triage_tickets", "columnsTo": [ "id" ], - "onDelete": "set null", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "set null" }, "auto_fix_tickets_cli_session_id_cli_sessions_session_id_fk": { "name": "auto_fix_tickets_cli_session_id_cli_sessions_session_id_fk", "tableFrom": "auto_fix_tickets", - "tableTo": "cli_sessions", "columnsFrom": [ "cli_session_id" ], + "tableTo": "cli_sessions", "columnsTo": [ "session_id" ], - "onDelete": "set null", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "set null" } }, "compositePrimaryKeys": {}, @@ -1764,9 +1764,9 @@ } ], "isUnique": true, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": {}, @@ -1863,10 +1863,10 @@ } ], "isUnique": true, - "where": "\"auto_top_up_configs\".\"owned_by_user_id\" IS NOT NULL", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"auto_top_up_configs\".\"owned_by_user_id\" IS NOT NULL", + "concurrently": false }, "UQ_auto_top_up_configs_owned_by_organization_id": { "name": "UQ_auto_top_up_configs_owned_by_organization_id", @@ -1879,38 +1879,38 @@ } ], "isUnique": true, - "where": "\"auto_top_up_configs\".\"owned_by_organization_id\" IS NOT NULL", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"auto_top_up_configs\".\"owned_by_organization_id\" IS NOT NULL", + "concurrently": false } }, "foreignKeys": { "auto_top_up_configs_owned_by_user_id_kilocode_users_id_fk": { "name": "auto_top_up_configs_owned_by_user_id_kilocode_users_id_fk", "tableFrom": "auto_top_up_configs", - "tableTo": "kilocode_users", "columnsFrom": [ "owned_by_user_id" ], + "tableTo": "kilocode_users", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "cascade" }, "auto_top_up_configs_owned_by_organization_id_organizations_id_fk": { "name": "auto_top_up_configs_owned_by_organization_id_organizations_id_fk", "tableFrom": "auto_top_up_configs", - "tableTo": "organizations", "columnsFrom": [ "owned_by_organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, @@ -2141,9 +2141,9 @@ } ], "isUnique": true, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_auto_triage_tickets_owned_by_org": { "name": "IDX_auto_triage_tickets_owned_by_org", @@ -2156,9 +2156,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_auto_triage_tickets_owned_by_user": { "name": "IDX_auto_triage_tickets_owned_by_user", @@ -2171,9 +2171,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_auto_triage_tickets_status": { "name": "IDX_auto_triage_tickets_status", @@ -2186,9 +2186,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_auto_triage_tickets_created_at": { "name": "IDX_auto_triage_tickets_created_at", @@ -2201,9 +2201,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_auto_triage_tickets_qdrant_point_id": { "name": "IDX_auto_triage_tickets_qdrant_point_id", @@ -2216,9 +2216,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_auto_triage_tickets_owner_status_created": { "name": "IDX_auto_triage_tickets_owner_status_created", @@ -2243,9 +2243,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_auto_triage_tickets_user_status_created": { "name": "IDX_auto_triage_tickets_user_status_created", @@ -2270,9 +2270,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_auto_triage_tickets_repo_classification": { "name": "IDX_auto_triage_tickets_repo_classification", @@ -2297,63 +2297,63 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "auto_triage_tickets_owned_by_organization_id_organizations_id_fk": { "name": "auto_triage_tickets_owned_by_organization_id_organizations_id_fk", "tableFrom": "auto_triage_tickets", - "tableTo": "organizations", "columnsFrom": [ "owned_by_organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "auto_triage_tickets_owned_by_user_id_kilocode_users_id_fk": { "name": "auto_triage_tickets_owned_by_user_id_kilocode_users_id_fk", "tableFrom": "auto_triage_tickets", - "tableTo": "kilocode_users", "columnsFrom": [ "owned_by_user_id" ], + "tableTo": "kilocode_users", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "auto_triage_tickets_platform_integration_id_platform_integrations_id_fk": { "name": "auto_triage_tickets_platform_integration_id_platform_integrations_id_fk", "tableFrom": "auto_triage_tickets", - "tableTo": "platform_integrations", "columnsFrom": [ "platform_integration_id" ], + "tableTo": "platform_integrations", "columnsTo": [ "id" ], - "onDelete": "set null", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "set null" }, "auto_triage_tickets_duplicate_of_ticket_id_auto_triage_tickets_id_fk": { "name": "auto_triage_tickets_duplicate_of_ticket_id_auto_triage_tickets_id_fk", "tableFrom": "auto_triage_tickets", - "tableTo": "auto_triage_tickets", "columnsFrom": [ "duplicate_of_ticket_id" ], + "tableTo": "auto_triage_tickets", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, "compositePrimaryKeys": {}, @@ -2508,9 +2508,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_bot_requests_created_by": { "name": "IDX_bot_requests_created_by", @@ -2523,9 +2523,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_bot_requests_organization_id": { "name": "IDX_bot_requests_organization_id", @@ -2538,9 +2538,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_bot_requests_platform_integration_id": { "name": "IDX_bot_requests_platform_integration_id", @@ -2553,9 +2553,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_bot_requests_status": { "name": "IDX_bot_requests_status", @@ -2568,50 +2568,50 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "bot_requests_created_by_kilocode_users_id_fk": { "name": "bot_requests_created_by_kilocode_users_id_fk", "tableFrom": "bot_requests", - "tableTo": "kilocode_users", "columnsFrom": [ "created_by" ], + "tableTo": "kilocode_users", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "bot_requests_organization_id_organizations_id_fk": { "name": "bot_requests_organization_id_organizations_id_fk", "tableFrom": "bot_requests", - "tableTo": "organizations", "columnsFrom": [ "organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "bot_requests_platform_integration_id_platform_integrations_id_fk": { "name": "bot_requests_platform_integration_id_platform_integrations_id_fk", "tableFrom": "bot_requests", - "tableTo": "platform_integrations", "columnsFrom": [ "platform_integration_id" ], + "tableTo": "platform_integrations", "columnsTo": [ "id" ], - "onDelete": "set null", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "set null" } }, "compositePrimaryKeys": {}, @@ -2695,9 +2695,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_byok_api_keys_kilo_user_id": { "name": "IDX_byok_api_keys_kilo_user_id", @@ -2710,9 +2710,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_byok_api_keys_provider_id": { "name": "IDX_byok_api_keys_provider_id", @@ -2725,56 +2725,56 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "byok_api_keys_organization_id_organizations_id_fk": { "name": "byok_api_keys_organization_id_organizations_id_fk", "tableFrom": "byok_api_keys", - "tableTo": "organizations", "columnsFrom": [ "organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "byok_api_keys_kilo_user_id_kilocode_users_id_fk": { "name": "byok_api_keys_kilo_user_id_kilocode_users_id_fk", "tableFrom": "byok_api_keys", - "tableTo": "kilocode_users", "columnsFrom": [ "kilo_user_id" ], + "tableTo": "kilocode_users", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "UQ_byok_api_keys_org_provider": { "name": "UQ_byok_api_keys_org_provider", - "nullsNotDistinct": false, "columns": [ "organization_id", "provider_id" - ] + ], + "nullsNotDistinct": false }, "UQ_byok_api_keys_user_provider": { "name": "UQ_byok_api_keys_user_provider", - "nullsNotDistinct": false, "columns": [ "kilo_user_id", "provider_id" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -2916,9 +2916,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_cli_sessions_created_at": { "name": "IDX_cli_sessions_created_at", @@ -2931,9 +2931,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_cli_sessions_updated_at": { "name": "IDX_cli_sessions_updated_at", @@ -2946,9 +2946,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_cli_sessions_organization_id": { "name": "IDX_cli_sessions_organization_id", @@ -2961,9 +2961,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_cli_sessions_user_updated": { "name": "IDX_cli_sessions_user_updated", @@ -2982,73 +2982,73 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "cli_sessions_kilo_user_id_kilocode_users_id_fk": { "name": "cli_sessions_kilo_user_id_kilocode_users_id_fk", "tableFrom": "cli_sessions", - "tableTo": "kilocode_users", "columnsFrom": [ "kilo_user_id" ], + "tableTo": "kilocode_users", "columnsTo": [ "id" ], - "onDelete": "restrict", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "restrict" }, "cli_sessions_forked_from_cli_sessions_session_id_fk": { "name": "cli_sessions_forked_from_cli_sessions_session_id_fk", "tableFrom": "cli_sessions", - "tableTo": "cli_sessions", "columnsFrom": [ "forked_from" ], + "tableTo": "cli_sessions", "columnsTo": [ "session_id" ], - "onDelete": "set null", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "set null" }, "cli_sessions_parent_session_id_cli_sessions_session_id_fk": { "name": "cli_sessions_parent_session_id_cli_sessions_session_id_fk", "tableFrom": "cli_sessions", - "tableTo": "cli_sessions", "columnsFrom": [ "parent_session_id" ], + "tableTo": "cli_sessions", "columnsTo": [ "session_id" ], - "onDelete": "set null", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "set null" }, "cli_sessions_organization_id_organizations_id_fk": { "name": "cli_sessions_organization_id_organizations_id_fk", "tableFrom": "cli_sessions", - "tableTo": "organizations", "columnsFrom": [ "organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "set null", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "set null" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "cli_sessions_cloud_agent_session_id_unique": { "name": "cli_sessions_cloud_agent_session_id_unique", - "nullsNotDistinct": false, "columns": [ "cloud_agent_session_id" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -3160,9 +3160,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "UQ_cli_sessions_v2_public_id": { "name": "UQ_cli_sessions_v2_public_id", @@ -3175,10 +3175,10 @@ } ], "isUnique": true, - "where": "\"cli_sessions_v2\".\"public_id\" is not null", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"cli_sessions_v2\".\"public_id\" is not null", + "concurrently": false }, "UQ_cli_sessions_v2_cloud_agent_session_id": { "name": "UQ_cli_sessions_v2_cloud_agent_session_id", @@ -3191,10 +3191,10 @@ } ], "isUnique": true, - "where": "\"cli_sessions_v2\".\"cloud_agent_session_id\" is not null", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"cli_sessions_v2\".\"cloud_agent_session_id\" is not null", + "concurrently": false }, "IDX_cli_sessions_v2_organization_id": { "name": "IDX_cli_sessions_v2_organization_id", @@ -3207,9 +3207,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_cli_sessions_v2_kilo_user_id": { "name": "IDX_cli_sessions_v2_kilo_user_id", @@ -3222,9 +3222,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_cli_sessions_v2_created_at": { "name": "IDX_cli_sessions_v2_created_at", @@ -3237,9 +3237,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_cli_sessions_v2_user_updated": { "name": "IDX_cli_sessions_v2_user_updated", @@ -3258,52 +3258,52 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "cli_sessions_v2_kilo_user_id_kilocode_users_id_fk": { "name": "cli_sessions_v2_kilo_user_id_kilocode_users_id_fk", "tableFrom": "cli_sessions_v2", - "tableTo": "kilocode_users", "columnsFrom": [ "kilo_user_id" ], + "tableTo": "kilocode_users", "columnsTo": [ "id" ], - "onDelete": "restrict", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "restrict" }, "cli_sessions_v2_organization_id_organizations_id_fk": { "name": "cli_sessions_v2_organization_id_organizations_id_fk", "tableFrom": "cli_sessions_v2", - "tableTo": "organizations", "columnsFrom": [ "organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "set null", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "set null" }, "cli_sessions_v2_parent_session_id_kilo_user_id_fk": { "name": "cli_sessions_v2_parent_session_id_kilo_user_id_fk", "tableFrom": "cli_sessions_v2", - "tableTo": "cli_sessions_v2", "columnsFrom": [ "parent_session_id", "kilo_user_id" ], + "tableTo": "cli_sessions_v2", "columnsTo": [ "session_id", "kilo_user_id" ], - "onDelete": "restrict", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "restrict" } }, "compositePrimaryKeys": { @@ -3535,9 +3535,9 @@ } ], "isUnique": true, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_cloud_agent_code_reviews_owned_by_org_id": { "name": "idx_cloud_agent_code_reviews_owned_by_org_id", @@ -3550,9 +3550,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_cloud_agent_code_reviews_owned_by_user_id": { "name": "idx_cloud_agent_code_reviews_owned_by_user_id", @@ -3565,9 +3565,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_cloud_agent_code_reviews_session_id": { "name": "idx_cloud_agent_code_reviews_session_id", @@ -3580,9 +3580,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_cloud_agent_code_reviews_cli_session_id": { "name": "idx_cloud_agent_code_reviews_cli_session_id", @@ -3595,9 +3595,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_cloud_agent_code_reviews_status": { "name": "idx_cloud_agent_code_reviews_status", @@ -3610,9 +3610,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_cloud_agent_code_reviews_repo": { "name": "idx_cloud_agent_code_reviews_repo", @@ -3625,9 +3625,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_cloud_agent_code_reviews_pr_number": { "name": "idx_cloud_agent_code_reviews_pr_number", @@ -3646,9 +3646,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_cloud_agent_code_reviews_created_at": { "name": "idx_cloud_agent_code_reviews_created_at", @@ -3661,9 +3661,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_cloud_agent_code_reviews_pr_author_github_id": { "name": "idx_cloud_agent_code_reviews_pr_author_github_id", @@ -3676,50 +3676,50 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "cloud_agent_code_reviews_owned_by_organization_id_organizations_id_fk": { "name": "cloud_agent_code_reviews_owned_by_organization_id_organizations_id_fk", "tableFrom": "cloud_agent_code_reviews", - "tableTo": "organizations", "columnsFrom": [ "owned_by_organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "cloud_agent_code_reviews_owned_by_user_id_kilocode_users_id_fk": { "name": "cloud_agent_code_reviews_owned_by_user_id_kilocode_users_id_fk", "tableFrom": "cloud_agent_code_reviews", - "tableTo": "kilocode_users", "columnsFrom": [ "owned_by_user_id" ], + "tableTo": "kilocode_users", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "cloud_agent_code_reviews_platform_integration_id_platform_integrations_id_fk": { "name": "cloud_agent_code_reviews_platform_integration_id_platform_integrations_id_fk", "tableFrom": "cloud_agent_code_reviews", - "tableTo": "platform_integrations", "columnsFrom": [ "platform_integration_id" ], + "tableTo": "platform_integrations", "columnsTo": [ "id" ], - "onDelete": "set null", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "set null" } }, "compositePrimaryKeys": {}, @@ -3818,9 +3818,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_cloud_agent_feedback_kilo_user_id": { "name": "IDX_cloud_agent_feedback_kilo_user_id", @@ -3833,9 +3833,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_cloud_agent_feedback_cloud_agent_session_id": { "name": "IDX_cloud_agent_feedback_cloud_agent_session_id", @@ -3848,37 +3848,37 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "cloud_agent_feedback_kilo_user_id_kilocode_users_id_fk": { "name": "cloud_agent_feedback_kilo_user_id_kilocode_users_id_fk", "tableFrom": "cloud_agent_feedback", - "tableTo": "kilocode_users", "columnsFrom": [ "kilo_user_id" ], + "tableTo": "kilocode_users", "columnsTo": [ "id" ], - "onDelete": "set null", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "set null" }, "cloud_agent_feedback_organization_id_organizations_id_fk": { "name": "cloud_agent_feedback_organization_id_organizations_id_fk", "tableFrom": "cloud_agent_feedback", - "tableTo": "organizations", "columnsFrom": [ "organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "set null", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "set null" } }, "compositePrimaryKeys": {}, @@ -3968,10 +3968,10 @@ } ], "isUnique": true, - "where": "\"cloud_agent_webhook_triggers\".\"user_id\" is not null", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"cloud_agent_webhook_triggers\".\"user_id\" is not null", + "concurrently": false }, "UQ_cloud_agent_webhook_triggers_org_trigger": { "name": "UQ_cloud_agent_webhook_triggers_org_trigger", @@ -3990,10 +3990,10 @@ } ], "isUnique": true, - "where": "\"cloud_agent_webhook_triggers\".\"organization_id\" is not null", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"cloud_agent_webhook_triggers\".\"organization_id\" is not null", + "concurrently": false }, "IDX_cloud_agent_webhook_triggers_user": { "name": "IDX_cloud_agent_webhook_triggers_user", @@ -4006,9 +4006,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_cloud_agent_webhook_triggers_org": { "name": "IDX_cloud_agent_webhook_triggers_org", @@ -4021,9 +4021,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_cloud_agent_webhook_triggers_active": { "name": "IDX_cloud_agent_webhook_triggers_active", @@ -4036,9 +4036,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_cloud_agent_webhook_triggers_profile": { "name": "IDX_cloud_agent_webhook_triggers_profile", @@ -4051,50 +4051,50 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "cloud_agent_webhook_triggers_user_id_kilocode_users_id_fk": { "name": "cloud_agent_webhook_triggers_user_id_kilocode_users_id_fk", "tableFrom": "cloud_agent_webhook_triggers", - "tableTo": "kilocode_users", "columnsFrom": [ "user_id" ], + "tableTo": "kilocode_users", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "cloud_agent_webhook_triggers_organization_id_organizations_id_fk": { "name": "cloud_agent_webhook_triggers_organization_id_organizations_id_fk", "tableFrom": "cloud_agent_webhook_triggers", - "tableTo": "organizations", "columnsFrom": [ "organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "cloud_agent_webhook_triggers_profile_id_agent_environment_profiles_id_fk": { "name": "cloud_agent_webhook_triggers_profile_id_agent_environment_profiles_id_fk", "tableFrom": "cloud_agent_webhook_triggers", - "tableTo": "agent_environment_profiles", "columnsFrom": [ "profile_id" ], + "tableTo": "agent_environment_profiles", "columnsTo": [ "id" ], - "onDelete": "restrict", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "restrict" } }, "compositePrimaryKeys": {}, @@ -4193,9 +4193,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_code_indexing_manifest_kilo_user_id": { "name": "IDX_code_indexing_manifest_kilo_user_id", @@ -4208,9 +4208,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_code_indexing_manifest_project_id": { "name": "IDX_code_indexing_manifest_project_id", @@ -4223,9 +4223,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_code_indexing_manifest_file_hash": { "name": "IDX_code_indexing_manifest_file_hash", @@ -4238,9 +4238,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_code_indexing_manifest_git_branch": { "name": "IDX_code_indexing_manifest_git_branch", @@ -4253,9 +4253,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_code_indexing_manifest_created_at": { "name": "IDX_code_indexing_manifest_created_at", @@ -4268,38 +4268,38 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "code_indexing_manifest_kilo_user_id_kilocode_users_id_fk": { "name": "code_indexing_manifest_kilo_user_id_kilocode_users_id_fk", "tableFrom": "code_indexing_manifest", - "tableTo": "kilocode_users", "columnsFrom": [ "kilo_user_id" ], + "tableTo": "kilocode_users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "UQ_code_indexing_manifest_org_user_project_hash_branch": { "name": "UQ_code_indexing_manifest_org_user_project_hash_branch", - "nullsNotDistinct": true, "columns": [ "organization_id", "kilo_user_id", "project_id", "file_path", "git_branch" - ] + ], + "nullsNotDistinct": true } }, "policies": {}, @@ -4367,9 +4367,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_code_indexing_search_kilo_user_id": { "name": "IDX_code_indexing_search_kilo_user_id", @@ -4382,9 +4382,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_code_indexing_search_project_id": { "name": "IDX_code_indexing_search_project_id", @@ -4403,9 +4403,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_code_indexing_search_created_at": { "name": "IDX_code_indexing_search_created_at", @@ -4418,24 +4418,24 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "code_indexing_search_kilo_user_id_kilocode_users_id_fk": { "name": "code_indexing_search_kilo_user_id_kilocode_users_id_fk", "tableFrom": "code_indexing_search", - "tableTo": "kilocode_users", "columnsFrom": [ "kilo_user_id" ], + "tableTo": "kilocode_users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, "compositePrimaryKeys": {}, @@ -4554,9 +4554,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_credit_transactions_is_free": { "name": "IDX_credit_transactions_is_free", @@ -4569,9 +4569,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_credit_transactions_kilo_user_id": { "name": "IDX_credit_transactions_kilo_user_id", @@ -4584,9 +4584,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_credit_transactions_credit_category": { "name": "IDX_credit_transactions_credit_category", @@ -4599,9 +4599,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_credit_transactions_stripe_payment_id": { "name": "IDX_credit_transactions_stripe_payment_id", @@ -4614,9 +4614,9 @@ } ], "isUnique": true, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_credit_transactions_original_transaction_id": { "name": "IDX_credit_transactions_original_transaction_id", @@ -4629,9 +4629,9 @@ } ], "isUnique": true, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_credit_transactions_coinbase_credit_block_id": { "name": "IDX_credit_transactions_coinbase_credit_block_id", @@ -4644,9 +4644,9 @@ } ], "isUnique": true, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_credit_transactions_organization_id": { "name": "IDX_credit_transactions_organization_id", @@ -4659,9 +4659,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_credit_transactions_unique_category": { "name": "IDX_credit_transactions_unique_category", @@ -4680,10 +4680,10 @@ } ], "isUnique": true, - "where": "\"credit_transactions\".\"check_category_uniqueness\" = TRUE", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"credit_transactions\".\"check_category_uniqueness\" = TRUE", + "concurrently": false } }, "foreignKeys": {}, @@ -4851,9 +4851,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_deployment_builds_status": { "name": "idx_deployment_builds_status", @@ -4866,24 +4866,24 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "deployment_builds_deployment_id_deployments_id_fk": { "name": "deployment_builds_deployment_id_deployments_id_fk", "tableFrom": "deployment_builds", - "tableTo": "deployments", "columnsFrom": [ "deployment_id" ], + "tableTo": "deployments", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, @@ -4955,35 +4955,35 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "deployment_env_vars_deployment_id_deployments_id_fk": { "name": "deployment_env_vars_deployment_id_deployments_id_fk", "tableFrom": "deployment_env_vars", - "tableTo": "deployments", "columnsFrom": [ "deployment_id" ], + "tableTo": "deployments", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "UQ_deployment_env_vars_deployment_key": { "name": "UQ_deployment_env_vars_deployment_key", - "nullsNotDistinct": false, "columns": [ "deployment_id", "key" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -5038,9 +5038,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_deployment_events_timestamp": { "name": "idx_deployment_events_timestamp", @@ -5053,9 +5053,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_deployment_events_type": { "name": "idx_deployment_events_type", @@ -5068,24 +5068,24 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "deployment_events_build_id_deployment_builds_id_fk": { "name": "deployment_events_build_id_deployment_builds_id_fk", "tableFrom": "deployment_events", - "tableTo": "deployment_builds", "columnsFrom": [ "build_id" ], + "tableTo": "deployment_builds", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": { @@ -5151,9 +5151,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_deployment_threat_detections_created_at": { "name": "idx_deployment_threat_detections_created_at", @@ -5166,37 +5166,37 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "deployment_threat_detections_deployment_id_deployments_id_fk": { "name": "deployment_threat_detections_deployment_id_deployments_id_fk", "tableFrom": "deployment_threat_detections", - "tableTo": "deployments", "columnsFrom": [ "deployment_id" ], + "tableTo": "deployments", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "deployment_threat_detections_build_id_deployment_builds_id_fk": { "name": "deployment_threat_detections_build_id_deployment_builds_id_fk", "tableFrom": "deployment_threat_detections", - "tableTo": "deployment_builds", "columnsFrom": [ "build_id" ], + "tableTo": "deployment_builds", "columnsTo": [ "id" ], - "onDelete": "set null", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "set null" } }, "compositePrimaryKeys": {}, @@ -5327,9 +5327,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_deployments_owned_by_organization_id": { "name": "idx_deployments_owned_by_organization_id", @@ -5342,9 +5342,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_deployments_platform_integration_id": { "name": "idx_deployments_platform_integration_id", @@ -5357,9 +5357,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_deployments_repository_source_branch": { "name": "idx_deployments_repository_source_branch", @@ -5378,9 +5378,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_deployments_threat_status_pending": { "name": "idx_deployments_threat_status_pending", @@ -5393,48 +5393,48 @@ } ], "isUnique": false, - "where": "\"deployments\".\"threat_status\" = 'pending_scan'", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"deployments\".\"threat_status\" = 'pending_scan'", + "concurrently": false } }, "foreignKeys": { "deployments_owned_by_user_id_kilocode_users_id_fk": { "name": "deployments_owned_by_user_id_kilocode_users_id_fk", "tableFrom": "deployments", - "tableTo": "kilocode_users", "columnsFrom": [ "owned_by_user_id" ], + "tableTo": "kilocode_users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "deployments_owned_by_organization_id_organizations_id_fk": { "name": "deployments_owned_by_organization_id_organizations_id_fk", "tableFrom": "deployments", - "tableTo": "organizations", "columnsFrom": [ "owned_by_organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "UQ_deployments_deployment_slug": { "name": "UQ_deployments_deployment_slug", - "nullsNotDistinct": false, "columns": [ "deployment_slug" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -5531,9 +5531,9 @@ } ], "isUnique": true, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_device_auth_requests_status": { "name": "IDX_device_auth_requests_status", @@ -5546,9 +5546,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_device_auth_requests_expires_at": { "name": "IDX_device_auth_requests_expires_at", @@ -5561,9 +5561,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_device_auth_requests_kilo_user_id": { "name": "IDX_device_auth_requests_kilo_user_id", @@ -5576,24 +5576,24 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "device_auth_requests_kilo_user_id_kilocode_users_id_fk": { "name": "device_auth_requests_kilo_user_id_kilocode_users_id_fk", "tableFrom": "device_auth_requests", - "tableTo": "kilocode_users", "columnsFrom": [ "kilo_user_id" ], + "tableTo": "kilocode_users", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, @@ -5670,9 +5670,9 @@ } ], "isUnique": true, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": {}, @@ -5744,34 +5744,34 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "enrichment_data_user_id_kilocode_users_id_fk": { "name": "enrichment_data_user_id_kilocode_users_id_fk", "tableFrom": "enrichment_data", - "tableTo": "kilocode_users", "columnsFrom": [ "user_id" ], + "tableTo": "kilocode_users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "UQ_enrichment_data_user_id": { "name": "UQ_enrichment_data_user_id", - "nullsNotDistinct": false, "columns": [ "user_id" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -5807,9 +5807,9 @@ } ], "isUnique": true, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": {}, @@ -5848,9 +5848,9 @@ } ], "isUnique": true, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": {}, @@ -5915,9 +5915,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_free_model_usage_created_at": { "name": "idx_free_model_usage_created_at", @@ -5930,9 +5930,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": {}, @@ -5971,9 +5971,9 @@ } ], "isUnique": true, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": {}, @@ -6012,9 +6012,9 @@ } ], "isUnique": true, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": {}, @@ -6053,9 +6053,9 @@ } ], "isUnique": true, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": {}, @@ -6163,9 +6163,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_kilo_pass_audit_log_kilo_user_id": { "name": "IDX_kilo_pass_audit_log_kilo_user_id", @@ -6178,9 +6178,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_kilo_pass_audit_log_kilo_pass_subscription_id": { "name": "IDX_kilo_pass_audit_log_kilo_pass_subscription_id", @@ -6193,9 +6193,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_kilo_pass_audit_log_action": { "name": "IDX_kilo_pass_audit_log_action", @@ -6208,9 +6208,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_kilo_pass_audit_log_result": { "name": "IDX_kilo_pass_audit_log_result", @@ -6223,9 +6223,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_kilo_pass_audit_log_idempotency_key": { "name": "IDX_kilo_pass_audit_log_idempotency_key", @@ -6238,9 +6238,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_kilo_pass_audit_log_stripe_event_id": { "name": "IDX_kilo_pass_audit_log_stripe_event_id", @@ -6253,9 +6253,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_kilo_pass_audit_log_stripe_invoice_id": { "name": "IDX_kilo_pass_audit_log_stripe_invoice_id", @@ -6268,9 +6268,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_kilo_pass_audit_log_stripe_subscription_id": { "name": "IDX_kilo_pass_audit_log_stripe_subscription_id", @@ -6283,9 +6283,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_kilo_pass_audit_log_related_credit_transaction_id": { "name": "IDX_kilo_pass_audit_log_related_credit_transaction_id", @@ -6298,9 +6298,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_kilo_pass_audit_log_related_monthly_issuance_id": { "name": "IDX_kilo_pass_audit_log_related_monthly_issuance_id", @@ -6313,63 +6313,63 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "kilo_pass_audit_log_kilo_user_id_kilocode_users_id_fk": { "name": "kilo_pass_audit_log_kilo_user_id_kilocode_users_id_fk", "tableFrom": "kilo_pass_audit_log", - "tableTo": "kilocode_users", "columnsFrom": [ "kilo_user_id" ], + "tableTo": "kilocode_users", "columnsTo": [ "id" ], - "onDelete": "set null", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "set null" }, "kilo_pass_audit_log_kilo_pass_subscription_id_kilo_pass_subscriptions_id_fk": { "name": "kilo_pass_audit_log_kilo_pass_subscription_id_kilo_pass_subscriptions_id_fk", "tableFrom": "kilo_pass_audit_log", - "tableTo": "kilo_pass_subscriptions", "columnsFrom": [ "kilo_pass_subscription_id" ], + "tableTo": "kilo_pass_subscriptions", "columnsTo": [ "id" ], - "onDelete": "set null", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "set null" }, "kilo_pass_audit_log_related_credit_transaction_id_credit_transactions_id_fk": { "name": "kilo_pass_audit_log_related_credit_transaction_id_credit_transactions_id_fk", "tableFrom": "kilo_pass_audit_log", - "tableTo": "credit_transactions", "columnsFrom": [ "related_credit_transaction_id" ], + "tableTo": "credit_transactions", "columnsTo": [ "id" ], - "onDelete": "set null", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "set null" }, "kilo_pass_audit_log_related_monthly_issuance_id_kilo_pass_issuances_id_fk": { "name": "kilo_pass_audit_log_related_monthly_issuance_id_kilo_pass_issuances_id_fk", "tableFrom": "kilo_pass_audit_log", - "tableTo": "kilo_pass_issuances", "columnsFrom": [ "related_monthly_issuance_id" ], + "tableTo": "kilo_pass_issuances", "columnsTo": [ "id" ], - "onDelete": "set null", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "set null" } }, "compositePrimaryKeys": {}, @@ -6455,9 +6455,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_kilo_pass_issuance_items_credit_transaction_id": { "name": "IDX_kilo_pass_issuance_items_credit_transaction_id", @@ -6470,55 +6470,55 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "kilo_pass_issuance_items_kilo_pass_issuance_id_kilo_pass_issuances_id_fk": { "name": "kilo_pass_issuance_items_kilo_pass_issuance_id_kilo_pass_issuances_id_fk", "tableFrom": "kilo_pass_issuance_items", - "tableTo": "kilo_pass_issuances", "columnsFrom": [ "kilo_pass_issuance_id" ], + "tableTo": "kilo_pass_issuances", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "cascade" }, "kilo_pass_issuance_items_credit_transaction_id_credit_transactions_id_fk": { "name": "kilo_pass_issuance_items_credit_transaction_id_credit_transactions_id_fk", "tableFrom": "kilo_pass_issuance_items", - "tableTo": "credit_transactions", "columnsFrom": [ "credit_transaction_id" ], + "tableTo": "credit_transactions", "columnsTo": [ "id" ], - "onDelete": "restrict", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "restrict" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "kilo_pass_issuance_items_credit_transaction_id_unique": { "name": "kilo_pass_issuance_items_credit_transaction_id_unique", - "nullsNotDistinct": false, "columns": [ "credit_transaction_id" - ] + ], + "nullsNotDistinct": false }, "UQ_kilo_pass_issuance_items_issuance_kind": { "name": "UQ_kilo_pass_issuance_items_issuance_kind", - "nullsNotDistinct": false, "columns": [ "kilo_pass_issuance_id", "kind" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -6600,10 +6600,10 @@ } ], "isUnique": true, - "where": "\"kilo_pass_issuances\".\"stripe_invoice_id\" IS NOT NULL", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"kilo_pass_issuances\".\"stripe_invoice_id\" IS NOT NULL", + "concurrently": false }, "IDX_kilo_pass_issuances_subscription_id": { "name": "IDX_kilo_pass_issuances_subscription_id", @@ -6616,9 +6616,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_kilo_pass_issuances_issue_month": { "name": "IDX_kilo_pass_issuances_issue_month", @@ -6631,35 +6631,35 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "kilo_pass_issuances_kilo_pass_subscription_id_kilo_pass_subscriptions_id_fk": { "name": "kilo_pass_issuances_kilo_pass_subscription_id_kilo_pass_subscriptions_id_fk", "tableFrom": "kilo_pass_issuances", - "tableTo": "kilo_pass_subscriptions", "columnsFrom": [ "kilo_pass_subscription_id" ], + "tableTo": "kilo_pass_subscriptions", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "UQ_kilo_pass_issuances_subscription_issue_month": { "name": "UQ_kilo_pass_issuances_subscription_issue_month", - "nullsNotDistinct": false, "columns": [ "kilo_pass_subscription_id", "issue_month" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -6773,9 +6773,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_kilo_pass_scheduled_changes_status": { "name": "IDX_kilo_pass_scheduled_changes_status", @@ -6788,9 +6788,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_kilo_pass_scheduled_changes_stripe_subscription_id": { "name": "IDX_kilo_pass_scheduled_changes_stripe_subscription_id", @@ -6803,9 +6803,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "UQ_kilo_pass_scheduled_changes_active_stripe_subscription_id": { "name": "UQ_kilo_pass_scheduled_changes_active_stripe_subscription_id", @@ -6818,10 +6818,10 @@ } ], "isUnique": true, - "where": "\"kilo_pass_scheduled_changes\".\"deleted_at\" is null", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"kilo_pass_scheduled_changes\".\"deleted_at\" is null", + "concurrently": false }, "IDX_kilo_pass_scheduled_changes_effective_at": { "name": "IDX_kilo_pass_scheduled_changes_effective_at", @@ -6834,9 +6834,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_kilo_pass_scheduled_changes_deleted_at": { "name": "IDX_kilo_pass_scheduled_changes_deleted_at", @@ -6849,37 +6849,37 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "kilo_pass_scheduled_changes_kilo_user_id_kilocode_users_id_fk": { "name": "kilo_pass_scheduled_changes_kilo_user_id_kilocode_users_id_fk", "tableFrom": "kilo_pass_scheduled_changes", - "tableTo": "kilocode_users", "columnsFrom": [ "kilo_user_id" ], + "tableTo": "kilocode_users", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "cascade" }, "kilo_pass_scheduled_changes_stripe_subscription_id_kilo_pass_subscriptions_stripe_subscription_id_fk": { "name": "kilo_pass_scheduled_changes_stripe_subscription_id_kilo_pass_subscriptions_stripe_subscription_id_fk", "tableFrom": "kilo_pass_scheduled_changes", - "tableTo": "kilo_pass_subscriptions", "columnsFrom": [ "stripe_subscription_id" ], + "tableTo": "kilo_pass_subscriptions", "columnsTo": [ "stripe_subscription_id" ], - "onDelete": "cascade", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, @@ -7009,9 +7009,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_kilo_pass_subscriptions_status": { "name": "IDX_kilo_pass_subscriptions_status", @@ -7024,9 +7024,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_kilo_pass_subscriptions_cadence": { "name": "IDX_kilo_pass_subscriptions_cadence", @@ -7039,34 +7039,34 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "kilo_pass_subscriptions_kilo_user_id_kilocode_users_id_fk": { "name": "kilo_pass_subscriptions_kilo_user_id_kilocode_users_id_fk", "tableFrom": "kilo_pass_subscriptions", - "tableTo": "kilocode_users", "columnsFrom": [ "kilo_user_id" ], + "tableTo": "kilocode_users", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "kilo_pass_subscriptions_stripe_subscription_id_unique": { "name": "kilo_pass_subscriptions_stripe_subscription_id_unique", - "nullsNotDistinct": false, "columns": [ "stripe_subscription_id" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -7148,9 +7148,9 @@ } ], "isUnique": true, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_kiloclaw_access_codes_user_status": { "name": "IDX_kiloclaw_access_codes_user_status", @@ -7169,9 +7169,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "UQ_kiloclaw_access_codes_one_active_per_user": { "name": "UQ_kiloclaw_access_codes_one_active_per_user", @@ -7184,25 +7184,25 @@ } ], "isUnique": true, - "where": "status = 'active'", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "status = 'active'", + "concurrently": false } }, "foreignKeys": { "kiloclaw_access_codes_kilo_user_id_kilocode_users_id_fk": { "name": "kiloclaw_access_codes_kilo_user_id_kilocode_users_id_fk", "tableFrom": "kiloclaw_access_codes", - "tableTo": "kilocode_users", "columnsFrom": [ "kilo_user_id" ], + "tableTo": "kilocode_users", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, @@ -7284,9 +7284,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_kiloclaw_admin_audit_logs_action": { "name": "IDX_kiloclaw_admin_audit_logs_action", @@ -7299,9 +7299,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_kiloclaw_admin_audit_logs_created_at": { "name": "IDX_kiloclaw_admin_audit_logs_created_at", @@ -7314,9 +7314,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": {}, @@ -7374,39 +7374,39 @@ "kiloclaw_earlybird_purchases_user_id_kilocode_users_id_fk": { "name": "kiloclaw_earlybird_purchases_user_id_kilocode_users_id_fk", "tableFrom": "kiloclaw_earlybird_purchases", - "tableTo": "kilocode_users", "columnsFrom": [ "user_id" ], + "tableTo": "kilocode_users", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "kiloclaw_earlybird_purchases_user_id_unique": { "name": "kiloclaw_earlybird_purchases_user_id_unique", - "nullsNotDistinct": false, "columns": [ "user_id" - ] + ], + "nullsNotDistinct": false }, "kiloclaw_earlybird_purchases_stripe_charge_id_unique": { "name": "kiloclaw_earlybird_purchases_stripe_charge_id_unique", - "nullsNotDistinct": false, "columns": [ "stripe_charge_id" - ] + ], + "nullsNotDistinct": false }, "kiloclaw_earlybird_purchases_manual_payment_id_unique": { "name": "kiloclaw_earlybird_purchases_manual_payment_id_unique", - "nullsNotDistinct": false, "columns": [ "manual_payment_id" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -7462,24 +7462,24 @@ } ], "isUnique": true, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "kiloclaw_email_log_user_id_kilocode_users_id_fk": { "name": "kiloclaw_email_log_user_id_kilocode_users_id_fk", "tableFrom": "kiloclaw_email_log", - "tableTo": "kilocode_users", "columnsFrom": [ "user_id" ], + "tableTo": "kilocode_users", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, @@ -7583,9 +7583,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_kiloclaw_image_catalog_variant": { "name": "IDX_kiloclaw_image_catalog_variant", @@ -7598,9 +7598,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": {}, @@ -7608,10 +7608,10 @@ "uniqueConstraints": { "kiloclaw_image_catalog_image_tag_unique": { "name": "kiloclaw_image_catalog_image_tag_unique", - "nullsNotDistinct": false, "columns": [ "image_tag" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -7673,25 +7673,25 @@ } ], "isUnique": true, - "where": "\"kiloclaw_instances\".\"destroyed_at\" is null", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"kiloclaw_instances\".\"destroyed_at\" is null", + "concurrently": false } }, "foreignKeys": { "kiloclaw_instances_user_id_kilocode_users_id_fk": { "name": "kiloclaw_instances_user_id_kilocode_users_id_fk", "tableFrom": "kiloclaw_instances", - "tableTo": "kilocode_users", "columnsFrom": [ "user_id" ], + "tableTo": "kilocode_users", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, @@ -7835,9 +7835,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_kiloclaw_subscriptions_stripe_schedule_id": { "name": "IDX_kiloclaw_subscriptions_stripe_schedule_id", @@ -7850,41 +7850,41 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "kiloclaw_subscriptions_user_id_kilocode_users_id_fk": { "name": "kiloclaw_subscriptions_user_id_kilocode_users_id_fk", "tableFrom": "kiloclaw_subscriptions", - "tableTo": "kilocode_users", "columnsFrom": [ "user_id" ], + "tableTo": "kilocode_users", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "kiloclaw_subscriptions_user_id_unique": { "name": "kiloclaw_subscriptions_user_id_unique", - "nullsNotDistinct": false, "columns": [ "user_id" - ] + ], + "nullsNotDistinct": false }, "kiloclaw_subscriptions_stripe_subscription_id_unique": { "name": "kiloclaw_subscriptions_stripe_subscription_id_unique", - "nullsNotDistinct": false, "columns": [ "stripe_subscription_id" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -7963,51 +7963,51 @@ "kiloclaw_version_pins_user_id_kilocode_users_id_fk": { "name": "kiloclaw_version_pins_user_id_kilocode_users_id_fk", "tableFrom": "kiloclaw_version_pins", - "tableTo": "kilocode_users", "columnsFrom": [ "user_id" ], + "tableTo": "kilocode_users", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "kiloclaw_version_pins_image_tag_kiloclaw_image_catalog_image_tag_fk": { "name": "kiloclaw_version_pins_image_tag_kiloclaw_image_catalog_image_tag_fk", "tableFrom": "kiloclaw_version_pins", - "tableTo": "kiloclaw_image_catalog", "columnsFrom": [ "image_tag" ], + "tableTo": "kiloclaw_image_catalog", "columnsTo": [ "image_tag" ], - "onDelete": "restrict", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "restrict" }, "kiloclaw_version_pins_pinned_by_kilocode_users_id_fk": { "name": "kiloclaw_version_pins_pinned_by_kilocode_users_id_fk", "tableFrom": "kiloclaw_version_pins", - "tableTo": "kilocode_users", "columnsFrom": [ "pinned_by" ], + "tableTo": "kilocode_users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "kiloclaw_version_pins_user_id_unique": { "name": "kiloclaw_version_pins_user_id_unique", - "nullsNotDistinct": false, "columns": [ "user_id" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -8172,12 +8172,6 @@ "primaryKey": false, "notNull": false }, - "discord_server_membership_verified_at": { - "name": "discord_server_membership_verified_at", - "type": "timestamp with time zone", - "primaryKey": false, - "notNull": false - }, "openrouter_upstream_safety_identifier": { "name": "openrouter_upstream_safety_identifier", "type": "text", @@ -8203,10 +8197,10 @@ } ], "isUnique": true, - "where": "\"kilocode_users\".\"openrouter_upstream_safety_identifier\" IS NOT NULL", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"kilocode_users\".\"openrouter_upstream_safety_identifier\" IS NOT NULL", + "concurrently": false } }, "foreignKeys": {}, @@ -8214,10 +8208,10 @@ "uniqueConstraints": { "UQ_b1afacbcf43f2c7c4cb9f7e7faa": { "name": "UQ_b1afacbcf43f2c7c4cb9f7e7faa", - "nullsNotDistinct": false, "columns": [ "google_user_email" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -8277,9 +8271,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_magic_link_tokens_expires_at": { "name": "idx_magic_link_tokens_expires_at", @@ -8292,9 +8286,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": {}, @@ -8432,9 +8426,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_abuse_classification": { "name": "idx_abuse_classification", @@ -8447,9 +8441,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_kilo_user_id_created_at2": { "name": "idx_kilo_user_id_created_at2", @@ -8468,9 +8462,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_microdollar_usage_organization_id": { "name": "idx_microdollar_usage_organization_id", @@ -8483,10 +8477,10 @@ } ], "isUnique": false, - "where": "\"microdollar_usage\".\"organization_id\" is not null", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"microdollar_usage\".\"organization_id\" is not null", + "concurrently": false } }, "foreignKeys": {}, @@ -8717,89 +8711,89 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "microdollar_usage_metadata_http_user_agent_id_http_user_agent_http_user_agent_id_fk": { "name": "microdollar_usage_metadata_http_user_agent_id_http_user_agent_http_user_agent_id_fk", "tableFrom": "microdollar_usage_metadata", - "tableTo": "http_user_agent", "columnsFrom": [ "http_user_agent_id" ], + "tableTo": "http_user_agent", "columnsTo": [ "http_user_agent_id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "microdollar_usage_metadata_http_ip_id_http_ip_http_ip_id_fk": { "name": "microdollar_usage_metadata_http_ip_id_http_ip_http_ip_id_fk", "tableFrom": "microdollar_usage_metadata", - "tableTo": "http_ip", "columnsFrom": [ "http_ip_id" ], + "tableTo": "http_ip", "columnsTo": [ "http_ip_id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "microdollar_usage_metadata_vercel_ip_city_id_vercel_ip_city_vercel_ip_city_id_fk": { "name": "microdollar_usage_metadata_vercel_ip_city_id_vercel_ip_city_vercel_ip_city_id_fk", "tableFrom": "microdollar_usage_metadata", - "tableTo": "vercel_ip_city", "columnsFrom": [ "vercel_ip_city_id" ], + "tableTo": "vercel_ip_city", "columnsTo": [ "vercel_ip_city_id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "microdollar_usage_metadata_vercel_ip_country_id_vercel_ip_country_vercel_ip_country_id_fk": { "name": "microdollar_usage_metadata_vercel_ip_country_id_vercel_ip_country_vercel_ip_country_id_fk", "tableFrom": "microdollar_usage_metadata", - "tableTo": "vercel_ip_country", "columnsFrom": [ "vercel_ip_country_id" ], + "tableTo": "vercel_ip_country", "columnsTo": [ "vercel_ip_country_id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "microdollar_usage_metadata_ja4_digest_id_ja4_digest_ja4_digest_id_fk": { "name": "microdollar_usage_metadata_ja4_digest_id_ja4_digest_ja4_digest_id_fk", "tableFrom": "microdollar_usage_metadata", - "tableTo": "ja4_digest", "columnsFrom": [ "ja4_digest_id" ], + "tableTo": "ja4_digest", "columnsTo": [ "ja4_digest_id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "microdollar_usage_metadata_system_prompt_prefix_id_system_prompt_prefix_system_prompt_prefix_id_fk": { "name": "microdollar_usage_metadata_system_prompt_prefix_id_system_prompt_prefix_system_prompt_prefix_id_fk", "tableFrom": "microdollar_usage_metadata", - "tableTo": "system_prompt_prefix", "columnsFrom": [ "system_prompt_prefix_id" ], + "tableTo": "system_prompt_prefix", "columnsTo": [ "system_prompt_prefix_id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, "compositePrimaryKeys": {}, @@ -8837,9 +8831,9 @@ } ], "isUnique": true, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": {}, @@ -9023,9 +9017,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_model_stats_slug": { "name": "IDX_model_stats_slug", @@ -9038,9 +9032,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_model_stats_is_active": { "name": "IDX_model_stats_is_active", @@ -9053,9 +9047,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_model_stats_creator_slug": { "name": "IDX_model_stats_creator_slug", @@ -9068,9 +9062,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_model_stats_price_input": { "name": "IDX_model_stats_price_input", @@ -9083,9 +9077,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_model_stats_coding_index": { "name": "IDX_model_stats_coding_index", @@ -9098,9 +9092,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_model_stats_context_length": { "name": "IDX_model_stats_context_length", @@ -9113,9 +9107,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": {}, @@ -9123,17 +9117,17 @@ "uniqueConstraints": { "model_stats_openrouter_id_unique": { "name": "model_stats_openrouter_id_unique", - "nullsNotDistinct": false, "columns": [ "openrouter_id" - ] + ], + "nullsNotDistinct": false }, "model_stats_slug_unique": { "name": "model_stats_slug_unique", - "nullsNotDistinct": false, "columns": [ "slug" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -9244,9 +9238,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_organization_audit_logs_action": { "name": "IDX_organization_audit_logs_action", @@ -9259,9 +9253,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_organization_audit_logs_actor_id": { "name": "IDX_organization_audit_logs_actor_id", @@ -9274,9 +9268,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_organization_audit_logs_created_at": { "name": "IDX_organization_audit_logs_created_at", @@ -9289,9 +9283,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": {}, @@ -9381,9 +9375,9 @@ } ], "isUnique": true, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_organization_invitations_org_id": { "name": "IDX_organization_invitations_org_id", @@ -9396,9 +9390,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_organization_invitations_email": { "name": "IDX_organization_invitations_email", @@ -9411,9 +9405,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_organization_invitations_expires_at": { "name": "IDX_organization_invitations_expires_at", @@ -9426,9 +9420,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": {}, @@ -9507,9 +9501,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_organization_memberships_user_id": { "name": "IDX_organization_memberships_user_id", @@ -9522,9 +9516,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": {}, @@ -9532,11 +9526,11 @@ "uniqueConstraints": { "UQ_organization_memberships_org_user": { "name": "UQ_organization_memberships_org_user", - "nullsNotDistinct": false, "columns": [ "organization_id", "kilo_user_id" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -9638,9 +9632,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_organization_seats_expires_at": { "name": "IDX_organization_seats_expires_at", @@ -9653,9 +9647,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_organization_seats_created_at": { "name": "IDX_organization_seats_created_at", @@ -9668,9 +9662,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_organization_seats_updated_at": { "name": "IDX_organization_seats_updated_at", @@ -9683,9 +9677,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_organization_seats_starts_at": { "name": "IDX_organization_seats_starts_at", @@ -9698,9 +9692,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": {}, @@ -9708,10 +9702,10 @@ "uniqueConstraints": { "UQ_organization_seats_idempotency_key": { "name": "UQ_organization_seats_idempotency_key", - "nullsNotDistinct": false, "columns": [ "idempotency_key" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -9780,9 +9774,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_organization_user_limits_user_id": { "name": "IDX_organization_user_limits_user_id", @@ -9795,9 +9789,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": {}, @@ -9805,12 +9799,12 @@ "uniqueConstraints": { "UQ_organization_user_limits_org_user": { "name": "UQ_organization_user_limits_org_user", - "nullsNotDistinct": false, "columns": [ "organization_id", "kilo_user_id", "limit_type" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -9885,9 +9879,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_organization_user_daily_usage_user_id": { "name": "IDX_organization_user_daily_usage_user_id", @@ -9900,9 +9894,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": {}, @@ -9910,13 +9904,13 @@ "uniqueConstraints": { "UQ_organization_user_daily_usage_org_user_date": { "name": "UQ_organization_user_daily_usage_org_user_date", - "nullsNotDistinct": false, "columns": [ "organization_id", "kilo_user_id", "limit_type", "usage_date" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -10065,9 +10059,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": {}, @@ -10151,9 +10145,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": {}, @@ -10161,11 +10155,11 @@ "uniqueConstraints": { "UQ_organization_modes_org_id_slug": { "name": "UQ_organization_modes_org_id_slug", - "nullsNotDistinct": false, "columns": [ "organization_id", "slug" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -10379,9 +10373,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_e1feb919d0ab8a36381d5d5138": { "name": "IDX_e1feb919d0ab8a36381d5d5138", @@ -10394,9 +10388,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_payment_methods_organization_id": { "name": "IDX_payment_methods_organization_id", @@ -10409,9 +10403,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": {}, @@ -10419,11 +10413,11 @@ "uniqueConstraints": { "UQ_29df1b0403df5792c96bbbfdbe6": { "name": "UQ_29df1b0403df5792c96bbbfdbe6", - "nullsNotDistinct": false, "columns": [ "user_id", "stripe_id" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -10608,10 +10602,10 @@ } ], "isUnique": true, - "where": "\"platform_integrations\".\"owned_by_organization_id\" is not null", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"platform_integrations\".\"owned_by_organization_id\" is not null", + "concurrently": false }, "UQ_platform_integrations_owned_by_user_platform_inst": { "name": "UQ_platform_integrations_owned_by_user_platform_inst", @@ -10636,10 +10630,10 @@ } ], "isUnique": true, - "where": "\"platform_integrations\".\"owned_by_user_id\" is not null", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"platform_integrations\".\"owned_by_user_id\" is not null", + "concurrently": false }, "IDX_platform_integrations_owned_by_org_id": { "name": "IDX_platform_integrations_owned_by_org_id", @@ -10652,9 +10646,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_platform_integrations_owned_by_user_id": { "name": "IDX_platform_integrations_owned_by_user_id", @@ -10667,9 +10661,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_platform_integrations_platform_inst_id": { "name": "IDX_platform_integrations_platform_inst_id", @@ -10682,9 +10676,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_platform_integrations_platform": { "name": "IDX_platform_integrations_platform", @@ -10697,9 +10691,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_platform_integrations_owned_by_org_platform": { "name": "IDX_platform_integrations_owned_by_org_platform", @@ -10718,9 +10712,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_platform_integrations_owned_by_user_platform": { "name": "IDX_platform_integrations_owned_by_user_platform", @@ -10739,9 +10733,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_platform_integrations_integration_status": { "name": "IDX_platform_integrations_integration_status", @@ -10754,9 +10748,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_platform_integrations_kilo_requester": { "name": "IDX_platform_integrations_kilo_requester", @@ -10781,9 +10775,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_platform_integrations_platform_requester": { "name": "IDX_platform_integrations_platform_requester", @@ -10808,37 +10802,37 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "platform_integrations_owned_by_organization_id_organizations_id_fk": { "name": "platform_integrations_owned_by_organization_id_organizations_id_fk", "tableFrom": "platform_integrations", - "tableTo": "organizations", "columnsFrom": [ "owned_by_organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "platform_integrations_owned_by_user_id_kilocode_users_id_fk": { "name": "platform_integrations_owned_by_user_id_kilocode_users_id_fk", "tableFrom": "platform_integrations", - "tableTo": "kilocode_users", "columnsFrom": [ "owned_by_user_id" ], + "tableTo": "kilocode_users", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, @@ -10920,9 +10914,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": {}, @@ -10930,11 +10924,11 @@ "uniqueConstraints": { "UQ_referral_code_usages_redeeming_user_id_code": { "name": "UQ_referral_code_usages_redeeming_user_id_code", - "nullsNotDistinct": false, "columns": [ "redeeming_kilo_user_id", "referring_kilo_user_id" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -10998,9 +10992,9 @@ } ], "isUnique": true, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_referral_codes_code": { "name": "IDX_referral_codes_code", @@ -11013,9 +11007,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": {}, @@ -11106,10 +11100,10 @@ } ], "isUnique": true, - "where": "\"security_analysis_owner_state\".\"owned_by_organization_id\" is not null", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"security_analysis_owner_state\".\"owned_by_organization_id\" is not null", + "concurrently": false }, "UQ_security_analysis_owner_state_user_owner": { "name": "UQ_security_analysis_owner_state_user_owner", @@ -11122,38 +11116,38 @@ } ], "isUnique": true, - "where": "\"security_analysis_owner_state\".\"owned_by_user_id\" is not null", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"security_analysis_owner_state\".\"owned_by_user_id\" is not null", + "concurrently": false } }, "foreignKeys": { "security_analysis_owner_state_owned_by_organization_id_organizations_id_fk": { "name": "security_analysis_owner_state_owned_by_organization_id_organizations_id_fk", "tableFrom": "security_analysis_owner_state", - "tableTo": "organizations", "columnsFrom": [ "owned_by_organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "security_analysis_owner_state_owned_by_user_id_kilocode_users_id_fk": { "name": "security_analysis_owner_state_owned_by_user_id_kilocode_users_id_fk", "tableFrom": "security_analysis_owner_state", - "tableTo": "kilocode_users", "columnsFrom": [ "owned_by_user_id" ], + "tableTo": "kilocode_users", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, @@ -11295,9 +11289,9 @@ } ], "isUnique": true, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_security_analysis_queue_claim_path_org": { "name": "idx_security_analysis_queue_claim_path_org", @@ -11310,8 +11304,8 @@ }, { "expression": "coalesce(\"next_retry_at\", '-infinity'::timestamptz)", - "asc": true, "isExpression": true, + "asc": true, "nulls": "last" }, { @@ -11334,10 +11328,10 @@ } ], "isUnique": false, - "where": "\"security_analysis_queue\".\"queue_status\" = 'queued'", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"security_analysis_queue\".\"queue_status\" = 'queued'", + "concurrently": false }, "idx_security_analysis_queue_claim_path_user": { "name": "idx_security_analysis_queue_claim_path_user", @@ -11350,8 +11344,8 @@ }, { "expression": "coalesce(\"next_retry_at\", '-infinity'::timestamptz)", - "asc": true, "isExpression": true, + "asc": true, "nulls": "last" }, { @@ -11374,10 +11368,10 @@ } ], "isUnique": false, - "where": "\"security_analysis_queue\".\"queue_status\" = 'queued'", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"security_analysis_queue\".\"queue_status\" = 'queued'", + "concurrently": false }, "idx_security_analysis_queue_in_flight_org": { "name": "idx_security_analysis_queue_in_flight_org", @@ -11408,10 +11402,10 @@ } ], "isUnique": false, - "where": "\"security_analysis_queue\".\"queue_status\" IN ('pending', 'running')", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"security_analysis_queue\".\"queue_status\" IN ('pending', 'running')", + "concurrently": false }, "idx_security_analysis_queue_in_flight_user": { "name": "idx_security_analysis_queue_in_flight_user", @@ -11442,10 +11436,10 @@ } ], "isUnique": false, - "where": "\"security_analysis_queue\".\"queue_status\" IN ('pending', 'running')", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"security_analysis_queue\".\"queue_status\" IN ('pending', 'running')", + "concurrently": false }, "idx_security_analysis_queue_lag_dashboards": { "name": "idx_security_analysis_queue_lag_dashboards", @@ -11458,10 +11452,10 @@ } ], "isUnique": false, - "where": "\"security_analysis_queue\".\"queue_status\" = 'queued'", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"security_analysis_queue\".\"queue_status\" = 'queued'", + "concurrently": false }, "idx_security_analysis_queue_pending_reconciliation": { "name": "idx_security_analysis_queue_pending_reconciliation", @@ -11480,10 +11474,10 @@ } ], "isUnique": false, - "where": "\"security_analysis_queue\".\"queue_status\" = 'pending'", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"security_analysis_queue\".\"queue_status\" = 'pending'", + "concurrently": false }, "idx_security_analysis_queue_running_reconciliation": { "name": "idx_security_analysis_queue_running_reconciliation", @@ -11502,10 +11496,10 @@ } ], "isUnique": false, - "where": "\"security_analysis_queue\".\"queue_status\" = 'running'", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"security_analysis_queue\".\"queue_status\" = 'running'", + "concurrently": false }, "idx_security_analysis_queue_failure_trend": { "name": "idx_security_analysis_queue_failure_trend", @@ -11524,51 +11518,51 @@ } ], "isUnique": false, - "where": "\"security_analysis_queue\".\"failure_code\" IS NOT NULL", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"security_analysis_queue\".\"failure_code\" IS NOT NULL", + "concurrently": false } }, "foreignKeys": { "security_analysis_queue_finding_id_security_findings_id_fk": { "name": "security_analysis_queue_finding_id_security_findings_id_fk", "tableFrom": "security_analysis_queue", - "tableTo": "security_findings", "columnsFrom": [ "finding_id" ], + "tableTo": "security_findings", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "security_analysis_queue_owned_by_organization_id_organizations_id_fk": { "name": "security_analysis_queue_owned_by_organization_id_organizations_id_fk", "tableFrom": "security_analysis_queue", - "tableTo": "organizations", "columnsFrom": [ "owned_by_organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "security_analysis_queue_owned_by_user_id_kilocode_users_id_fk": { "name": "security_analysis_queue_owned_by_user_id_kilocode_users_id_fk", "tableFrom": "security_analysis_queue", - "tableTo": "kilocode_users", "columnsFrom": [ "owned_by_user_id" ], + "tableTo": "kilocode_users", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, @@ -11709,9 +11703,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_security_audit_log_user_created": { "name": "IDX_security_audit_log_user_created", @@ -11730,9 +11724,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_security_audit_log_resource": { "name": "IDX_security_audit_log_resource", @@ -11751,9 +11745,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_security_audit_log_actor": { "name": "IDX_security_audit_log_actor", @@ -11772,9 +11766,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_security_audit_log_action": { "name": "IDX_security_audit_log_action", @@ -11793,37 +11787,37 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "security_audit_log_owned_by_organization_id_organizations_id_fk": { "name": "security_audit_log_owned_by_organization_id_organizations_id_fk", "tableFrom": "security_audit_log", - "tableTo": "organizations", "columnsFrom": [ "owned_by_organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "security_audit_log_owned_by_user_id_kilocode_users_id_fk": { "name": "security_audit_log_owned_by_user_id_kilocode_users_id_fk", "tableFrom": "security_audit_log", - "tableTo": "kilocode_users", "columnsFrom": [ "owned_by_user_id" ], + "tableTo": "kilocode_users", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, @@ -12092,9 +12086,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_security_findings_user_id": { "name": "idx_security_findings_user_id", @@ -12107,9 +12101,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_security_findings_repo": { "name": "idx_security_findings_repo", @@ -12122,9 +12116,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_security_findings_severity": { "name": "idx_security_findings_severity", @@ -12137,9 +12131,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_security_findings_status": { "name": "idx_security_findings_status", @@ -12152,9 +12146,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_security_findings_package": { "name": "idx_security_findings_package", @@ -12167,9 +12161,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_security_findings_sla_due_at": { "name": "idx_security_findings_sla_due_at", @@ -12182,9 +12176,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_security_findings_session_id": { "name": "idx_security_findings_session_id", @@ -12197,9 +12191,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_security_findings_cli_session_id": { "name": "idx_security_findings_cli_session_id", @@ -12212,9 +12206,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_security_findings_analysis_status": { "name": "idx_security_findings_analysis_status", @@ -12227,9 +12221,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_security_findings_org_analysis_in_flight": { "name": "idx_security_findings_org_analysis_in_flight", @@ -12248,10 +12242,10 @@ } ], "isUnique": false, - "where": "\"security_findings\".\"analysis_status\" IN ('pending', 'running')", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"security_findings\".\"analysis_status\" IN ('pending', 'running')", + "concurrently": false }, "idx_security_findings_user_analysis_in_flight": { "name": "idx_security_findings_user_analysis_in_flight", @@ -12270,63 +12264,63 @@ } ], "isUnique": false, - "where": "\"security_findings\".\"analysis_status\" IN ('pending', 'running')", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"security_findings\".\"analysis_status\" IN ('pending', 'running')", + "concurrently": false } }, "foreignKeys": { "security_findings_owned_by_organization_id_organizations_id_fk": { "name": "security_findings_owned_by_organization_id_organizations_id_fk", "tableFrom": "security_findings", - "tableTo": "organizations", "columnsFrom": [ "owned_by_organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "security_findings_owned_by_user_id_kilocode_users_id_fk": { "name": "security_findings_owned_by_user_id_kilocode_users_id_fk", "tableFrom": "security_findings", - "tableTo": "kilocode_users", "columnsFrom": [ "owned_by_user_id" ], + "tableTo": "kilocode_users", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "security_findings_platform_integration_id_platform_integrations_id_fk": { "name": "security_findings_platform_integration_id_platform_integrations_id_fk", "tableFrom": "security_findings", - "tableTo": "platform_integrations", "columnsFrom": [ "platform_integration_id" ], + "tableTo": "platform_integrations", "columnsTo": [ "id" ], - "onDelete": "set null", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "set null" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "uq_security_findings_source": { "name": "uq_security_findings_source", - "nullsNotDistinct": false, "columns": [ "repo_full_name", "source", "source_id" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -12419,9 +12413,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_shared_cli_sessions_created_at": { "name": "IDX_shared_cli_sessions_created_at", @@ -12434,37 +12428,37 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "shared_cli_sessions_session_id_cli_sessions_session_id_fk": { "name": "shared_cli_sessions_session_id_cli_sessions_session_id_fk", "tableFrom": "shared_cli_sessions", - "tableTo": "cli_sessions", "columnsFrom": [ "session_id" ], + "tableTo": "cli_sessions", "columnsTo": [ "session_id" ], - "onDelete": "set null", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "set null" }, "shared_cli_sessions_kilo_user_id_kilocode_users_id_fk": { "name": "shared_cli_sessions_kilo_user_id_kilocode_users_id_fk", "tableFrom": "shared_cli_sessions", - "tableTo": "kilocode_users", "columnsFrom": [ "kilo_user_id" ], + "tableTo": "kilocode_users", "columnsTo": [ "id" ], - "onDelete": "restrict", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "restrict" } }, "compositePrimaryKeys": {}, @@ -12611,9 +12605,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_slack_bot_requests_slack_team_id": { "name": "idx_slack_bot_requests_slack_team_id", @@ -12626,9 +12620,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_slack_bot_requests_owned_by_org_id": { "name": "idx_slack_bot_requests_owned_by_org_id", @@ -12641,9 +12635,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_slack_bot_requests_owned_by_user_id": { "name": "idx_slack_bot_requests_owned_by_user_id", @@ -12656,9 +12650,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_slack_bot_requests_status": { "name": "idx_slack_bot_requests_status", @@ -12671,9 +12665,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_slack_bot_requests_event_type": { "name": "idx_slack_bot_requests_event_type", @@ -12686,9 +12680,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_slack_bot_requests_team_created": { "name": "idx_slack_bot_requests_team_created", @@ -12707,50 +12701,50 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "slack_bot_requests_owned_by_organization_id_organizations_id_fk": { "name": "slack_bot_requests_owned_by_organization_id_organizations_id_fk", "tableFrom": "slack_bot_requests", - "tableTo": "organizations", "columnsFrom": [ "owned_by_organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "slack_bot_requests_owned_by_user_id_kilocode_users_id_fk": { "name": "slack_bot_requests_owned_by_user_id_kilocode_users_id_fk", "tableFrom": "slack_bot_requests", - "tableTo": "kilocode_users", "columnsFrom": [ "owned_by_user_id" ], + "tableTo": "kilocode_users", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "slack_bot_requests_platform_integration_id_platform_integrations_id_fk": { "name": "slack_bot_requests_platform_integration_id_platform_integrations_id_fk", "tableFrom": "slack_bot_requests", - "tableTo": "platform_integrations", "columnsFrom": [ "platform_integration_id" ], + "tableTo": "platform_integrations", "columnsTo": [ "id" ], - "onDelete": "set null", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "set null" } }, "compositePrimaryKeys": {}, @@ -12864,9 +12858,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_source_embeddings_kilo_user_id": { "name": "IDX_source_embeddings_kilo_user_id", @@ -12879,9 +12873,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_source_embeddings_project_id": { "name": "IDX_source_embeddings_project_id", @@ -12894,9 +12888,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_source_embeddings_created_at": { "name": "IDX_source_embeddings_created_at", @@ -12909,9 +12903,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_source_embeddings_updated_at": { "name": "IDX_source_embeddings_updated_at", @@ -12924,24 +12918,24 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_source_embeddings_file_path_lower": { "name": "IDX_source_embeddings_file_path_lower", "columns": [ { "expression": "LOWER(\"file_path\")", - "asc": true, "isExpression": true, + "asc": true, "nulls": "last" } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_source_embeddings_git_branch": { "name": "IDX_source_embeddings_git_branch", @@ -12954,9 +12948,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_source_embeddings_org_project_branch": { "name": "IDX_source_embeddings_org_project_branch", @@ -12981,44 +12975,43 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "source_embeddings_organization_id_organizations_id_fk": { "name": "source_embeddings_organization_id_organizations_id_fk", "tableFrom": "source_embeddings", - "tableTo": "organizations", "columnsFrom": [ "organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "source_embeddings_kilo_user_id_kilocode_users_id_fk": { "name": "source_embeddings_kilo_user_id_kilocode_users_id_fk", "tableFrom": "source_embeddings", - "tableTo": "kilocode_users", "columnsFrom": [ "kilo_user_id" ], + "tableTo": "kilocode_users", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "UQ_source_embeddings_org_project_branch_file_lines": { "name": "UQ_source_embeddings_org_project_branch_file_lines", - "nullsNotDistinct": false, "columns": [ "organization_id", "project_id", @@ -13026,7 +13019,8 @@ "file_path", "start_line", "end_line" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -13192,9 +13186,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_hardware_fingerprint": { "name": "idx_hardware_fingerprint", @@ -13207,9 +13201,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_kilo_user_id": { "name": "idx_kilo_user_id", @@ -13222,9 +13216,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_reasons": { "name": "idx_reasons", @@ -13237,9 +13231,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_verdict_action": { "name": "idx_verdict_action", @@ -13252,9 +13246,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "idx_visitor_fingerprint": { "name": "idx_visitor_fingerprint", @@ -13267,9 +13261,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": {}, @@ -13308,9 +13302,9 @@ } ], "isUnique": true, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": {}, @@ -13369,9 +13363,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_ccbde98c4c14046daa5682ec4f": { "name": "IDX_ccbde98c4c14046daa5682ec4f", @@ -13384,9 +13378,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_d0270eb24ef6442d65a0b7853c": { "name": "IDX_d0270eb24ef6442d65a0b7853c", @@ -13399,9 +13393,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": {}, @@ -13445,12 +13439,6 @@ "primaryKey": false, "notNull": true }, - "display_name": { - "name": "display_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, "hosted_domain": { "name": "hosted_domain", "type": "text", @@ -13477,9 +13465,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_user_auth_provider_hosted_domain": { "name": "IDX_user_auth_provider_hosted_domain", @@ -13492,9 +13480,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": {}, @@ -13582,9 +13570,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_user_feedback_kilo_user_id": { "name": "IDX_user_feedback_kilo_user_id", @@ -13597,9 +13585,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_user_feedback_feedback_for": { "name": "IDX_user_feedback_feedback_for", @@ -13612,9 +13600,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_user_feedback_feedback_batch": { "name": "IDX_user_feedback_feedback_batch", @@ -13627,9 +13615,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_user_feedback_source": { "name": "IDX_user_feedback_source", @@ -13642,24 +13630,24 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "user_feedback_kilo_user_id_kilocode_users_id_fk": { "name": "user_feedback_kilo_user_id_kilocode_users_id_fk", "tableFrom": "user_feedback", - "tableTo": "kilocode_users", "columnsFrom": [ "kilo_user_id" ], + "tableTo": "kilocode_users", "columnsTo": [ "id" ], - "onDelete": "set null", - "onUpdate": "cascade" + "onUpdate": "cascade", + "onDelete": "set null" } }, "compositePrimaryKeys": {}, @@ -13748,9 +13736,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "UQ_user_period_cache": { "name": "UQ_user_period_cache", @@ -13781,9 +13769,9 @@ } ], "isUnique": true, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_user_period_cache_lookup": { "name": "IDX_user_period_cache_lookup", @@ -13808,9 +13796,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "UQ_user_period_cache_share_token": { "name": "UQ_user_period_cache_share_token", @@ -13823,25 +13811,25 @@ } ], "isUnique": true, - "where": "\"user_period_cache\".\"shared_url_token\" IS NOT NULL", - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "where": "\"user_period_cache\".\"shared_url_token\" IS NOT NULL", + "concurrently": false } }, "foreignKeys": { "user_period_cache_kilo_user_id_kilocode_users_id_fk": { "name": "user_period_cache_kilo_user_id_kilocode_users_id_fk", "tableFrom": "user_period_cache", - "tableTo": "kilocode_users", "columnsFrom": [ "kilo_user_id" ], + "tableTo": "kilocode_users", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, @@ -13884,9 +13872,9 @@ } ], "isUnique": true, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": {}, @@ -13925,9 +13913,9 @@ } ], "isUnique": true, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": {}, @@ -14042,9 +14030,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_webhook_events_owned_by_user_id": { "name": "IDX_webhook_events_owned_by_user_id", @@ -14057,9 +14045,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_webhook_events_platform": { "name": "IDX_webhook_events_platform", @@ -14072,9 +14060,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_webhook_events_event_type": { "name": "IDX_webhook_events_event_type", @@ -14087,9 +14075,9 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false }, "IDX_webhook_events_created_at": { "name": "IDX_webhook_events_created_at", @@ -14102,47 +14090,47 @@ } ], "isUnique": false, - "concurrently": false, + "with": {}, "method": "btree", - "with": {} + "concurrently": false } }, "foreignKeys": { "webhook_events_owned_by_organization_id_organizations_id_fk": { "name": "webhook_events_owned_by_organization_id_organizations_id_fk", "tableFrom": "webhook_events", - "tableTo": "organizations", "columnsFrom": [ "owned_by_organization_id" ], + "tableTo": "organizations", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" }, "webhook_events_owned_by_user_id_kilocode_users_id_fk": { "name": "webhook_events_owned_by_user_id_kilocode_users_id_fk", "tableFrom": "webhook_events", - "tableTo": "kilocode_users", "columnsFrom": [ "owned_by_user_id" ], + "tableTo": "kilocode_users", "columnsTo": [ "id" ], - "onDelete": "cascade", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "cascade" } }, "compositePrimaryKeys": {}, "uniqueConstraints": { "UQ_webhook_events_signature": { "name": "UQ_webhook_events_signature", - "nullsNotDistinct": false, "columns": [ "event_signature" - ] + ], + "nullsNotDistinct": false } }, "policies": {}, @@ -14157,11 +14145,10 @@ }, "enums": {}, "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, "views": { "public.microdollar_usage_view": { + "name": "microdollar_usage_view", + "schema": "public", "columns": { "id": { "name": "id", @@ -14459,12 +14446,13 @@ } }, "definition": "\n SELECT\n mu.id,\n mu.kilo_user_id,\n meta.message_id,\n mu.cost,\n mu.input_tokens,\n mu.output_tokens,\n mu.cache_write_tokens,\n mu.cache_hit_tokens,\n mu.created_at,\n ip.http_ip AS http_x_forwarded_for,\n city.vercel_ip_city AS http_x_vercel_ip_city,\n country.vercel_ip_country AS http_x_vercel_ip_country,\n meta.vercel_ip_latitude AS http_x_vercel_ip_latitude,\n meta.vercel_ip_longitude AS http_x_vercel_ip_longitude,\n ja4.ja4_digest AS http_x_vercel_ja4_digest,\n mu.provider,\n mu.model,\n mu.requested_model,\n meta.user_prompt_prefix,\n spp.system_prompt_prefix,\n meta.system_prompt_length,\n ua.http_user_agent,\n mu.cache_discount,\n meta.max_tokens,\n meta.has_middle_out_transform,\n mu.has_error,\n mu.abuse_classification,\n mu.organization_id,\n mu.inference_provider,\n mu.project_id,\n meta.status_code,\n meta.upstream_id,\n frfr.finish_reason,\n meta.latency,\n meta.moderation_latency,\n meta.generation_time,\n meta.is_byok,\n meta.is_user_byok,\n meta.streamed,\n meta.cancelled,\n edit.editor_name,\n ak.api_kind,\n meta.has_tools,\n meta.machine_id,\n feat.feature,\n meta.session_id,\n md.mode,\n am.auto_model,\n meta.market_cost\n FROM \"microdollar_usage\" mu\n LEFT JOIN \"microdollar_usage_metadata\" meta ON mu.id = meta.id\n LEFT JOIN \"http_ip\" ip ON meta.http_ip_id = ip.http_ip_id\n LEFT JOIN \"vercel_ip_city\" city ON meta.vercel_ip_city_id = city.vercel_ip_city_id\n LEFT JOIN \"vercel_ip_country\" country ON meta.vercel_ip_country_id = country.vercel_ip_country_id\n LEFT JOIN \"ja4_digest\" ja4 ON meta.ja4_digest_id = ja4.ja4_digest_id\n LEFT JOIN \"system_prompt_prefix\" spp ON meta.system_prompt_prefix_id = spp.system_prompt_prefix_id\n LEFT JOIN \"http_user_agent\" ua ON meta.http_user_agent_id = ua.http_user_agent_id\n LEFT JOIN \"finish_reason\" frfr ON meta.finish_reason_id = frfr.finish_reason_id\n LEFT JOIN \"editor_name\" edit ON meta.editor_name_id = edit.editor_name_id\n LEFT JOIN \"api_kind\" ak ON meta.api_kind_id = ak.api_kind_id\n LEFT JOIN \"feature\" feat ON meta.feature_id = feat.feature_id\n LEFT JOIN \"mode\" md ON meta.mode_id = md.mode_id\n LEFT JOIN \"auto_model\" am ON meta.auto_model_id = am.auto_model_id\n", - "name": "microdollar_usage_view", - "schema": "public", - "isExisting": false, - "materialized": false + "materialized": false, + "isExisting": false } }, + "sequences": {}, + "roles": {}, + "policies": {}, "_meta": { "columns": {}, "schemas": {}, diff --git a/packages/db/src/migrations/meta/_journal.json b/packages/db/src/migrations/meta/_journal.json index 670993e6f..21366be81 100644 --- a/packages/db/src/migrations/meta/_journal.json +++ b/packages/db/src/migrations/meta/_journal.json @@ -407,13 +407,6 @@ "when": 1774310294000, "tag": "0057_backfill_billing_misclassified", "breakpoints": true - }, - { - "idx": 58, - "version": "7", - "when": 1774277378847, - "tag": "0058_social_connect", - "breakpoints": true } ] } \ No newline at end of file diff --git a/packages/db/src/schema-types.ts b/packages/db/src/schema-types.ts index f79e78b1c..5c12407ba 100644 --- a/packages/db/src/schema-types.ts +++ b/packages/db/src/schema-types.ts @@ -281,7 +281,6 @@ export type AuthProviderId = | 'github' | 'gitlab' | 'linkedin' - | 'discord' | 'fake-login' | 'workos'; diff --git a/packages/db/src/schema.ts b/packages/db/src/schema.ts index 942680542..37a4e458e 100644 --- a/packages/db/src/schema.ts +++ b/packages/db/src/schema.ts @@ -206,7 +206,6 @@ export const kilocode_users = pgTable( completed_welcome_form: boolean().default(false).notNull(), linkedin_url: text(), github_url: text(), - discord_server_membership_verified_at: timestamp({ withTimezone: true, mode: 'string' }), openrouter_upstream_safety_identifier: text(), customer_source: text(), }, @@ -520,7 +519,6 @@ export const user_auth_provider = pgTable( email: text().notNull(), avatar_url: text().notNull(), - display_name: text(), hosted_domain: text(), created_at: timestamp({ withTimezone: true, mode: 'string' }).defaultNow().notNull(), }, diff --git a/src/app/api/cloud-agent/sessions/prepare/route.test.ts b/src/app/api/cloud-agent/sessions/prepare/route.test.ts index 2d62a9511..b25a58d68 100644 --- a/src/app/api/cloud-agent/sessions/prepare/route.test.ts +++ b/src/app/api/cloud-agent/sessions/prepare/route.test.ts @@ -96,7 +96,6 @@ function createMockUser(overrides: Partial = {}): User { completed_welcome_form: false, linkedin_url: null, github_url: null, - discord_server_membership_verified_at: null, openrouter_upstream_safety_identifier: null, customer_source: null, ...overrides, diff --git a/src/components/auth/DiscordLogo.tsx b/src/components/auth/DiscordLogo.tsx deleted file mode 100644 index e5a00fd39..000000000 --- a/src/components/auth/DiscordLogo.tsx +++ /dev/null @@ -1,18 +0,0 @@ -export function DiscordLogo(props: React.SVGProps) { - return ( - - ); -} diff --git a/src/components/profile/DiscordGuildStatus.tsx b/src/components/profile/DiscordGuildStatus.tsx deleted file mode 100644 index 4fd2c24bc..000000000 --- a/src/components/profile/DiscordGuildStatus.tsx +++ /dev/null @@ -1,114 +0,0 @@ -'use client'; - -import { Card, CardContent } from '@/components/ui/card'; -import { Button } from '@/components/ui/button'; -import { CheckCircle2, XCircle, Shield, Loader2 } from 'lucide-react'; -import { useTRPC } from '@/lib/trpc/utils'; -import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query'; -import { format } from 'date-fns'; - -type DiscordGuildStatusProps = { - hasDiscordLinked: boolean; -}; - -export function DiscordGuildStatus({ hasDiscordLinked }: DiscordGuildStatusProps) { - const trpc = useTRPC(); - const queryClient = useQueryClient(); - - const guildStatus = useQuery({ - ...trpc.user.getDiscordGuildStatus.queryOptions(), - enabled: hasDiscordLinked, - }); - - const verifyMutation = useMutation({ - ...trpc.user.verifyDiscordGuildMembership.mutationOptions(), - onSuccess: () => { - void queryClient.invalidateQueries({ - queryKey: trpc.user.getDiscordGuildStatus.queryKey(), - }); - }, - }); - - const data = guildStatus.data; - const isMember = data?.discord_server_membership_verified_at != null; - - return ( - - -
-
- -
- {!hasDiscordLinked && ( -

- Link your Discord account to verify{' '} - - Kilo server - {' '} - membership. -

- )} - - {hasDiscordLinked && guildStatus.isLoading && ( -

Loading Discord status…

- )} - - {hasDiscordLinked && isMember && data.discord_server_membership_verified_at && ( -
- - - Kilo Discord Member - - - · Verified{' '} - {format(new Date(data.discord_server_membership_verified_at), 'MMM d, yyyy')} - -
- )} - - {hasDiscordLinked && guildStatus.isError && ( -

- Unable to load Discord membership status. Please try again later. -

- )} - - {hasDiscordLinked && !isMember && !guildStatus.isLoading && data && ( -
- - - Not a member of the{' '} - - Kilo Discord server - - -
- )} -
-
- - {hasDiscordLinked && !isMember && !guildStatus.isLoading && data && ( - - )} -
-
-
- ); -} diff --git a/src/components/profile/LoginMethodsWrapper.tsx b/src/components/profile/LoginMethodsWrapper.tsx index 19fe683a7..84ac66253 100644 --- a/src/components/profile/LoginMethodsWrapper.tsx +++ b/src/components/profile/LoginMethodsWrapper.tsx @@ -12,7 +12,6 @@ import { Card, CardContent } from '@/components/ui/card'; import { Skeleton } from '@/components/ui/skeleton'; import { AccountLinkedSuccessHeader } from './AccountLinkedSuccessHeader'; import { AuthProviderIdSchema, getProviderById } from '@/lib/auth/provider-metadata'; -import { DiscordGuildStatus } from './DiscordGuildStatus'; type LoginMethodsWrapperProps = { primaryEmail: string; @@ -51,7 +50,6 @@ export function LoginMethodsWrapper({ primaryEmail }: LoginMethodsWrapperProps) }, [searchParams, refetchProviders]); const providers = providersData?.providers || []; - const hasDiscordLinked = providers.some(p => p.provider === 'discord'); if (loading) { return ( @@ -158,8 +156,6 @@ export function LoginMethodsWrapper({ primaryEmail }: LoginMethodsWrapperProps) onError={setErrorMessage} /> - - ); } diff --git a/src/lib/auth/constants.ts b/src/lib/auth/constants.ts index 0a121eb41..900baa3df 100644 --- a/src/lib/auth/constants.ts +++ b/src/lib/auth/constants.ts @@ -17,7 +17,6 @@ export const hosted_domain_specials = { github: '@@github@@', gitlab: '@@gitlab@@', linkedin: '@@linkedin@@', - discord: '@@discord@@', email: '@@email@@', fake_devonly: '@@fake@@', kilocode_admin: 'kilocode.ai', diff --git a/src/lib/auth/provider-metadata.tsx b/src/lib/auth/provider-metadata.tsx index f5f8d8afc..b832dc9e4 100644 --- a/src/lib/auth/provider-metadata.tsx +++ b/src/lib/auth/provider-metadata.tsx @@ -1,4 +1,3 @@ -import { DiscordLogo } from '@/components/auth/DiscordLogo'; import { GitHubLogo } from '@/components/auth/GitHubLogo'; import { GitLabLogo } from '@/components/auth/GitLabLogo'; import { GoogleLogo } from '@/components/auth/GoogleLogo'; @@ -22,7 +21,6 @@ const AllAuthProviders = [ { id: 'github', name: 'GitHub', icon: }, { id: 'gitlab', name: 'GitLab', icon: }, { id: 'linkedin', name: 'LinkedIn', icon: }, - { id: 'discord', name: 'Discord', icon: }, { id: 'fake-login', name: 'Test Account', icon: fakeLoginIcon }, { id: 'workos', name: 'Enterprise SSO', icon: }, ] as const satisfies readonly ProviderMetadata[]; diff --git a/src/lib/config.server.ts b/src/lib/config.server.ts index 9cdf3c467..b762cb003 100644 --- a/src/lib/config.server.ts +++ b/src/lib/config.server.ts @@ -110,18 +110,12 @@ export const SLACK_CLIENT_ID = getEnvVariable('SLACK_CLIENT_ID'); export const SLACK_CLIENT_SECRET = getEnvVariable('SLACK_CLIENT_SECRET'); export const SLACK_SIGNING_SECRET = getEnvVariable('SLACK_SIGNING_SECRET'); -// Discord (bot integration — existing) +// Discord export const DISCORD_CLIENT_ID = getEnvVariable('DISCORD_CLIENT_ID'); export const DISCORD_CLIENT_SECRET = getEnvVariable('DISCORD_CLIENT_SECRET'); export const DISCORD_BOT_TOKEN = getEnvVariable('DISCORD_BOT_TOKEN'); export const DISCORD_PUBLIC_KEY = getEnvVariable('DISCORD_PUBLIC_KEY'); -// Discord (OAuth user-linking app — separate application for auth + guild membership) -export const DISCORD_OAUTH_CLIENT_ID = getEnvVariable('DISCORD_OAUTH_CLIENT_ID'); -export const DISCORD_OAUTH_CLIENT_SECRET = getEnvVariable('DISCORD_OAUTH_CLIENT_SECRET'); -export const DISCORD_OAUTH_BOT_TOKEN = getEnvVariable('DISCORD_OAUTH_BOT_TOKEN'); -export const DISCORD_SERVER_ID = getEnvVariable('DISCORD_SERVER_ID'); - // Posts user feedback into a fixed Slack channel in the Kilo workspace. // Expected to be a Slack Incoming Webhook URL. export const SLACK_USER_FEEDBACK_WEBHOOK_URL = getEnvVariable('SLACK_USER_FEEDBACK_WEBHOOK_URL'); diff --git a/src/lib/integrations/discord-guild-membership.ts b/src/lib/integrations/discord-guild-membership.ts deleted file mode 100644 index 7f0aa3108..000000000 --- a/src/lib/integrations/discord-guild-membership.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { DISCORD_OAUTH_BOT_TOKEN, DISCORD_SERVER_ID } from '@/lib/config.server'; - -/** - * Check if a Discord user is a member of the Kilo Discord server. - * Uses the DISCORD_OAUTH_BOT_TOKEN — the bot from the OAuth app must be invited - * to the Kilo Discord server (no permissions needed, just guild presence). - * - * Returns true if the user is a guild member, false if not (404), and - * throws on unexpected API errors. - */ -export async function checkDiscordGuildMembership(discordUserId: string): Promise { - if (!DISCORD_OAUTH_BOT_TOKEN || !DISCORD_SERVER_ID) { - throw new Error('DISCORD_OAUTH_BOT_TOKEN or DISCORD_SERVER_ID not configured'); - } - - const response = await fetch( - `https://discord.com/api/v10/guilds/${DISCORD_SERVER_ID}/members/${discordUserId}`, - { - headers: { - Authorization: `Bot ${DISCORD_OAUTH_BOT_TOKEN}`, - }, - signal: AbortSignal.timeout(5_000), - } - ); - - if (response.ok) return true; - if (response.status === 404) return false; - - throw new Error(`Discord API error: ${response.status} ${response.statusText}`); -} diff --git a/src/lib/token.test.ts b/src/lib/token.test.ts index 645ea8b4b..7e151c109 100644 --- a/src/lib/token.test.ts +++ b/src/lib/token.test.ts @@ -36,7 +36,6 @@ const mockUser: User = { completed_welcome_form: false, linkedin_url: null, github_url: null, - discord_server_membership_verified_at: null, openrouter_upstream_safety_identifier: null, customer_source: null, }; diff --git a/src/lib/user.server.ts b/src/lib/user.server.ts index 77e33c345..1024ab5f8 100644 --- a/src/lib/user.server.ts +++ b/src/lib/user.server.ts @@ -21,7 +21,6 @@ import GoogleProvider from 'next-auth/providers/google'; import GithubProvider from 'next-auth/providers/github'; import GitlabProvider from 'next-auth/providers/gitlab'; import LinkedInProvider from 'next-auth/providers/linkedin'; -import DiscordProvider from 'next-auth/providers/discord'; import WorkOSProvider from 'next-auth/providers/workos'; import CredentialsProvider from 'next-auth/providers/credentials'; import { allow_fake_login, ORGANIZATION_ID_HEADER } from './constants'; @@ -33,7 +32,6 @@ import { secondsInDay } from 'date-fns/constants'; import type { AdapterUser } from 'next-auth/adapters'; import assert from 'node:assert'; import type { Organization, User } from '@kilocode/db/schema'; -import type { AuthProviderId } from '@kilocode/db/schema-types'; import PostHogClient from '@/lib/posthog'; import { captureException } from '@sentry/nextjs'; import { @@ -60,8 +58,6 @@ import { NEXTAUTH_SECRET, GITLAB_CLIENT_ID, GITLAB_CLIENT_SECRET, - DISCORD_OAUTH_CLIENT_ID, - DISCORD_OAUTH_CLIENT_SECRET, BLACKLIST_TLDS, } from '@/lib/config.server'; import jwt from 'jsonwebtoken'; @@ -165,24 +161,6 @@ function createLinkedInAccountInfo( }; } -function createDiscordAccountInfo( - account: Account, - user: NextUser | AdapterUser -): CreateOrUpdateUserArgs | null { - if (account.provider !== 'discord') return null; - if (!user.email) return null; - - return { - google_user_email: user.email, - google_user_name: user.name || '', - hosted_domain: hosted_domain_specials.discord, - google_user_image_url: user.image || '', - provider: account.provider as AuthProviderId, - provider_account_id: account.providerAccountId, - display_name: user.name || null, - }; -} - function createFakeAccountInfo( account: Account, user: NextUser | AdapterUser @@ -274,7 +252,6 @@ function createAccountInfo( createGitHubAccountInfo(account, user) ?? createGitlabAccountInfo(account, user) ?? createLinkedInAccountInfo(account, user) ?? - createDiscordAccountInfo(account, user) ?? createEmailAccountInfo(account, user) ?? createFakeAccountInfo(account, user) ?? createSSOAccountInfo(account, user, profile); @@ -312,10 +289,6 @@ const authOptions: NextAuthOptions = { clientId: GITLAB_CLIENT_ID, clientSecret: GITLAB_CLIENT_SECRET, }), - DiscordProvider({ - clientId: DISCORD_OAUTH_CLIENT_ID ?? '', - clientSecret: DISCORD_OAUTH_CLIENT_SECRET ?? '', - }), LinkedInProvider({ clientId: LINKEDIN_CLIENT_ID, clientSecret: LINKEDIN_CLIENT_SECRET, diff --git a/src/lib/user.test.ts b/src/lib/user.test.ts index fdda37ca0..39dd022a5 100644 --- a/src/lib/user.test.ts +++ b/src/lib/user.test.ts @@ -104,7 +104,6 @@ describe('User', () => { expect(softDeleted!.hosted_domain).toBeNull(); expect(softDeleted!.linkedin_url).toBeNull(); expect(softDeleted!.github_url).toBeNull(); - expect(softDeleted!.discord_server_membership_verified_at).toBeNull(); expect(softDeleted!.openrouter_upstream_safety_identifier).toBeNull(); expect(softDeleted!.customer_source).toBeNull(); expect(softDeleted!.api_token_pepper).toBeNull(); diff --git a/src/lib/user.ts b/src/lib/user.ts index c454ebc97..103dd029c 100644 --- a/src/lib/user.ts +++ b/src/lib/user.ts @@ -64,7 +64,6 @@ import type { OptionalError, Result } from '@/lib/maybe-result'; import { failureResult, successResult, trpcFailure } from '@/lib/maybe-result'; import type { TRPCError } from '@trpc/server'; import type { UUID } from 'node:crypto'; -import { checkDiscordGuildMembership } from '@/lib/integrations/discord-guild-membership'; import type { AuthProviderId } from '@/lib/auth/provider-metadata'; import { generateOpenRouterUpstreamSafetyIdentifier } from '@/lib/providerHash'; @@ -127,7 +126,6 @@ export type CreateOrUpdateUserArgs = { hosted_domain: string | null; provider: AuthProviderId; provider_account_id: string; - display_name?: string | null; }; export async function findAndSyncExistingUser(args: CreateOrUpdateUserArgs) { @@ -312,7 +310,6 @@ export async function createOrUpdateUser( provider_account_id: args.provider_account_id, avatar_url: args.google_user_image_url, email: args.google_user_email, - display_name: args.display_name ?? null, hosted_domain: args.hosted_domain, }); @@ -347,8 +344,6 @@ export async function createOrUpdateUser( // Set up user identification via user ID posthogClient.alias({ distinctId: savedUser.google_user_email, alias: savedUser.id }); - await tryVerifyDiscordGuildMembership(args.provider, args.provider_account_id, savedUser.id); - return successResult({ user: savedUser, isNew: true }); } @@ -367,7 +362,6 @@ export async function linkAccountToExistingUser( provider_account_id: authProviderData.provider_account_id, email: authProviderData.google_user_email, avatar_url: authProviderData.google_user_image_url, - display_name: authProviderData.display_name ?? null, hosted_domain: authProviderData.hosted_domain, }); @@ -388,12 +382,6 @@ export async function linkAccountToExistingUser( return linkResult; } - await tryVerifyDiscordGuildMembership( - authProviderData.provider, - authProviderData.provider_account_id, - existingKiloUserId - ); - // Log the account linking event posthogClient.capture({ distinctId: existingUser.google_user_email, @@ -517,7 +505,6 @@ export async function softDeleteUser(userId: string) { hosted_domain: null, linkedin_url: null, github_url: null, - discord_server_membership_verified_at: null, api_token_pepper: null, default_model: null, blocked_reason: `soft-deleted at ${new Date().toISOString()}`, @@ -826,28 +813,6 @@ export async function linkAuthProviderToUser( return successResult(); } -async function tryVerifyDiscordGuildMembership( - provider: AuthProviderId, - providerAccountId: string, - kiloUserId: string -) { - if (provider !== 'discord') return; - try { - const isMember = await checkDiscordGuildMembership(providerAccountId); - if (isMember) { - await db - .update(kilocode_users) - .set({ discord_server_membership_verified_at: new Date().toISOString() }) - .where(eq(kilocode_users.id, kiloUserId)); - } - } catch (error) { - captureException(error, { - tags: { operation: 'discord_server_membership_verification' }, - extra: { kiloUserId }, - }); - } -} - export async function unlinkAuthProviderFromUser( kiloUserId: string, provider: AuthProviderId @@ -878,13 +843,5 @@ export async function unlinkAuthProviderFromUser( ) ); - // Clear Discord guild membership verification when unlinking Discord - if (provider === 'discord') { - await db - .update(kilocode_users) - .set({ discord_server_membership_verified_at: null }) - .where(eq(kilocode_users.id, kiloUserId)); - } - return successResult(); } diff --git a/src/routers/user-router.ts b/src/routers/user-router.ts index 1b6cdd06c..8da831464 100644 --- a/src/routers/user-router.ts +++ b/src/routers/user-router.ts @@ -2,7 +2,6 @@ import { baseProcedure, createTRPCRouter } from '@/lib/trpc/init'; import { getUserAuthProviders, unlinkAuthProviderFromUser } from '@/lib/user'; import { createAccountLinkingSession } from '@/lib/account-linking-session'; import { TRPCError } from '@trpc/server'; -import { captureException } from '@sentry/nextjs'; import * as z from 'zod'; import { assertNoTrpcError, successResult } from '@/lib/maybe-result'; import { db, readDb } from '@/lib/drizzle'; @@ -12,11 +11,9 @@ import { microdollar_usage, credit_transactions, auto_top_up_configs, - user_auth_provider, } from '@kilocode/db/schema'; import { eq, and, isNull, sql } from 'drizzle-orm'; import crypto from 'crypto'; -import { checkDiscordGuildMembership } from '@/lib/integrations/discord-guild-membership'; import { AuthProviderIdSchema } from '@/lib/auth/provider-metadata'; import { AUTOCOMPLETE_MODEL } from '@/lib/constants'; import { ensureOrganizationAccess } from '@/routers/organizations/utils'; @@ -349,63 +346,4 @@ export const userRouter = createTRPCRouter({ return successResult(); }), - - getDiscordGuildStatus: baseProcedure.query(async ({ ctx }) => { - const discordProvider = await db.query.user_auth_provider.findFirst({ - where: and( - eq(user_auth_provider.kilo_user_id, ctx.user.id), - eq(user_auth_provider.provider, 'discord') - ), - }); - - const user = await db.query.kilocode_users.findFirst({ - where: eq(kilocode_users.id, ctx.user.id), - columns: { - discord_server_membership_verified_at: true, - }, - }); - - return successResult({ - linked: !!discordProvider, - discord_avatar_url: discordProvider?.avatar_url ?? null, - discord_display_name: discordProvider?.display_name ?? null, - discord_server_membership_verified_at: user?.discord_server_membership_verified_at ?? null, - }); - }), - - verifyDiscordGuildMembership: baseProcedure.mutation(async ({ ctx }) => { - const discordProvider = await db.query.user_auth_provider.findFirst({ - where: and( - eq(user_auth_provider.kilo_user_id, ctx.user.id), - eq(user_auth_provider.provider, 'discord') - ), - }); - - if (!discordProvider) { - throw new TRPCError({ - code: 'BAD_REQUEST', - message: 'No Discord account linked. Please connect your Discord account first.', - }); - } - - let isMember: boolean; - try { - isMember = await checkDiscordGuildMembership(discordProvider.provider_account_id); - } catch (error) { - captureException(error); - throw new TRPCError({ - code: 'INTERNAL_SERVER_ERROR', - message: 'Failed to verify Discord guild membership. Please try again later.', - }); - } - - await db - .update(kilocode_users) - .set({ - discord_server_membership_verified_at: isMember ? new Date().toISOString() : null, - }) - .where(eq(kilocode_users.id, ctx.user.id)); - - return successResult({ is_member: isMember }); - }), }); diff --git a/src/tests/account-verification-redirect.test.ts b/src/tests/account-verification-redirect.test.ts index 427ce9df0..0f8b6062c 100644 --- a/src/tests/account-verification-redirect.test.ts +++ b/src/tests/account-verification-redirect.test.ts @@ -90,7 +90,6 @@ function makeUser(overrides: Partial = {}): User { completed_welcome_form: false, linkedin_url: null, github_url: null, - discord_server_membership_verified_at: null, openrouter_upstream_safety_identifier: null, customer_source: null, ...overrides, diff --git a/src/tests/helpers/user.helper.ts b/src/tests/helpers/user.helper.ts index 5c3b4e206..a63aec3f5 100644 --- a/src/tests/helpers/user.helper.ts +++ b/src/tests/helpers/user.helper.ts @@ -32,7 +32,6 @@ export function defineTestUser(userData: Partial = {}): User { completed_welcome_form: false, linkedin_url: null, github_url: null, - discord_server_membership_verified_at: null, openrouter_upstream_safety_identifier: null, customer_source: null, ...userData, diff --git a/src/tests/multi-auth.test.ts b/src/tests/multi-auth.test.ts index 6aa892160..74e8125d9 100644 --- a/src/tests/multi-auth.test.ts +++ b/src/tests/multi-auth.test.ts @@ -56,7 +56,6 @@ describe('Multi-Auth System', () => { provider_account_id: 'github-123', email: 'test@example.com', avatar_url: 'https://example.com/avatar.jpg', - display_name: null, hosted_domain: null, }); @@ -79,7 +78,6 @@ describe('Multi-Auth System', () => { provider_account_id: 'google-456', email: 'test2@example.com', avatar_url: 'https://example.com/avatar2.jpg', - display_name: null, hosted_domain: null, }); @@ -101,7 +99,6 @@ describe('Multi-Auth System', () => { provider_account_id: testUserGoogleProviderId, // Same as original user email: 'test3@example.com', avatar_url: 'https://example.com/avatar3.jpg', - display_name: null, hosted_domain: null, }); @@ -128,7 +125,6 @@ describe('Multi-Auth System', () => { provider_account_id: 'github-123', email: 'test@example.com', avatar_url: 'https://example.com/avatar.jpg', - display_name: null, hosted_domain: null, }); });