UniqueChatFileLinksFileIDKeyUniqueConstraint="chat_file_links_file_id_key"// ALTER TABLE ONLY chat_file_links ADD CONSTRAINT chat_file_links_file_id_key UNIQUE (file_id);
UniqueChatFilesPkeyUniqueConstraint="chat_files_pkey"// ALTER TABLE ONLY chat_files ADD CONSTRAINT chat_files_pkey PRIMARY KEY (id);
UniqueChatHeartbeatsPkeyUniqueConstraint="chat_heartbeats_pkey"// ALTER TABLE ONLY chat_heartbeats ADD CONSTRAINT chat_heartbeats_pkey PRIMARY KEY (chat_id, runner_id);
UniqueChatMessagesPkeyUniqueConstraint="chat_messages_pkey"// ALTER TABLE ONLY chat_messages ADD CONSTRAINT chat_messages_pkey PRIMARY KEY (id);
UniqueChatModelConfigsOrganizationIDIDKeyUniqueConstraint="chat_model_configs_organization_id_id_key"// ALTER TABLE ONLY chat_model_configs ADD CONSTRAINT chat_model_configs_organization_id_id_key UNIQUE (organization_id, id);
UniqueChatModelConfigsPkeyUniqueConstraint="chat_model_configs_pkey"// ALTER TABLE ONLY chat_model_configs ADD CONSTRAINT chat_model_configs_pkey PRIMARY KEY (id);
UniqueChatOrganizationModelOverridesOrganizationIDContextKeyUniqueConstraint="chat_organization_model_overrides_organization_id_context_key"// ALTER TABLE ONLY chat_organization_model_overrides ADD CONSTRAINT chat_organization_model_overrides_organization_id_context_key UNIQUE (organization_id, context);
UniqueChatOrganizationModelOverridesPkeyUniqueConstraint="chat_organization_model_overrides_pkey"// ALTER TABLE ONLY chat_organization_model_overrides ADD CONSTRAINT chat_organization_model_overrides_pkey PRIMARY KEY (id);
UniqueChatQueuedMessagesPkeyUniqueConstraint="chat_queued_messages_pkey"// ALTER TABLE ONLY chat_queued_messages ADD CONSTRAINT chat_queued_messages_pkey PRIMARY KEY (id);
UniqueChatUsageLimitConfigPkeyUniqueConstraint="chat_usage_limit_config_pkey"// ALTER TABLE ONLY chat_usage_limit_config ADD CONSTRAINT chat_usage_limit_config_pkey PRIMARY KEY (id);
UniqueChatUsageLimitConfigSingletonKeyUniqueConstraint="chat_usage_limit_config_singleton_key"// ALTER TABLE ONLY chat_usage_limit_config ADD CONSTRAINT chat_usage_limit_config_singleton_key UNIQUE (singleton);
UniqueChatUserModelOverridesPkeyUniqueConstraint="chat_user_model_overrides_pkey"// ALTER TABLE ONLY chat_user_model_overrides ADD CONSTRAINT chat_user_model_overrides_pkey PRIMARY KEY (id);
UniqueChatUserModelOverridesUserOrganizationContextKeyUniqueConstraint="chat_user_model_overrides_user_organization_context_key"// ALTER TABLE ONLY chat_user_model_overrides ADD CONSTRAINT chat_user_model_overrides_user_organization_context_key UNIQUE (user_id, organization_id, context);
UniqueChatsPkeyUniqueConstraint="chats_pkey"// ALTER TABLE ONLY chats ADD CONSTRAINT chats_pkey PRIMARY KEY (id);
UniqueConnectionLogsPkeyUniqueConstraint="connection_logs_pkey"// ALTER TABLE ONLY connection_logs ADD CONSTRAINT connection_logs_pkey PRIMARY KEY (id);
UniqueCryptoKeysPkeyUniqueConstraint="crypto_keys_pkey"// ALTER TABLE ONLY crypto_keys ADD CONSTRAINT crypto_keys_pkey PRIMARY KEY (feature, sequence);
UniqueCustomRolesUniqueKeyUniqueConstraint="custom_roles_unique_key"// ALTER TABLE ONLY custom_roles ADD CONSTRAINT custom_roles_unique_key UNIQUE (name, organization_id);
UniqueDbcryptKeysActiveKeyDigestKeyUniqueConstraint="dbcrypt_keys_active_key_digest_key"// ALTER TABLE ONLY dbcrypt_keys ADD CONSTRAINT dbcrypt_keys_active_key_digest_key UNIQUE (active_key_digest);
UniqueDbcryptKeysPkeyUniqueConstraint="dbcrypt_keys_pkey"// ALTER TABLE ONLY dbcrypt_keys ADD CONSTRAINT dbcrypt_keys_pkey PRIMARY KEY (number);
UniqueDbcryptKeysRevokedKeyDigestKeyUniqueConstraint="dbcrypt_keys_revoked_key_digest_key"// ALTER TABLE ONLY dbcrypt_keys ADD CONSTRAINT dbcrypt_keys_revoked_key_digest_key UNIQUE (revoked_key_digest);
UniqueFilesHashCreatedByKeyUniqueConstraint="files_hash_created_by_key"// ALTER TABLE ONLY files ADD CONSTRAINT files_hash_created_by_key UNIQUE (hash, created_by);
UniqueFilesPkeyUniqueConstraint="files_pkey"// ALTER TABLE ONLY files ADD CONSTRAINT files_pkey PRIMARY KEY (id);
UniqueGitAuthLinksProviderIDUserIDKeyUniqueConstraint="git_auth_links_provider_id_user_id_key"// ALTER TABLE ONLY external_auth_links ADD CONSTRAINT git_auth_links_provider_id_user_id_key UNIQUE (provider_id, user_id);
UniqueGitSSHKeysPkeyUniqueConstraint="gitsshkeys_pkey"// ALTER TABLE ONLY gitsshkeys ADD CONSTRAINT gitsshkeys_pkey PRIMARY KEY (user_id);
UniqueGroupAIBudgetsPkeyUniqueConstraint="group_ai_budgets_pkey"// ALTER TABLE ONLY group_ai_budgets ADD CONSTRAINT group_ai_budgets_pkey PRIMARY KEY (group_id);
UniqueGroupMembersUserIDGroupIDKeyUniqueConstraint="group_members_user_id_group_id_key"// ALTER TABLE ONLY group_members ADD CONSTRAINT group_members_user_id_group_id_key UNIQUE (user_id, group_id);
UniqueGroupsNameOrganizationIDKeyUniqueConstraint="groups_name_organization_id_key"// ALTER TABLE ONLY groups ADD CONSTRAINT groups_name_organization_id_key UNIQUE (name, organization_id);
UniqueGroupsPkeyUniqueConstraint="groups_pkey"// ALTER TABLE ONLY groups ADD CONSTRAINT groups_pkey PRIMARY KEY (id);
UniqueInboxNotificationsPkeyUniqueConstraint="inbox_notifications_pkey"// ALTER TABLE ONLY inbox_notifications ADD CONSTRAINT inbox_notifications_pkey PRIMARY KEY (id);
UniqueJfrogXrayScansPkeyUniqueConstraint="jfrog_xray_scans_pkey"// ALTER TABLE ONLY jfrog_xray_scans ADD CONSTRAINT jfrog_xray_scans_pkey PRIMARY KEY (agent_id, workspace_id);
UniqueLicensesJWTKeyUniqueConstraint="licenses_jwt_key"// ALTER TABLE ONLY licenses ADD CONSTRAINT licenses_jwt_key UNIQUE (jwt);
UniqueLicensesPkeyUniqueConstraint="licenses_pkey"// ALTER TABLE ONLY licenses ADD CONSTRAINT licenses_pkey PRIMARY KEY (id);
UniqueMcpServerConfigsOrganizationIDSlugKeyUniqueConstraint="mcp_server_configs_organization_id_slug_key"// ALTER TABLE ONLY mcp_server_configs ADD CONSTRAINT mcp_server_configs_organization_id_slug_key UNIQUE (organization_id, slug);
UniqueMcpServerConfigsPkeyUniqueConstraint="mcp_server_configs_pkey"// ALTER TABLE ONLY mcp_server_configs ADD CONSTRAINT mcp_server_configs_pkey PRIMARY KEY (id);
UniqueMcpServerUserTokensMcpServerConfigIDUserIDKeyUniqueConstraint="mcp_server_user_tokens_mcp_server_config_id_user_id_key"// ALTER TABLE ONLY mcp_server_user_tokens ADD CONSTRAINT mcp_server_user_tokens_mcp_server_config_id_user_id_key UNIQUE (mcp_server_config_id, user_id);
UniqueMcpServerUserTokensPkeyUniqueConstraint="mcp_server_user_tokens_pkey"// ALTER TABLE ONLY mcp_server_user_tokens ADD CONSTRAINT mcp_server_user_tokens_pkey PRIMARY KEY (id);
UniqueNotificationMessagesPkeyUniqueConstraint="notification_messages_pkey"// ALTER TABLE ONLY notification_messages ADD CONSTRAINT notification_messages_pkey PRIMARY KEY (id);
UniqueNotificationPreferencesPkeyUniqueConstraint="notification_preferences_pkey"// ALTER TABLE ONLY notification_preferences ADD CONSTRAINT notification_preferences_pkey PRIMARY KEY (user_id, notification_template_id);
UniqueNotificationReportGeneratorLogsPkeyUniqueConstraint="notification_report_generator_logs_pkey"// ALTER TABLE ONLY notification_report_generator_logs ADD CONSTRAINT notification_report_generator_logs_pkey PRIMARY KEY (notification_template_id);
UniqueNotificationTemplatesNameKeyUniqueConstraint="notification_templates_name_key"// ALTER TABLE ONLY notification_templates ADD CONSTRAINT notification_templates_name_key UNIQUE (name);
UniqueNotificationTemplatesPkeyUniqueConstraint="notification_templates_pkey"// ALTER TABLE ONLY notification_templates ADD CONSTRAINT notification_templates_pkey PRIMARY KEY (id);
UniqueOauth2ProviderAppCodesPkeyUniqueConstraint="oauth2_provider_app_codes_pkey"// ALTER TABLE ONLY oauth2_provider_app_codes ADD CONSTRAINT oauth2_provider_app_codes_pkey PRIMARY KEY (id);
UniqueOauth2ProviderAppCodesSecretPrefixKeyUniqueConstraint="oauth2_provider_app_codes_secret_prefix_key"// ALTER TABLE ONLY oauth2_provider_app_codes ADD CONSTRAINT oauth2_provider_app_codes_secret_prefix_key UNIQUE (secret_prefix);
UniqueOauth2ProviderAppSecretsPkeyUniqueConstraint="oauth2_provider_app_secrets_pkey"// ALTER TABLE ONLY oauth2_provider_app_secrets ADD CONSTRAINT oauth2_provider_app_secrets_pkey PRIMARY KEY (id);
UniqueOauth2ProviderAppSecretsSecretPrefixKeyUniqueConstraint="oauth2_provider_app_secrets_secret_prefix_key"// ALTER TABLE ONLY oauth2_provider_app_secrets ADD CONSTRAINT oauth2_provider_app_secrets_secret_prefix_key UNIQUE (secret_prefix);
UniqueOauth2ProviderAppTokensHashPrefixKeyUniqueConstraint="oauth2_provider_app_tokens_hash_prefix_key"// ALTER TABLE ONLY oauth2_provider_app_tokens ADD CONSTRAINT oauth2_provider_app_tokens_hash_prefix_key UNIQUE (hash_prefix);
UniqueOauth2ProviderAppTokensPkeyUniqueConstraint="oauth2_provider_app_tokens_pkey"// ALTER TABLE ONLY oauth2_provider_app_tokens ADD CONSTRAINT oauth2_provider_app_tokens_pkey PRIMARY KEY (id);
UniqueOauth2ProviderAppsPkeyUniqueConstraint="oauth2_provider_apps_pkey"// ALTER TABLE ONLY oauth2_provider_apps ADD CONSTRAINT oauth2_provider_apps_pkey PRIMARY KEY (id);
UniqueOrganizationMembersPkeyUniqueConstraint="organization_members_pkey"// ALTER TABLE ONLY organization_members ADD CONSTRAINT organization_members_pkey PRIMARY KEY (organization_id, user_id);
UniqueOrganizationsPkeyUniqueConstraint="organizations_pkey"// ALTER TABLE ONLY organizations ADD CONSTRAINT organizations_pkey PRIMARY KEY (id);
UniqueParameterSchemasJobIDNameKeyUniqueConstraint="parameter_schemas_job_id_name_key"// ALTER TABLE ONLY parameter_schemas ADD CONSTRAINT parameter_schemas_job_id_name_key UNIQUE (job_id, name);
UniqueParameterSchemasPkeyUniqueConstraint="parameter_schemas_pkey"// ALTER TABLE ONLY parameter_schemas ADD CONSTRAINT parameter_schemas_pkey PRIMARY KEY (id);
UniqueParameterValuesPkeyUniqueConstraint="parameter_values_pkey"// ALTER TABLE ONLY parameter_values ADD CONSTRAINT parameter_values_pkey PRIMARY KEY (id);
UniqueParameterValuesScopeIDNameKeyUniqueConstraint="parameter_values_scope_id_name_key"// ALTER TABLE ONLY parameter_values ADD CONSTRAINT parameter_values_scope_id_name_key UNIQUE (scope_id, name);
UniqueProvisionerDaemonsPkeyUniqueConstraint="provisioner_daemons_pkey"// ALTER TABLE ONLY provisioner_daemons ADD CONSTRAINT provisioner_daemons_pkey PRIMARY KEY (id);
UniqueProvisionerJobLogsPkeyUniqueConstraint="provisioner_job_logs_pkey"// ALTER TABLE ONLY provisioner_job_logs ADD CONSTRAINT provisioner_job_logs_pkey PRIMARY KEY (id);
UniqueProvisionerJobsPkeyUniqueConstraint="provisioner_jobs_pkey"// ALTER TABLE ONLY provisioner_jobs ADD CONSTRAINT provisioner_jobs_pkey PRIMARY KEY (id);
UniqueProvisionerKeysPkeyUniqueConstraint="provisioner_keys_pkey"// ALTER TABLE ONLY provisioner_keys ADD CONSTRAINT provisioner_keys_pkey PRIMARY KEY (id);
UniqueSiteConfigsKeyKeyUniqueConstraint="site_configs_key_key"// ALTER TABLE ONLY site_configs ADD CONSTRAINT site_configs_key_key UNIQUE (key);
UniqueTailnetCoordinatorsPkeyUniqueConstraint="tailnet_coordinators_pkey"// ALTER TABLE ONLY tailnet_coordinators ADD CONSTRAINT tailnet_coordinators_pkey PRIMARY KEY (id);
UniqueTailnetPeersPkeyUniqueConstraint="tailnet_peers_pkey"// ALTER TABLE ONLY tailnet_peers ADD CONSTRAINT tailnet_peers_pkey PRIMARY KEY (id, coordinator_id);
UniqueTailnetTunnelsPkeyUniqueConstraint="tailnet_tunnels_pkey"// ALTER TABLE ONLY tailnet_tunnels ADD CONSTRAINT tailnet_tunnels_pkey PRIMARY KEY (coordinator_id, src_id, dst_id);
UniqueTaskSnapshotsPkeyUniqueConstraint="task_snapshots_pkey"// ALTER TABLE ONLY task_snapshots ADD CONSTRAINT task_snapshots_pkey PRIMARY KEY (task_id);
UniqueTaskWorkspaceAppsPkeyUniqueConstraint="task_workspace_apps_pkey"// ALTER TABLE ONLY task_workspace_apps ADD CONSTRAINT task_workspace_apps_pkey PRIMARY KEY (task_id, workspace_build_number);
UniqueTasksPkeyUniqueConstraint="tasks_pkey"// ALTER TABLE ONLY tasks ADD CONSTRAINT tasks_pkey PRIMARY KEY (id);
UniqueTelemetryItemsPkeyUniqueConstraint="telemetry_items_pkey"// ALTER TABLE ONLY telemetry_items ADD CONSTRAINT telemetry_items_pkey PRIMARY KEY (key);
UniqueTelemetryLocksPkeyUniqueConstraint="telemetry_locks_pkey"// ALTER TABLE ONLY telemetry_locks ADD CONSTRAINT telemetry_locks_pkey PRIMARY KEY (event_type, period_ending_at);
UniqueTemplateUsageStatsPkeyUniqueConstraint="template_usage_stats_pkey"// ALTER TABLE ONLY template_usage_stats ADD CONSTRAINT template_usage_stats_pkey PRIMARY KEY (start_time, template_id, user_id);
UniqueTemplateVersionParametersTemplateVersionIDNameKeyUniqueConstraint="template_version_parameters_template_version_id_name_key"// ALTER TABLE ONLY template_version_parameters ADD CONSTRAINT template_version_parameters_template_version_id_name_key UNIQUE (template_version_id, name);
UniqueTemplateVersionPresetParametersPkeyUniqueConstraint="template_version_preset_parameters_pkey"// ALTER TABLE ONLY template_version_preset_parameters ADD CONSTRAINT template_version_preset_parameters_pkey PRIMARY KEY (id);
UniqueTemplateVersionPresetPrebuildSchedulesPkeyUniqueConstraint="template_version_preset_prebuild_schedules_pkey"// ALTER TABLE ONLY template_version_preset_prebuild_schedules ADD CONSTRAINT template_version_preset_prebuild_schedules_pkey PRIMARY KEY (id);
UniqueTemplateVersionPresetsIDTemplateVersionIDKeyUniqueConstraint="template_version_presets_id_template_version_id_key"// ALTER TABLE ONLY template_version_presets ADD CONSTRAINT template_version_presets_id_template_version_id_key UNIQUE (id, template_version_id);
UniqueTemplateVersionPresetsPkeyUniqueConstraint="template_version_presets_pkey"// ALTER TABLE ONLY template_version_presets ADD CONSTRAINT template_version_presets_pkey PRIMARY KEY (id);
UniqueTemplateVersionTerraformValuesTemplateVersionIDKeyUniqueConstraint="template_version_terraform_values_template_version_id_key"// ALTER TABLE ONLY template_version_terraform_values ADD CONSTRAINT template_version_terraform_values_template_version_id_key UNIQUE (template_version_id);
UniqueTemplateVersionVariablesTemplateVersionIDNameKeyUniqueConstraint="template_version_variables_template_version_id_name_key"// ALTER TABLE ONLY template_version_variables ADD CONSTRAINT template_version_variables_template_version_id_name_key UNIQUE (template_version_id, name);
UniqueTemplateVersionWorkspaceTagsTemplateVersionIDKeyKeyUniqueConstraint="template_version_workspace_tags_template_version_id_key_key"// ALTER TABLE ONLY template_version_workspace_tags ADD CONSTRAINT template_version_workspace_tags_template_version_id_key_key UNIQUE (template_version_id, key);
UniqueTemplateVersionsPkeyUniqueConstraint="template_versions_pkey"// ALTER TABLE ONLY template_versions ADD CONSTRAINT template_versions_pkey PRIMARY KEY (id);
UniqueTemplateVersionsTemplateIDNameKeyUniqueConstraint="template_versions_template_id_name_key"// ALTER TABLE ONLY template_versions ADD CONSTRAINT template_versions_template_id_name_key UNIQUE (template_id, name);
UniqueTemplatesPkeyUniqueConstraint="templates_pkey"// ALTER TABLE ONLY templates ADD CONSTRAINT templates_pkey PRIMARY KEY (id);
UniqueUsageEventsDailyPkeyUniqueConstraint="usage_events_daily_pkey"// ALTER TABLE ONLY usage_events_daily ADD CONSTRAINT usage_events_daily_pkey PRIMARY KEY (day, event_type);
UniqueUsageEventsPkeyUniqueConstraint="usage_events_pkey"// ALTER TABLE ONLY usage_events ADD CONSTRAINT usage_events_pkey PRIMARY KEY (id);
UniqueUserAIBudgetOverridesPkeyUniqueConstraint="user_ai_budget_overrides_pkey"// ALTER TABLE ONLY user_ai_budget_overrides ADD CONSTRAINT user_ai_budget_overrides_pkey PRIMARY KEY (user_id);
UniqueUserAIProviderKeysPkeyUniqueConstraint="user_ai_provider_keys_pkey"// ALTER TABLE ONLY user_ai_provider_keys ADD CONSTRAINT user_ai_provider_keys_pkey PRIMARY KEY (id);
UniqueUserAIProviderKeysUserIDAIProviderIDKeyUniqueConstraint="user_ai_provider_keys_user_id_ai_provider_id_key"// ALTER TABLE ONLY user_ai_provider_keys ADD CONSTRAINT user_ai_provider_keys_user_id_ai_provider_id_key UNIQUE (user_id, ai_provider_id);
UniqueUserConfigsPkeyUniqueConstraint="user_configs_pkey"// ALTER TABLE ONLY user_configs ADD CONSTRAINT user_configs_pkey PRIMARY KEY (user_id, key);
UniqueUserDeletedPkeyUniqueConstraint="user_deleted_pkey"// ALTER TABLE ONLY user_deleted ADD CONSTRAINT user_deleted_pkey PRIMARY KEY (id);
UniqueUserLinksPkeyUniqueConstraint="user_links_pkey"// ALTER TABLE ONLY user_links ADD CONSTRAINT user_links_pkey PRIMARY KEY (user_id, login_type);
UniqueUserSecretsPkeyUniqueConstraint="user_secrets_pkey"// ALTER TABLE ONLY user_secrets ADD CONSTRAINT user_secrets_pkey PRIMARY KEY (id);
UniqueUserSkillsPkeyUniqueConstraint="user_skills_pkey"// ALTER TABLE ONLY user_skills ADD CONSTRAINT user_skills_pkey PRIMARY KEY (id);
UniqueUserStatusChangesPkeyUniqueConstraint="user_status_changes_pkey"// ALTER TABLE ONLY user_status_changes ADD CONSTRAINT user_status_changes_pkey PRIMARY KEY (id);
UniqueUsersPkeyUniqueConstraint="users_pkey"// ALTER TABLE ONLY users ADD CONSTRAINT users_pkey PRIMARY KEY (id);
UniqueWebpushSubscriptionsPkeyUniqueConstraint="webpush_subscriptions_pkey"// ALTER TABLE ONLY webpush_subscriptions ADD CONSTRAINT webpush_subscriptions_pkey PRIMARY KEY (id);
UniqueWorkspaceAgentContextResourcesPkeyUniqueConstraint="workspace_agent_context_resources_pkey"// ALTER TABLE ONLY workspace_agent_context_resources ADD CONSTRAINT workspace_agent_context_resources_pkey PRIMARY KEY (workspace_agent_id, source);
UniqueWorkspaceAgentContextSnapshotsPkeyUniqueConstraint="workspace_agent_context_snapshots_pkey"// ALTER TABLE ONLY workspace_agent_context_snapshots ADD CONSTRAINT workspace_agent_context_snapshots_pkey PRIMARY KEY (workspace_agent_id);
UniqueWorkspaceAgentDevcontainersPkeyUniqueConstraint="workspace_agent_devcontainers_pkey"// ALTER TABLE ONLY workspace_agent_devcontainers ADD CONSTRAINT workspace_agent_devcontainers_pkey PRIMARY KEY (id);
UniqueWorkspaceAgentLogSourcesPkeyUniqueConstraint="workspace_agent_log_sources_pkey"// ALTER TABLE ONLY workspace_agent_log_sources ADD CONSTRAINT workspace_agent_log_sources_pkey PRIMARY KEY (workspace_agent_id, id);
UniqueWorkspaceAgentMemoryResourceMonitorsPkeyUniqueConstraint="workspace_agent_memory_resource_monitors_pkey"// ALTER TABLE ONLY workspace_agent_memory_resource_monitors ADD CONSTRAINT workspace_agent_memory_resource_monitors_pkey PRIMARY KEY (agent_id);
UniqueWorkspaceAgentMetadataPkeyUniqueConstraint="workspace_agent_metadata_pkey"// ALTER TABLE ONLY workspace_agent_metadata ADD CONSTRAINT workspace_agent_metadata_pkey PRIMARY KEY (workspace_agent_id, key);
UniqueWorkspaceAgentPortSharePkeyUniqueConstraint="workspace_agent_port_share_pkey"// ALTER TABLE ONLY workspace_agent_port_share ADD CONSTRAINT workspace_agent_port_share_pkey PRIMARY KEY (workspace_id, agent_name, port);
UniqueWorkspaceAgentScriptTimingsScriptIDStartedAtKeyUniqueConstraint="workspace_agent_script_timings_script_id_started_at_key"// ALTER TABLE ONLY workspace_agent_script_timings ADD CONSTRAINT workspace_agent_script_timings_script_id_started_at_key UNIQUE (script_id, started_at);
UniqueWorkspaceAgentScriptsIDKeyUniqueConstraint="workspace_agent_scripts_id_key"// ALTER TABLE ONLY workspace_agent_scripts ADD CONSTRAINT workspace_agent_scripts_id_key UNIQUE (id);
UniqueWorkspaceAgentStartupLogsPkeyUniqueConstraint="workspace_agent_startup_logs_pkey"// ALTER TABLE ONLY workspace_agent_logs ADD CONSTRAINT workspace_agent_startup_logs_pkey PRIMARY KEY (id);
UniqueWorkspaceAgentVolumeResourceMonitorsPkeyUniqueConstraint="workspace_agent_volume_resource_monitors_pkey"// ALTER TABLE ONLY workspace_agent_volume_resource_monitors ADD CONSTRAINT workspace_agent_volume_resource_monitors_pkey PRIMARY KEY (agent_id, path);
UniqueWorkspaceAgentsPkeyUniqueConstraint="workspace_agents_pkey"// ALTER TABLE ONLY workspace_agents ADD CONSTRAINT workspace_agents_pkey PRIMARY KEY (id);
UniqueWorkspaceAppAuditSessionsAgentIDAppIDUserIDIpUseKeyUniqueConstraint="workspace_app_audit_sessions_agent_id_app_id_user_id_ip_use_key"// ALTER TABLE ONLY workspace_app_audit_sessions ADD CONSTRAINT workspace_app_audit_sessions_agent_id_app_id_user_id_ip_use_key UNIQUE (agent_id, app_id, user_id, ip, user_agent, slug_or_port, status_code);
UniqueWorkspaceAppAuditSessionsPkeyUniqueConstraint="workspace_app_audit_sessions_pkey"// ALTER TABLE ONLY workspace_app_audit_sessions ADD CONSTRAINT workspace_app_audit_sessions_pkey PRIMARY KEY (id);
UniqueWorkspaceAppStatsPkeyUniqueConstraint="workspace_app_stats_pkey"// ALTER TABLE ONLY workspace_app_stats ADD CONSTRAINT workspace_app_stats_pkey PRIMARY KEY (id);
UniqueWorkspaceAppStatsUserIDAgentIDSessionIDKeyUniqueConstraint="workspace_app_stats_user_id_agent_id_session_id_key"// ALTER TABLE ONLY workspace_app_stats ADD CONSTRAINT workspace_app_stats_user_id_agent_id_session_id_key UNIQUE (user_id, agent_id, session_id);
UniqueWorkspaceAppStatusesPkeyUniqueConstraint="workspace_app_statuses_pkey"// ALTER TABLE ONLY workspace_app_statuses ADD CONSTRAINT workspace_app_statuses_pkey PRIMARY KEY (id);
UniqueWorkspaceAppsAgentIDSlugIndexUniqueConstraint="workspace_apps_agent_id_slug_idx"// ALTER TABLE ONLY workspace_apps ADD CONSTRAINT workspace_apps_agent_id_slug_idx UNIQUE (agent_id, slug);
UniqueWorkspaceAppsPkeyUniqueConstraint="workspace_apps_pkey"// ALTER TABLE ONLY workspace_apps ADD CONSTRAINT workspace_apps_pkey PRIMARY KEY (id);
UniqueWorkspaceBuildOrchestrationsChildBuildIDKeyUniqueConstraint="workspace_build_orchestrations_child_build_id_key"// ALTER TABLE ONLY workspace_build_orchestrations ADD CONSTRAINT workspace_build_orchestrations_child_build_id_key UNIQUE (child_build_id);
UniqueWorkspaceBuildOrchestrationsParentBuildIDKeyUniqueConstraint="workspace_build_orchestrations_parent_build_id_key"// ALTER TABLE ONLY workspace_build_orchestrations ADD CONSTRAINT workspace_build_orchestrations_parent_build_id_key UNIQUE (parent_build_id);
UniqueWorkspaceBuildOrchestrationsPkeyUniqueConstraint="workspace_build_orchestrations_pkey"// ALTER TABLE ONLY workspace_build_orchestrations ADD CONSTRAINT workspace_build_orchestrations_pkey PRIMARY KEY (id);
UniqueWorkspaceBuildParametersWorkspaceBuildIDNameKeyUniqueConstraint="workspace_build_parameters_workspace_build_id_name_key"// ALTER TABLE ONLY workspace_build_parameters ADD CONSTRAINT workspace_build_parameters_workspace_build_id_name_key UNIQUE (workspace_build_id, name);
UniqueWorkspaceBuildsIDWorkspaceIDKeyUniqueConstraint="workspace_builds_id_workspace_id_key"// ALTER TABLE ONLY workspace_builds ADD CONSTRAINT workspace_builds_id_workspace_id_key UNIQUE (id, workspace_id);
UniqueWorkspaceBuildsJobIDKeyUniqueConstraint="workspace_builds_job_id_key"// ALTER TABLE ONLY workspace_builds ADD CONSTRAINT workspace_builds_job_id_key UNIQUE (job_id);
UniqueWorkspaceBuildsPkeyUniqueConstraint="workspace_builds_pkey"// ALTER TABLE ONLY workspace_builds ADD CONSTRAINT workspace_builds_pkey PRIMARY KEY (id);
UniqueWorkspaceBuildsWorkspaceIDBuildNumberKeyUniqueConstraint="workspace_builds_workspace_id_build_number_key"// ALTER TABLE ONLY workspace_builds ADD CONSTRAINT workspace_builds_workspace_id_build_number_key UNIQUE (workspace_id, build_number);
UniqueWorkspaceProxiesPkeyUniqueConstraint="workspace_proxies_pkey"// ALTER TABLE ONLY workspace_proxies ADD CONSTRAINT workspace_proxies_pkey PRIMARY KEY (id);
UniqueWorkspaceProxiesRegionIDUniqueUniqueConstraint="workspace_proxies_region_id_unique"// ALTER TABLE ONLY workspace_proxies ADD CONSTRAINT workspace_proxies_region_id_unique UNIQUE (region_id);
UniqueWorkspaceResourceMetadataNameUniqueConstraint="workspace_resource_metadata_name"// ALTER TABLE ONLY workspace_resource_metadata ADD CONSTRAINT workspace_resource_metadata_name UNIQUE (workspace_resource_id, key);
UniqueWorkspaceResourceMetadataPkeyUniqueConstraint="workspace_resource_metadata_pkey"// ALTER TABLE ONLY workspace_resource_metadata ADD CONSTRAINT workspace_resource_metadata_pkey PRIMARY KEY (id);
UniqueWorkspaceResourcesPkeyUniqueConstraint="workspace_resources_pkey"// ALTER TABLE ONLY workspace_resources ADD CONSTRAINT workspace_resources_pkey PRIMARY KEY (id);
UniqueWorkspacesPkeyUniqueConstraint="workspaces_pkey"// ALTER TABLE ONLY workspaces ADD CONSTRAINT workspaces_pkey PRIMARY KEY (id);
UniqueAIGatewayKeysHashedSecretIndexUniqueConstraint="ai_gateway_keys_hashed_secret_idx"// CREATE UNIQUE INDEX ai_gateway_keys_hashed_secret_idx ON ai_gateway_keys USING btree (hashed_secret);
UniqueAIGatewayKeysNameIndexUniqueConstraint="ai_gateway_keys_name_idx"// CREATE UNIQUE INDEX ai_gateway_keys_name_idx ON ai_gateway_keys USING btree (lower(name));
UniqueAIGatewayKeysSecretPrefixIndexUniqueConstraint="ai_gateway_keys_secret_prefix_idx"// CREATE UNIQUE INDEX ai_gateway_keys_secret_prefix_idx ON ai_gateway_keys USING btree (secret_prefix);
UniqueAIProvidersNameUniqueUniqueConstraint="ai_providers_name_unique"// CREATE UNIQUE INDEX ai_providers_name_unique ON ai_providers USING btree (name) WHERE (deleted = false);
UniqueIndexAPIKeyNameUniqueConstraint="idx_api_key_name"// CREATE UNIQUE INDEX idx_api_key_name ON api_keys USING btree (user_id, token_name) WHERE (login_type = 'token'::login_type);
UniqueIndexChatDebugRunsIDChatUniqueConstraint="idx_chat_debug_runs_id_chat"// CREATE UNIQUE INDEX idx_chat_debug_runs_id_chat ON chat_debug_runs USING btree (id, chat_id);
UniqueIndexChatDebugStepsRunStepUniqueConstraint="idx_chat_debug_steps_run_step"// CREATE UNIQUE INDEX idx_chat_debug_steps_run_step ON chat_debug_steps USING btree (run_id, step_number);
UniqueIndexChatModelConfigsSingleDefaultUniqueConstraint="idx_chat_model_configs_single_default"// CREATE UNIQUE INDEX idx_chat_model_configs_single_default ON chat_model_configs USING btree (organization_id) WHERE ((is_default = true) AND (deleted = false));
UniqueIndexConnectionLogsConnectionIDWorkspaceIDAgentNameUniqueConstraint="idx_connection_logs_connection_id_workspace_id_agent_name"// CREATE UNIQUE INDEX idx_connection_logs_connection_id_workspace_id_agent_name ON connection_logs USING btree (connection_id, workspace_id, agent_name);
UniqueIndexCustomRolesNameLowerOrganizationIDUniqueConstraint="idx_custom_roles_name_lower_organization_id"// CREATE UNIQUE INDEX idx_custom_roles_name_lower_organization_id ON custom_roles USING btree (lower(name), COALESCE(organization_id, '00000000-0000-0000-0000-000000000000'::uuid));
UniqueIndexOrganizationNameLowerUniqueConstraint="idx_organization_name_lower"// CREATE UNIQUE INDEX idx_organization_name_lower ON organizations USING btree (lower(name)) WHERE (deleted = false);
UniqueIndexProvisionerDaemonsOrgNameOwnerKeyUniqueConstraint="idx_provisioner_daemons_org_name_owner_key"// CREATE UNIQUE INDEX idx_provisioner_daemons_org_name_owner_key ON provisioner_daemons USING btree (organization_id, name, lower(COALESCE((tags ->> 'owner'::text), ''::text)));
UniqueIndexTemplateVersionPresetsDefaultUniqueConstraint="idx_template_version_presets_default"// CREATE UNIQUE INDEX idx_template_version_presets_default ON template_version_presets USING btree (template_version_id) WHERE (is_default = true);
UniqueIndexUniquePresetNameUniqueConstraint="idx_unique_preset_name"// CREATE UNIQUE INDEX idx_unique_preset_name ON template_version_presets USING btree (name, template_version_id);
UniqueIndexUsageEventsAgentRuntimeUniqueConstraint="idx_usage_events_agent_runtime"// CREATE UNIQUE INDEX idx_usage_events_agent_runtime ON usage_events USING btree (event_type, created_at) WHERE (event_type = 'hb_agent_runtime_v1'::text);
UniqueIndexUsersEmailUniqueConstraint="idx_users_email"// CREATE UNIQUE INDEX idx_users_email ON users USING btree (email) WHERE ((deleted = false) AND (email <> ''::text));
UniqueIndexUsersUsernameUniqueConstraint="idx_users_username"// CREATE UNIQUE INDEX idx_users_username ON users USING btree (username) WHERE (deleted = false);
UniqueNotificationMessagesDedupeHashIndexUniqueConstraint="notification_messages_dedupe_hash_idx"// CREATE UNIQUE INDEX notification_messages_dedupe_hash_idx ON notification_messages USING btree (dedupe_hash);
UniqueOrganizationsSingleDefaultOrgUniqueConstraint="organizations_single_default_org"// CREATE UNIQUE INDEX organizations_single_default_org ON organizations USING btree (is_default) WHERE (is_default = true);
UniqueProvisionerKeysOrganizationIDNameIndexUniqueConstraint="provisioner_keys_organization_id_name_idx"// CREATE UNIQUE INDEX provisioner_keys_organization_id_name_idx ON provisioner_keys USING btree (organization_id, lower((name)::text));
UniqueTasksOwnerIDNameUniqueIndexUniqueConstraint="tasks_owner_id_name_unique_idx"// CREATE UNIQUE INDEX tasks_owner_id_name_unique_idx ON tasks USING btree (owner_id, lower(name)) WHERE (deleted_at IS NULL);
UniqueTemplateUsageStatsStartTimeTemplateIDUserIDIndexUniqueConstraint="template_usage_stats_start_time_template_id_user_id_idx"// CREATE UNIQUE INDEX template_usage_stats_start_time_template_id_user_id_idx ON template_usage_stats USING btree (start_time, template_id, user_id);
UniqueTemplatesOrganizationIDNameIndexUniqueConstraint="templates_organization_id_name_idx"// CREATE UNIQUE INDEX templates_organization_id_name_idx ON templates USING btree (organization_id, lower((name)::text)) WHERE (deleted = false);
UniqueUserLinksLinkedIDLoginTypeIndexUniqueConstraint="user_links_linked_id_login_type_idx"// CREATE UNIQUE INDEX user_links_linked_id_login_type_idx ON user_links USING btree (linked_id, login_type) WHERE (linked_id <> ''::text);
UniqueUserSecretsUserEnvNameIndexUniqueConstraint="user_secrets_user_env_name_idx"// CREATE UNIQUE INDEX user_secrets_user_env_name_idx ON user_secrets USING btree (user_id, env_name) WHERE (env_name <> ''::text);
UniqueUserSecretsUserFilePathIndexUniqueConstraint="user_secrets_user_file_path_idx"// CREATE UNIQUE INDEX user_secrets_user_file_path_idx ON user_secrets USING btree (user_id, file_path) WHERE (file_path <> ''::text);
UniqueUserSecretsUserNameIndexUniqueConstraint="user_secrets_user_name_idx"// CREATE UNIQUE INDEX user_secrets_user_name_idx ON user_secrets USING btree (user_id, name);
UniqueUserSkillsUserIDNameIndexUniqueConstraint="user_skills_user_id_name_idx"// CREATE UNIQUE INDEX user_skills_user_id_name_idx ON user_skills USING btree (user_id, name);
UniqueUsersEmailLowerIndexUniqueConstraint="users_email_lower_idx"// CREATE UNIQUE INDEX users_email_lower_idx ON users USING btree (lower(email)) WHERE ((deleted = false) AND (email <> ''::text));
UniqueUsersUsernameLowerIndexUniqueConstraint="users_username_lower_idx"// CREATE UNIQUE INDEX users_username_lower_idx ON users USING btree (lower(username)) WHERE (deleted = false);
UniqueWebpushSubscriptionsUserIDEndpointIndexUniqueConstraint="webpush_subscriptions_user_id_endpoint_idx"// CREATE UNIQUE INDEX webpush_subscriptions_user_id_endpoint_idx ON webpush_subscriptions USING btree (user_id, endpoint);
UniqueWorkspaceAppAuditSessionsUniqueIndexUniqueConstraint="workspace_app_audit_sessions_unique_index"// CREATE UNIQUE INDEX workspace_app_audit_sessions_unique_index ON workspace_app_audit_sessions USING btree (agent_id, app_id, user_id, ip, user_agent, slug_or_port, status_code);
UniqueWorkspaceProxiesLowerNameIndexUniqueConstraint="workspace_proxies_lower_name_idx"// CREATE UNIQUE INDEX workspace_proxies_lower_name_idx ON workspace_proxies USING btree (lower(name)) WHERE (deleted = false);
UniqueWorkspacesOwnerIDLowerIndexUniqueConstraint="workspaces_owner_id_lower_idx"// CREATE UNIQUE INDEX workspaces_owner_id_lower_idx ON workspaces USING btree (owner_id, lower((name)::text)) WHERE (deleted = false);