{ "Extensions": [ "citext", "hstore", "intarray", "pg_stat_statements", "pg_trgm", "pgcrypto" ], "Enums": [ { "Name": "audit_log_operation", "Labels": [ "create", "modify", "delete" ] }, { "Name": "batch_changes_changeset_ui_publication_state", "Labels": [ "UNPUBLISHED", "DRAFT", "PUBLISHED" ] }, { "Name": "cm_email_priority", "Labels": [ "NORMAL", "CRITICAL" ] }, { "Name": "critical_or_site", "Labels": [ "critical", "site" ] }, { "Name": "feature_flag_type", "Labels": [ "bool", "rollout" ] }, { "Name": "persistmode", "Labels": [ "record", "snapshot" ] } ], "Functions": [ { "Name": "batch_spec_workspace_execution_last_dequeues_upsert", "Definition": "CREATE OR REPLACE FUNCTION public.batch_spec_workspace_execution_last_dequeues_upsert()\n RETURNS trigger\n LANGUAGE plpgsql\nAS $function$ BEGIN\n INSERT INTO\n batch_spec_workspace_execution_last_dequeues\n SELECT\n user_id,\n MAX(started_at) as latest_dequeue\n FROM\n newtab\n GROUP BY\n user_id\n ON CONFLICT (user_id) DO UPDATE SET\n latest_dequeue = GREATEST(batch_spec_workspace_execution_last_dequeues.latest_dequeue, EXCLUDED.latest_dequeue);\n\n RETURN NULL;\nEND $function$\n" }, { "Name": "changesets_computed_state_ensure", "Definition": "CREATE OR REPLACE FUNCTION public.changesets_computed_state_ensure()\n RETURNS trigger\n LANGUAGE plpgsql\nAS $function$ BEGIN\n\n NEW.computed_state = CASE\n WHEN NEW.reconciler_state = 'errored' THEN 'RETRYING'\n WHEN NEW.reconciler_state = 'failed' THEN 'FAILED'\n WHEN NEW.reconciler_state = 'scheduled' THEN 'SCHEDULED'\n WHEN NEW.reconciler_state != 'completed' THEN 'PROCESSING'\n WHEN NEW.publication_state = 'UNPUBLISHED' THEN 'UNPUBLISHED'\n ELSE NEW.external_state\n END AS computed_state;\n\n RETURN NEW;\nEND $function$\n" }, { "Name": "delete_batch_change_reference_on_changesets", "Definition": "CREATE OR REPLACE FUNCTION public.delete_batch_change_reference_on_changesets()\n RETURNS trigger\n LANGUAGE plpgsql\nAS $function$\n BEGIN\n UPDATE\n changesets\n SET\n batch_change_ids = changesets.batch_change_ids - OLD.id::text\n WHERE\n changesets.batch_change_ids ? OLD.id::text;\n\n RETURN OLD;\n END;\n$function$\n" }, { "Name": "delete_repo_ref_on_external_service_repos", "Definition": "CREATE OR REPLACE FUNCTION public.delete_repo_ref_on_external_service_repos()\n RETURNS trigger\n LANGUAGE plpgsql\nAS $function$\n BEGIN\n -- if a repo is soft-deleted, delete every row that references that repo\n IF (OLD.deleted_at IS NULL AND NEW.deleted_at IS NOT NULL) THEN\n DELETE FROM\n external_service_repos\n WHERE\n repo_id = OLD.id;\n END IF;\n\n RETURN OLD;\n END;\n$function$\n" }, { "Name": "delete_user_repo_permissions_on_external_account_soft_delete", "Definition": "CREATE OR REPLACE FUNCTION public.delete_user_repo_permissions_on_external_account_soft_delete()\n RETURNS trigger\n LANGUAGE plpgsql\nAS $function$ BEGIN\n IF NEW.deleted_at IS NOT NULL AND OLD.deleted_at IS NULL THEN\n \tDELETE FROM user_repo_permissions WHERE user_id = OLD.user_id AND user_external_account_id = OLD.id;\n END IF;\n RETURN NULL;\n END\n$function$\n" }, { "Name": "delete_user_repo_permissions_on_repo_soft_delete", "Definition": "CREATE OR REPLACE FUNCTION public.delete_user_repo_permissions_on_repo_soft_delete()\n RETURNS trigger\n LANGUAGE plpgsql\nAS $function$ BEGIN\n IF NEW.deleted_at IS NOT NULL AND OLD.deleted_at IS NULL THEN\n \tDELETE FROM user_repo_permissions WHERE repo_id = NEW.id;\n END IF;\n RETURN NULL;\n END\n$function$\n" }, { "Name": "delete_user_repo_permissions_on_user_soft_delete", "Definition": "CREATE OR REPLACE FUNCTION public.delete_user_repo_permissions_on_user_soft_delete()\n RETURNS trigger\n LANGUAGE plpgsql\nAS $function$ BEGIN\n IF NEW.deleted_at IS NOT NULL AND OLD.deleted_at IS NULL THEN\n \tDELETE FROM user_repo_permissions WHERE user_id = OLD.id;\n END IF;\n RETURN NULL;\n END\n$function$\n" }, { "Name": "func_configuration_policies_delete", "Definition": "CREATE OR REPLACE FUNCTION public.func_configuration_policies_delete()\n RETURNS trigger\n LANGUAGE plpgsql\nAS $function$\n BEGIN\n UPDATE configuration_policies_audit_logs\n SET record_deleted_at = NOW()\n WHERE policy_id IN (\n SELECT id FROM OLD\n );\n\n RETURN NULL;\n END;\n$function$\n" }, { "Name": "func_configuration_policies_insert", "Definition": "CREATE OR REPLACE FUNCTION public.func_configuration_policies_insert()\n RETURNS trigger\n LANGUAGE plpgsql\nAS $function$\n BEGIN\n INSERT INTO configuration_policies_audit_logs\n (policy_id, operation, transition_columns)\n VALUES (\n NEW.id, 'create',\n func_configuration_policies_transition_columns_diff(\n (NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),\n func_row_to_configuration_policies_transition_columns(NEW)\n )\n );\n RETURN NULL;\n END;\n$function$\n" }, { "Name": "func_configuration_policies_transition_columns_diff", "Definition": "CREATE OR REPLACE FUNCTION public.func_configuration_policies_transition_columns_diff(old configuration_policies_transition_columns, new configuration_policies_transition_columns)\n RETURNS hstore[]\n LANGUAGE plpgsql\nAS $function$\n BEGIN\n -- array || NULL should be a noop, but that doesn't seem to be happening\n -- hence array_remove here\n RETURN array_remove(\n ARRAY[]::hstore[] ||\n CASE WHEN old.name IS DISTINCT FROM new.name THEN\n hstore(ARRAY['column', 'name', 'old', old.name, 'new', new.name])\n ELSE NULL\n END ||\n CASE WHEN old.type IS DISTINCT FROM new.type THEN\n hstore(ARRAY['column', 'type', 'old', old.type, 'new', new.type])\n ELSE NULL\n END ||\n CASE WHEN old.pattern IS DISTINCT FROM new.pattern THEN\n hstore(ARRAY['column', 'pattern', 'old', old.pattern, 'new', new.pattern])\n ELSE NULL\n END ||\n CASE WHEN old.retention_enabled IS DISTINCT FROM new.retention_enabled THEN\n hstore(ARRAY['column', 'retention_enabled', 'old', old.retention_enabled::text, 'new', new.retention_enabled::text])\n ELSE NULL\n END ||\n CASE WHEN old.retention_duration_hours IS DISTINCT FROM new.retention_duration_hours THEN\n hstore(ARRAY['column', 'retention_duration_hours', 'old', old.retention_duration_hours::text, 'new', new.retention_duration_hours::text])\n ELSE NULL\n END ||\n CASE WHEN old.indexing_enabled IS DISTINCT FROM new.indexing_enabled THEN\n hstore(ARRAY['column', 'indexing_enabled', 'old', old.indexing_enabled::text, 'new', new.indexing_enabled::text])\n ELSE NULL\n END ||\n CASE WHEN old.index_commit_max_age_hours IS DISTINCT FROM new.index_commit_max_age_hours THEN\n hstore(ARRAY['column', 'index_commit_max_age_hours', 'old', old.index_commit_max_age_hours::text, 'new', new.index_commit_max_age_hours::text])\n ELSE NULL\n END ||\n CASE WHEN old.index_intermediate_commits IS DISTINCT FROM new.index_intermediate_commits THEN\n hstore(ARRAY['column', 'index_intermediate_commits', 'old', old.index_intermediate_commits::text, 'new', new.index_intermediate_commits::text])\n ELSE NULL\n END ||\n CASE WHEN old.protected IS DISTINCT FROM new.protected THEN\n hstore(ARRAY['column', 'protected', 'old', old.protected::text, 'new', new.protected::text])\n ELSE NULL\n END ||\n CASE WHEN old.repository_patterns IS DISTINCT FROM new.repository_patterns THEN\n hstore(ARRAY['column', 'repository_patterns', 'old', old.repository_patterns::text, 'new', new.repository_patterns::text])\n ELSE NULL\n END,\n NULL);\n END;\n$function$\n" }, { "Name": "func_configuration_policies_update", "Definition": "CREATE OR REPLACE FUNCTION public.func_configuration_policies_update()\n RETURNS trigger\n LANGUAGE plpgsql\nAS $function$\n DECLARE\n diff hstore[];\n BEGIN\n diff = func_configuration_policies_transition_columns_diff(\n func_row_to_configuration_policies_transition_columns(OLD),\n func_row_to_configuration_policies_transition_columns(NEW)\n );\n\n IF (array_length(diff, 1) \u003e 0) THEN\n INSERT INTO configuration_policies_audit_logs\n (policy_id, operation, transition_columns)\n VALUES (NEW.id, 'modify', diff);\n END IF;\n\n RETURN NEW;\n END;\n$function$\n" }, { "Name": "func_insert_gitserver_repo", "Definition": "CREATE OR REPLACE FUNCTION public.func_insert_gitserver_repo()\n RETURNS trigger\n LANGUAGE plpgsql\nAS $function$\nBEGIN\nINSERT INTO gitserver_repos\n(repo_id, shard_id)\nVALUES (NEW.id, '');\nRETURN NULL;\nEND;\n$function$\n" }, { "Name": "func_insert_zoekt_repo", "Definition": "CREATE OR REPLACE FUNCTION public.func_insert_zoekt_repo()\n RETURNS trigger\n LANGUAGE plpgsql\nAS $function$\nBEGIN\n INSERT INTO zoekt_repos (repo_id) VALUES (NEW.id);\n\n RETURN NULL;\nEND;\n$function$\n" }, { "Name": "func_lsif_uploads_delete", "Definition": "CREATE OR REPLACE FUNCTION public.func_lsif_uploads_delete()\n RETURNS trigger\n LANGUAGE plpgsql\nAS $function$\n BEGIN\n UPDATE lsif_uploads_audit_logs\n SET record_deleted_at = NOW()\n WHERE upload_id IN (\n SELECT id FROM OLD\n );\n\n RETURN NULL;\n END;\n$function$\n" }, { "Name": "func_lsif_uploads_insert", "Definition": "CREATE OR REPLACE FUNCTION public.func_lsif_uploads_insert()\n RETURNS trigger\n LANGUAGE plpgsql\nAS $function$\n BEGIN\n INSERT INTO lsif_uploads_audit_logs\n (upload_id, commit, root, repository_id, uploaded_at,\n indexer, indexer_version, upload_size, associated_index_id,\n content_type,\n operation, transition_columns)\n VALUES (\n NEW.id, NEW.commit, NEW.root, NEW.repository_id, NEW.uploaded_at,\n NEW.indexer, NEW.indexer_version, NEW.upload_size, NEW.associated_index_id,\n NEW.content_type,\n 'create', func_lsif_uploads_transition_columns_diff(\n (NULL, NULL, NULL, NULL, NULL, NULL),\n func_row_to_lsif_uploads_transition_columns(NEW)\n )\n );\n RETURN NULL;\n END;\n$function$\n" }, { "Name": "func_lsif_uploads_transition_columns_diff", "Definition": "CREATE OR REPLACE FUNCTION public.func_lsif_uploads_transition_columns_diff(old lsif_uploads_transition_columns, new lsif_uploads_transition_columns)\n RETURNS hstore[]\n LANGUAGE plpgsql\nAS $function$\n BEGIN\n -- array || NULL should be a noop, but that doesn't seem to be happening\n -- hence array_remove here\n RETURN array_remove(\n ARRAY[]::hstore[] ||\n CASE WHEN old.state IS DISTINCT FROM new.state THEN\n hstore(ARRAY['column', 'state', 'old', old.state, 'new', new.state])\n ELSE NULL\n END ||\n CASE WHEN old.expired IS DISTINCT FROM new.expired THEN\n hstore(ARRAY['column', 'expired', 'old', old.expired::text, 'new', new.expired::text])\n ELSE NULL\n END ||\n CASE WHEN old.num_resets IS DISTINCT FROM new.num_resets THEN\n hstore(ARRAY['column', 'num_resets', 'old', old.num_resets::text, 'new', new.num_resets::text])\n ELSE NULL\n END ||\n CASE WHEN old.num_failures IS DISTINCT FROM new.num_failures THEN\n hstore(ARRAY['column', 'num_failures', 'old', old.num_failures::text, 'new', new.num_failures::text])\n ELSE NULL\n END ||\n CASE WHEN old.worker_hostname IS DISTINCT FROM new.worker_hostname THEN\n hstore(ARRAY['column', 'worker_hostname', 'old', old.worker_hostname, 'new', new.worker_hostname])\n ELSE NULL\n END ||\n CASE WHEN old.committed_at IS DISTINCT FROM new.committed_at THEN\n hstore(ARRAY['column', 'committed_at', 'old', old.committed_at::text, 'new', new.committed_at::text])\n ELSE NULL\n END,\n NULL);\n END;\n$function$\n" }, { "Name": "func_lsif_uploads_update", "Definition": "CREATE OR REPLACE FUNCTION public.func_lsif_uploads_update()\n RETURNS trigger\n LANGUAGE plpgsql\nAS $function$\n DECLARE\n diff hstore[];\n BEGIN\n diff = func_lsif_uploads_transition_columns_diff(\n func_row_to_lsif_uploads_transition_columns(OLD),\n func_row_to_lsif_uploads_transition_columns(NEW)\n );\n\n IF (array_length(diff, 1) \u003e 0) THEN\n INSERT INTO lsif_uploads_audit_logs\n (reason, upload_id, commit, root, repository_id, uploaded_at,\n indexer, indexer_version, upload_size, associated_index_id,\n content_type,\n operation, transition_columns)\n VALUES (\n COALESCE(current_setting('codeintel.lsif_uploads_audit.reason', true), ''),\n NEW.id, NEW.commit, NEW.root, NEW.repository_id, NEW.uploaded_at,\n NEW.indexer, NEW.indexer_version, NEW.upload_size, NEW.associated_index_id,\n NEW.content_type,\n 'modify', diff\n );\n END IF;\n\n RETURN NEW;\n END;\n$function$\n" }, { "Name": "func_package_repo_filters_updated_at", "Definition": "CREATE OR REPLACE FUNCTION public.func_package_repo_filters_updated_at()\n RETURNS trigger\n LANGUAGE plpgsql\nAS $function$\nBEGIN\n NEW.updated_at = statement_timestamp();\n RETURN NEW;\nEND $function$\n" }, { "Name": "func_row_to_configuration_policies_transition_columns", "Definition": "CREATE OR REPLACE FUNCTION public.func_row_to_configuration_policies_transition_columns(rec record)\n RETURNS configuration_policies_transition_columns\n LANGUAGE plpgsql\nAS $function$\n BEGIN\n RETURN (\n rec.name, rec.type, rec.pattern,\n rec.retention_enabled, rec.retention_duration_hours, rec.retain_intermediate_commits,\n rec.indexing_enabled, rec.index_commit_max_age_hours, rec.index_intermediate_commits,\n rec.protected, rec.repository_patterns);\n END;\n$function$\n" }, { "Name": "func_row_to_lsif_uploads_transition_columns", "Definition": "CREATE OR REPLACE FUNCTION public.func_row_to_lsif_uploads_transition_columns(rec record)\n RETURNS lsif_uploads_transition_columns\n LANGUAGE plpgsql\nAS $function$\n BEGIN\n RETURN (rec.state, rec.expired, rec.num_resets, rec.num_failures, rec.worker_hostname, rec.committed_at);\n END;\n$function$\n" }, { "Name": "invalidate_session_for_userid_on_password_change", "Definition": "CREATE OR REPLACE FUNCTION public.invalidate_session_for_userid_on_password_change()\n RETURNS trigger\n LANGUAGE plpgsql\nAS $function$\n BEGIN\n IF OLD.passwd != NEW.passwd THEN\n NEW.invalidated_sessions_at = now() + (1 * interval '1 second');\n RETURN NEW;\n END IF;\n RETURN NEW;\n END;\n$function$\n" }, { "Name": "merge_audit_log_transitions", "Definition": "CREATE OR REPLACE FUNCTION public.merge_audit_log_transitions(internal hstore, arrayhstore hstore[])\n RETURNS hstore\n LANGUAGE plpgsql\n IMMUTABLE\nAS $function$\n DECLARE\n trans hstore;\n BEGIN\n FOREACH trans IN ARRAY arrayhstore\n LOOP\n internal := internal || hstore(trans-\u003e'column', trans-\u003e'new');\n END LOOP;\n\n RETURN internal;\n END;\n$function$\n" }, { "Name": "recalc_gitserver_repos_statistics_on_delete", "Definition": "CREATE OR REPLACE FUNCTION public.recalc_gitserver_repos_statistics_on_delete()\n RETURNS trigger\n LANGUAGE plpgsql\nAS $function$ BEGIN\n UPDATE gitserver_repos_statistics grs\n SET\n total = grs.total - (SELECT COUNT(*) FROM oldtab WHERE oldtab.shard_id = grs.shard_id),\n not_cloned = grs.not_cloned - (SELECT COUNT(*) FILTER(WHERE clone_status = 'not_cloned') FROM oldtab WHERE oldtab.shard_id = grs.shard_id),\n cloning = grs.cloning - (SELECT COUNT(*) FILTER(WHERE clone_status = 'cloning') FROM oldtab WHERE oldtab.shard_id = grs.shard_id),\n cloned = grs.cloned - (SELECT COUNT(*) FILTER(WHERE clone_status = 'cloned') FROM oldtab WHERE oldtab.shard_id = grs.shard_id),\n failed_fetch = grs.cloned - (SELECT COUNT(*) FILTER(WHERE last_error IS NOT NULL) FROM oldtab WHERE oldtab.shard_id = grs.shard_id)\n ;\n\n RETURN NULL;\n END\n$function$\n" }, { "Name": "recalc_gitserver_repos_statistics_on_insert", "Definition": "CREATE OR REPLACE FUNCTION public.recalc_gitserver_repos_statistics_on_insert()\n RETURNS trigger\n LANGUAGE plpgsql\nAS $function$ BEGIN\n INSERT INTO gitserver_repos_statistics AS grs (shard_id, total, not_cloned, cloning, cloned, failed_fetch)\n SELECT\n shard_id,\n COUNT(*) AS total,\n COUNT(*) FILTER(WHERE clone_status = 'not_cloned') AS not_cloned,\n COUNT(*) FILTER(WHERE clone_status = 'cloning') AS cloning,\n COUNT(*) FILTER(WHERE clone_status = 'cloned') AS cloned,\n COUNT(*) FILTER(WHERE last_error IS NOT NULL) AS failed_fetch\n FROM\n newtab\n GROUP BY shard_id\n ON CONFLICT(shard_id)\n DO UPDATE\n SET\n total = grs.total + excluded.total,\n not_cloned = grs.not_cloned + excluded.not_cloned,\n cloning = grs.cloning + excluded.cloning,\n cloned = grs.cloned + excluded.cloned,\n failed_fetch = grs.failed_fetch + excluded.failed_fetch\n ;\n\n RETURN NULL;\n END\n$function$\n" }, { "Name": "recalc_gitserver_repos_statistics_on_update", "Definition": "CREATE OR REPLACE FUNCTION public.recalc_gitserver_repos_statistics_on_update()\n RETURNS trigger\n LANGUAGE plpgsql\nAS $function$ BEGIN\n INSERT INTO gitserver_repos_statistics AS grs (shard_id, total, not_cloned, cloning, cloned, failed_fetch, corrupted)\n SELECT\n newtab.shard_id AS shard_id,\n COUNT(*) AS total,\n COUNT(*) FILTER(WHERE clone_status = 'not_cloned') AS not_cloned,\n COUNT(*) FILTER(WHERE clone_status = 'cloning') AS cloning,\n COUNT(*) FILTER(WHERE clone_status = 'cloned') AS cloned,\n COUNT(*) FILTER(WHERE last_error IS NOT NULL) AS failed_fetch,\n COUNT(*) FILTER(WHERE corrupted_at IS NOT NULL) AS corrupted\n FROM\n newtab\n GROUP BY newtab.shard_id\n ON CONFLICT(shard_id) DO\n UPDATE\n SET\n total = grs.total + (excluded.total - (SELECT COUNT(*) FROM oldtab ot WHERE ot.shard_id = excluded.shard_id)),\n not_cloned = grs.not_cloned + (excluded.not_cloned - (SELECT COUNT(*) FILTER(WHERE ot.clone_status = 'not_cloned') FROM oldtab ot WHERE ot.shard_id = excluded.shard_id)),\n cloning = grs.cloning + (excluded.cloning - (SELECT COUNT(*) FILTER(WHERE ot.clone_status = 'cloning') FROM oldtab ot WHERE ot.shard_id = excluded.shard_id)),\n cloned = grs.cloned + (excluded.cloned - (SELECT COUNT(*) FILTER(WHERE ot.clone_status = 'cloned') FROM oldtab ot WHERE ot.shard_id = excluded.shard_id)),\n failed_fetch = grs.failed_fetch + (excluded.failed_fetch - (SELECT COUNT(*) FILTER(WHERE ot.last_error IS NOT NULL) FROM oldtab ot WHERE ot.shard_id = excluded.shard_id)),\n corrupted = grs.corrupted + (excluded.corrupted - (SELECT COUNT(*) FILTER(WHERE ot.corrupted_at IS NOT NULL) FROM oldtab ot WHERE ot.shard_id = excluded.shard_id))\n ;\n\n -------------------------------------------------\n -- IMPORTANT: THIS IS CHANGED TO INCLUDE `corrupted`\n -------------------------------------------------\n WITH moved AS (\n SELECT\n oldtab.shard_id AS shard_id,\n COUNT(*) AS total,\n COUNT(*) FILTER(WHERE oldtab.clone_status = 'not_cloned') AS not_cloned,\n COUNT(*) FILTER(WHERE oldtab.clone_status = 'cloning') AS cloning,\n COUNT(*) FILTER(WHERE oldtab.clone_status = 'cloned') AS cloned,\n COUNT(*) FILTER(WHERE oldtab.last_error IS NOT NULL) AS failed_fetch,\n COUNT(*) FILTER(WHERE oldtab.corrupted_at IS NOT NULL) AS corrupted\n FROM\n oldtab\n JOIN newtab ON newtab.repo_id = oldtab.repo_id\n WHERE\n oldtab.shard_id != newtab.shard_id\n GROUP BY oldtab.shard_id\n )\n UPDATE gitserver_repos_statistics grs\n SET\n total = grs.total - moved.total,\n not_cloned = grs.not_cloned - moved.not_cloned,\n cloning = grs.cloning - moved.cloning,\n cloned = grs.cloned - moved.cloned,\n failed_fetch = grs.failed_fetch - moved.failed_fetch,\n corrupted = grs.corrupted - moved.corrupted\n FROM moved\n WHERE moved.shard_id = grs.shard_id;\n\n -------------------------------------------------\n -- IMPORTANT: THIS IS CHANGED TO INCLUDE `corrupted`\n -------------------------------------------------\n WITH diff(not_cloned, cloning, cloned, failed_fetch, corrupted) AS (\n VALUES (\n (\n (SELECT COUNT(*) FROM newtab JOIN repo r ON newtab.repo_id = r.id WHERE r.deleted_at is NULL AND r.blocked IS NULL AND newtab.clone_status = 'not_cloned')\n -\n (SELECT COUNT(*) FROM oldtab JOIN repo r ON oldtab.repo_id = r.id WHERE r.deleted_at is NULL AND r.blocked IS NULL AND oldtab.clone_status = 'not_cloned')\n ),\n (\n (SELECT COUNT(*) FROM newtab JOIN repo r ON newtab.repo_id = r.id WHERE r.deleted_at is NULL AND r.blocked IS NULL AND newtab.clone_status = 'cloning')\n -\n (SELECT COUNT(*) FROM oldtab JOIN repo r ON oldtab.repo_id = r.id WHERE r.deleted_at is NULL AND r.blocked IS NULL AND oldtab.clone_status = 'cloning')\n ),\n (\n (SELECT COUNT(*) FROM newtab JOIN repo r ON newtab.repo_id = r.id WHERE r.deleted_at is NULL AND r.blocked IS NULL AND newtab.clone_status = 'cloned')\n -\n (SELECT COUNT(*) FROM oldtab JOIN repo r ON oldtab.repo_id = r.id WHERE r.deleted_at is NULL AND r.blocked IS NULL AND oldtab.clone_status = 'cloned')\n ),\n (\n (SELECT COUNT(*) FROM newtab JOIN repo r ON newtab.repo_id = r.id WHERE r.deleted_at is NULL AND r.blocked IS NULL AND newtab.last_error IS NOT NULL)\n -\n (SELECT COUNT(*) FROM oldtab JOIN repo r ON oldtab.repo_id = r.id WHERE r.deleted_at is NULL AND r.blocked IS NULL AND oldtab.last_error IS NOT NULL)\n ),\n (\n (SELECT COUNT(*) FROM newtab JOIN repo r ON newtab.repo_id = r.id WHERE r.deleted_at is NULL AND r.blocked IS NULL AND newtab.corrupted_at IS NOT NULL)\n -\n (SELECT COUNT(*) FROM oldtab JOIN repo r ON oldtab.repo_id = r.id WHERE r.deleted_at is NULL AND r.blocked IS NULL AND oldtab.corrupted_at IS NOT NULL)\n )\n\n )\n )\n INSERT INTO repo_statistics (not_cloned, cloning, cloned, failed_fetch, corrupted)\n SELECT not_cloned, cloning, cloned, failed_fetch, corrupted\n FROM diff\n WHERE\n not_cloned != 0\n OR cloning != 0\n OR cloned != 0\n OR failed_fetch != 0\n OR corrupted != 0\n ;\n\n RETURN NULL;\n END\n$function$\n" }, { "Name": "recalc_repo_statistics_on_repo_delete", "Definition": "CREATE OR REPLACE FUNCTION public.recalc_repo_statistics_on_repo_delete()\n RETURNS trigger\n LANGUAGE plpgsql\nAS $function$ BEGIN\n INSERT INTO\n repo_statistics (total, soft_deleted, not_cloned, cloning, cloned, failed_fetch)\n VALUES (\n -- Insert negative counts\n (SELECT -COUNT(*) FROM oldtab WHERE deleted_at IS NULL AND blocked IS NULL),\n (SELECT -COUNT(*) FROM oldtab WHERE deleted_at IS NOT NULL AND blocked IS NULL),\n (SELECT -COUNT(*) FROM oldtab JOIN gitserver_repos gr ON gr.repo_id = oldtab.id WHERE oldtab.deleted_at is NULL AND oldtab.blocked IS NULL AND gr.clone_status = 'not_cloned'),\n (SELECT -COUNT(*) FROM oldtab JOIN gitserver_repos gr ON gr.repo_id = oldtab.id WHERE oldtab.deleted_at is NULL AND oldtab.blocked IS NULL AND gr.clone_status = 'cloning'),\n (SELECT -COUNT(*) FROM oldtab JOIN gitserver_repos gr ON gr.repo_id = oldtab.id WHERE oldtab.deleted_at is NULL AND oldtab.blocked IS NULL AND gr.clone_status = 'cloned'),\n (SELECT -COUNT(*) FROM oldtab JOIN gitserver_repos gr ON gr.repo_id = oldtab.id WHERE oldtab.deleted_at is NULL AND oldtab.blocked IS NULL AND gr.last_error IS NOT NULL)\n );\n RETURN NULL;\n END\n$function$\n" }, { "Name": "recalc_repo_statistics_on_repo_insert", "Definition": "CREATE OR REPLACE FUNCTION public.recalc_repo_statistics_on_repo_insert()\n RETURNS trigger\n LANGUAGE plpgsql\nAS $function$ BEGIN\n INSERT INTO\n repo_statistics (total, soft_deleted, not_cloned)\n VALUES (\n (SELECT COUNT(*) FROM newtab WHERE deleted_at IS NULL AND blocked IS NULL),\n (SELECT COUNT(*) FROM newtab WHERE deleted_at IS NOT NULL AND blocked IS NULL),\n -- New repositories are always not_cloned by default, so we can count them as not cloned here\n (SELECT COUNT(*) FROM newtab WHERE deleted_at IS NULL AND blocked IS NULL)\n -- New repositories never have last_error set, so we can also ignore those here\n );\n RETURN NULL;\n END\n$function$\n" }, { "Name": "recalc_repo_statistics_on_repo_update", "Definition": "CREATE OR REPLACE FUNCTION public.recalc_repo_statistics_on_repo_update()\n RETURNS trigger\n LANGUAGE plpgsql\nAS $function$ BEGIN\n -- Insert diff of changes\n WITH diff(total, soft_deleted, not_cloned, cloning, cloned, failed_fetch, corrupted) AS (\n VALUES (\n (SELECT COUNT(*) FROM newtab WHERE deleted_at IS NULL AND blocked IS NULL) - (SELECT COUNT(*) FROM oldtab WHERE deleted_at IS NULL AND blocked IS NULL),\n (SELECT COUNT(*) FROM newtab WHERE deleted_at IS NOT NULL AND blocked IS NULL) - (SELECT COUNT(*) FROM oldtab WHERE deleted_at IS NOT NULL AND blocked IS NULL),\n (\n (SELECT COUNT(*) FROM newtab JOIN gitserver_repos gr ON gr.repo_id = newtab.id WHERE newtab.deleted_at is NULL AND newtab.blocked IS NULL AND gr.clone_status = 'not_cloned')\n -\n (SELECT COUNT(*) FROM oldtab JOIN gitserver_repos gr ON gr.repo_id = oldtab.id WHERE oldtab.deleted_at is NULL AND oldtab.blocked IS NULL AND gr.clone_status = 'not_cloned')\n ),\n (\n (SELECT COUNT(*) FROM newtab JOIN gitserver_repos gr ON gr.repo_id = newtab.id WHERE newtab.deleted_at is NULL AND newtab.blocked IS NULL AND gr.clone_status = 'cloning')\n -\n (SELECT COUNT(*) FROM oldtab JOIN gitserver_repos gr ON gr.repo_id = oldtab.id WHERE oldtab.deleted_at is NULL AND oldtab.blocked IS NULL AND gr.clone_status = 'cloning')\n ),\n (\n (SELECT COUNT(*) FROM newtab JOIN gitserver_repos gr ON gr.repo_id = newtab.id WHERE newtab.deleted_at is NULL AND newtab.blocked IS NULL AND gr.clone_status = 'cloned')\n -\n (SELECT COUNT(*) FROM oldtab JOIN gitserver_repos gr ON gr.repo_id = oldtab.id WHERE oldtab.deleted_at is NULL AND oldtab.blocked IS NULL AND gr.clone_status = 'cloned')\n ),\n (\n (SELECT COUNT(*) FROM newtab JOIN gitserver_repos gr ON gr.repo_id = newtab.id WHERE newtab.deleted_at is NULL AND newtab.blocked IS NULL AND gr.last_error IS NOT NULL)\n -\n (SELECT COUNT(*) FROM oldtab JOIN gitserver_repos gr ON gr.repo_id = oldtab.id WHERE oldtab.deleted_at is NULL AND oldtab.blocked IS NULL AND gr.last_error IS NOT NULL)\n ),\n (\n (SELECT COUNT(*) FROM newtab JOIN gitserver_repos gr ON gr.repo_id = newtab.id WHERE newtab.deleted_at is NULL AND newtab.blocked IS NULL AND gr.corrupted_at IS NOT NULL)\n -\n (SELECT COUNT(*) FROM oldtab JOIN gitserver_repos gr ON gr.repo_id = oldtab.id WHERE oldtab.deleted_at is NULL AND oldtab.blocked IS NULL AND gr.corrupted_at IS NOT NULL)\n )\n )\n )\n INSERT INTO\n repo_statistics (total, soft_deleted, not_cloned, cloning, cloned, failed_fetch, corrupted)\n SELECT total, soft_deleted, not_cloned, cloning, cloned, failed_fetch, corrupted\n FROM diff\n WHERE\n total != 0\n OR soft_deleted != 0\n OR not_cloned != 0\n OR cloning != 0\n OR cloned != 0\n OR failed_fetch != 0\n OR corrupted != 0\n ;\n RETURN NULL;\n END\n$function$\n" }, { "Name": "repo_block", "Definition": "CREATE OR REPLACE FUNCTION public.repo_block(reason text, at timestamp with time zone)\n RETURNS jsonb\n LANGUAGE sql\n IMMUTABLE STRICT\nAS $function$\nSELECT jsonb_build_object(\n 'reason', reason,\n 'at', extract(epoch from timezone('utc', at))::bigint\n);\n$function$\n" }, { "Name": "set_repo_stars_null_to_zero", "Definition": "CREATE OR REPLACE PROCEDURE public.set_repo_stars_null_to_zero()\n LANGUAGE plpgsql\nAS $procedure$\nDECLARE\n done boolean;\n total integer = 0;\n updated integer = 0;\n\nBEGIN\n SELECT COUNT(*) INTO total FROM repo WHERE stars IS NULL;\n\n RAISE NOTICE 'repo_stars_null_to_zero: updating % rows', total;\n\n done := total = 0;\n\n WHILE NOT done LOOP\n UPDATE repo SET stars = 0\n FROM (\n SELECT id FROM repo\n WHERE stars IS NULL\n LIMIT 10000\n FOR UPDATE SKIP LOCKED\n ) s\n WHERE repo.id = s.id;\n\n COMMIT;\n\n SELECT COUNT(*) = 0 INTO done FROM repo WHERE stars IS NULL LIMIT 1;\n\n updated := updated + 10000;\n\n RAISE NOTICE 'repo_stars_null_to_zero: updated % of % rows', updated, total;\n END LOOP;\nEND\n$procedure$\n" }, { "Name": "soft_delete_orphan_repo_by_external_service_repos", "Definition": "CREATE OR REPLACE FUNCTION public.soft_delete_orphan_repo_by_external_service_repos()\n RETURNS void\n LANGUAGE plpgsql\nAS $function$\nBEGIN\n -- When an external service is soft or hard-deleted,\n -- performs a clean up to soft-delete orphan repositories.\n UPDATE\n repo\n SET\n name = soft_deleted_repository_name(name),\n deleted_at = transaction_timestamp()\n WHERE\n deleted_at IS NULL\n AND NOT EXISTS (\n SELECT FROM external_service_repos WHERE repo_id = repo.id\n );\nEND;\n$function$\n" }, { "Name": "soft_delete_user_reference_on_external_service", "Definition": "CREATE OR REPLACE FUNCTION public.soft_delete_user_reference_on_external_service()\n RETURNS trigger\n LANGUAGE plpgsql\nAS $function$\nBEGIN\n -- If a user is soft-deleted, delete every row that references that user\n IF (OLD.deleted_at IS NULL AND NEW.deleted_at IS NOT NULL) THEN\n UPDATE external_services\n SET deleted_at = NOW()\n WHERE namespace_user_id = OLD.id;\n END IF;\n\n RETURN OLD;\nEND;\n$function$\n" }, { "Name": "soft_deleted_repository_name", "Definition": "CREATE OR REPLACE FUNCTION public.soft_deleted_repository_name(name text)\n RETURNS text\n LANGUAGE plpgsql\nAS $function$\nBEGIN\n IF name LIKE 'DELETED-%' THEN\n RETURN name;\n ELSE\n RETURN 'DELETED-' || extract(epoch from transaction_timestamp()) || '-' || name;\n END IF;\nEND;\n$function$\n" }, { "Name": "update_codeintel_path_ranks_statistics_columns", "Definition": "CREATE OR REPLACE FUNCTION public.update_codeintel_path_ranks_statistics_columns()\n RETURNS trigger\n LANGUAGE plpgsql\nAS $function$ BEGIN\n SELECT\n COUNT(r.v) AS num_paths,\n SUM(LOG(2, r.v::int + 1)) AS refcount_logsum\n INTO\n NEW.num_paths,\n NEW.refcount_logsum\n FROM jsonb_each(\n CASE WHEN NEW.payload::text = 'null'\n THEN '{}'::jsonb\n ELSE COALESCE(NEW.payload, '{}'::jsonb)\n END\n ) r(k, v);\n\n RETURN NEW;\nEND;\n$function$\n" }, { "Name": "update_codeintel_path_ranks_updated_at_column", "Definition": "CREATE OR REPLACE FUNCTION public.update_codeintel_path_ranks_updated_at_column()\n RETURNS trigger\n LANGUAGE plpgsql\nAS $function$ BEGIN\n NEW.updated_at = NOW();\n RETURN NEW;\nEND;\n$function$\n" }, { "Name": "update_own_aggregate_recent_contribution", "Definition": "CREATE OR REPLACE FUNCTION public.update_own_aggregate_recent_contribution()\n RETURNS trigger\n LANGUAGE plpgsql\nAS $function$\nBEGIN\n WITH RECURSIVE ancestors AS (\n SELECT id, parent_id, 1 AS level\n FROM repo_paths\n WHERE id = NEW.changed_file_path_id\n UNION ALL\n SELECT p.id, p.parent_id, a.level + 1\n FROM repo_paths p\n JOIN ancestors a ON p.id = a.parent_id\n )\n UPDATE own_aggregate_recent_contribution\n SET contributions_count = contributions_count + 1\n WHERE commit_author_id = NEW.commit_author_id AND changed_file_path_id IN (\n SELECT id FROM ancestors\n );\n\n WITH RECURSIVE ancestors AS (\n SELECT id, parent_id, 1 AS level\n FROM repo_paths\n WHERE id = NEW.changed_file_path_id\n UNION ALL\n SELECT p.id, p.parent_id, a.level + 1\n FROM repo_paths p\n JOIN ancestors a ON p.id = a.parent_id\n )\n INSERT INTO own_aggregate_recent_contribution (commit_author_id, changed_file_path_id, contributions_count)\n SELECT NEW.commit_author_id, id, 1\n FROM ancestors\n WHERE NOT EXISTS (\n SELECT 1 FROM own_aggregate_recent_contribution\n WHERE commit_author_id = NEW.commit_author_id AND changed_file_path_id = ancestors.id\n );\n\n RETURN NEW;\nEND;\n$function$\n" }, { "Name": "versions_insert_row_trigger", "Definition": "CREATE OR REPLACE FUNCTION public.versions_insert_row_trigger()\n RETURNS trigger\n LANGUAGE plpgsql\nAS $function$\nBEGIN\n NEW.first_version = NEW.version;\n RETURN NEW;\nEND $function$\n" } ], "Sequences": [ { "Name": "access_requests_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "access_tokens_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "assigned_owners_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "assigned_teams_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "batch_changes_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "batch_changes_site_credentials_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "batch_spec_execution_cache_entries_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "batch_spec_resolution_jobs_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "batch_spec_workspace_execution_jobs_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "batch_spec_workspace_files_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "batch_spec_workspaces_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "batch_specs_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "cached_available_indexers_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "changeset_events_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "changeset_jobs_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "changeset_specs_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "changesets_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "cm_action_jobs_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "cm_emails_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "cm_monitors_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "cm_queries_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "cm_recipients_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "cm_slack_webhooks_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "cm_trigger_jobs_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "cm_webhooks_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "code_hosts_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "codeintel_autoindex_queue_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "codeintel_autoindexing_exceptions_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "codeintel_initial_path_ranks_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "codeintel_initial_path_ranks_processed_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "codeintel_langugage_support_requests_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "codeintel_path_ranks_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "codeintel_ranking_definitions_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "codeintel_ranking_exports_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "codeintel_ranking_graph_keys_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "codeintel_ranking_path_counts_inputs_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "codeintel_ranking_progress_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "codeintel_ranking_references_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "codeintel_ranking_references_processed_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "codeowners_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "codeowners_owners_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "commit_authors_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "configuration_policies_audit_logs_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "context_detection_embedding_jobs_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "critical_and_site_config_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "discussion_comments_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "discussion_threads_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "discussion_threads_target_repo_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "event_logs_export_allowlist_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "event_logs_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "event_logs_scrape_state_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "event_logs_scrape_state_own_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "executor_heartbeats_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "executor_job_tokens_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "executor_secret_access_logs_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "executor_secrets_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "exhaustive_search_jobs_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "exhaustive_search_repo_jobs_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "exhaustive_search_repo_revision_jobs_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "explicit_permissions_bitbucket_projects_jobs_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "external_service_sync_jobs_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "external_services_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "github_app_installs_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "github_apps_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "gitserver_relocator_jobs_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "insights_query_runner_jobs_dependencies_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "insights_query_runner_jobs_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "insights_settings_migration_jobs_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "lsif_configuration_policies_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "lsif_dependency_indexing_jobs_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "lsif_dependency_indexing_jobs_id_seq1", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "lsif_dependency_repos_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "lsif_dumps_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "lsif_index_configuration_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "lsif_indexes_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "lsif_packages_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "lsif_references_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "lsif_retention_configuration_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "lsif_uploads_audit_logs_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "lsif_uploads_vulnerability_scan_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "migration_logs_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "namespace_permissions_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "notebooks_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "org_invitations_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "org_members_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "orgs_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "out_of_band_migrations_errors_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "out_of_band_migrations_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "outbound_webhook_event_types_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "outbound_webhook_jobs_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "outbound_webhook_logs_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "outbound_webhooks_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "own_aggregate_recent_contribution_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "own_aggregate_recent_view_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "own_background_jobs_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "own_signal_configurations_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "own_signal_recent_contribution_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "package_repo_filters_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "package_repo_versions_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "permission_sync_jobs_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "permissions_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "phabricator_repos_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "registry_extension_releases_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "registry_extensions_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "repo_commits_changelists_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "repo_embedding_jobs_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "repo_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "repo_paths_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "roles_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "saved_searches_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "search_contexts_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "security_event_logs_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "settings_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "survey_responses_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "teams_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "temporary_settings_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "user_credentials_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "user_external_accounts_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "user_onboarding_tour_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "user_pending_permissions_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "user_repo_permissions_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "users_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "vulnerabilities_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "vulnerability_affected_packages_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "vulnerability_affected_symbols_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "vulnerability_matches_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" }, { "Name": "webhook_logs_id_seq", "TypeName": "bigint", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 9223372036854775807, "Increment": 1, "CycleOption": "NO" }, { "Name": "webhooks_id_seq", "TypeName": "integer", "StartValue": 1, "MinimumValue": 1, "MaximumValue": 2147483647, "Increment": 1, "CycleOption": "NO" } ], "Tables": [ { "Name": "access_requests", "Comment": "", "Columns": [ { "Name": "additional_info", "Index": 6, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_at", "Index": 2, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "decision_by_user_id", "Index": 8, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "email", "Index": 5, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('access_requests_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "name", "Index": 4, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "status", "Index": 7, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 3, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "access_requests_email_key", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX access_requests_email_key ON access_requests USING btree (email)", "ConstraintType": "u", "ConstraintDefinition": "UNIQUE (email)" }, { "Name": "access_requests_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX access_requests_pkey ON access_requests USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "access_requests_created_at", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX access_requests_created_at ON access_requests USING btree (created_at)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "access_requests_status", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX access_requests_status ON access_requests USING btree (status)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "access_requests_decision_by_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (decision_by_user_id) REFERENCES users(id) ON DELETE SET NULL" } ], "Triggers": [] }, { "Name": "access_tokens", "Comment": "", "Columns": [ { "Name": "created_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "creator_user_id", "Index": 8, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "deleted_at", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('access_tokens_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "internal", "Index": 10, "TypeName": "boolean", "IsNullable": true, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "last_used_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "note", "Index": 4, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "scopes", "Index": 9, "TypeName": "text[]", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "subject_user_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "value_sha256", "Index": 3, "TypeName": "bytea", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "access_tokens_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX access_tokens_pkey ON access_tokens USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "access_tokens_value_sha256_key", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX access_tokens_value_sha256_key ON access_tokens USING btree (value_sha256)", "ConstraintType": "u", "ConstraintDefinition": "UNIQUE (value_sha256)" }, { "Name": "access_tokens_lookup", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX access_tokens_lookup ON access_tokens USING hash (value_sha256) WHERE deleted_at IS NULL", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "access_tokens_creator_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (creator_user_id) REFERENCES users(id)" }, { "Name": "access_tokens_subject_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (subject_user_id) REFERENCES users(id)" } ], "Triggers": [] }, { "Name": "aggregated_user_statistics", "Comment": "", "Columns": [ { "Name": "created_at", "Index": 2, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 3, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "user_events_count", "Index": 5, "TypeName": "bigint", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "user_id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "user_last_active_at", "Index": 4, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "aggregated_user_statistics_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX aggregated_user_statistics_pkey ON aggregated_user_statistics USING btree (user_id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (user_id)" } ], "Constraints": [ { "Name": "aggregated_user_statistics_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "assigned_owners", "Comment": "Table for ownership assignments, one entry contains an assigned user ID, which repo_path is assigned and the date and user who assigned the owner.", "Columns": [ { "Name": "assigned_at", "Index": 5, "TypeName": "timestamp without time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "file_path_id", "Index": 3, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('assigned_owners_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "owner_user_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "who_assigned_user_id", "Index": 4, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "assigned_owners_file_path_owner", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX assigned_owners_file_path_owner ON assigned_owners USING btree (file_path_id, owner_user_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "assigned_owners_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX assigned_owners_pkey ON assigned_owners USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" } ], "Constraints": [ { "Name": "assigned_owners_file_path_id_fkey", "ConstraintType": "f", "RefTableName": "repo_paths", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (file_path_id) REFERENCES repo_paths(id)" }, { "Name": "assigned_owners_owner_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (owner_user_id) REFERENCES users(id) ON DELETE CASCADE DEFERRABLE" }, { "Name": "assigned_owners_who_assigned_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (who_assigned_user_id) REFERENCES users(id) ON DELETE SET NULL DEFERRABLE" } ], "Triggers": [] }, { "Name": "assigned_teams", "Comment": "Table for team ownership assignments, one entry contains an assigned team ID, which repo_path is assigned and the date and user who assigned the owner team.", "Columns": [ { "Name": "assigned_at", "Index": 5, "TypeName": "timestamp without time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "file_path_id", "Index": 3, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('assigned_teams_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "owner_team_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "who_assigned_team_id", "Index": 4, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "assigned_teams_file_path_owner", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX assigned_teams_file_path_owner ON assigned_teams USING btree (file_path_id, owner_team_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "assigned_teams_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX assigned_teams_pkey ON assigned_teams USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" } ], "Constraints": [ { "Name": "assigned_teams_file_path_id_fkey", "ConstraintType": "f", "RefTableName": "repo_paths", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (file_path_id) REFERENCES repo_paths(id)" }, { "Name": "assigned_teams_owner_team_id_fkey", "ConstraintType": "f", "RefTableName": "teams", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (owner_team_id) REFERENCES teams(id) ON DELETE CASCADE DEFERRABLE" }, { "Name": "assigned_teams_who_assigned_team_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (who_assigned_team_id) REFERENCES users(id) ON DELETE SET NULL DEFERRABLE" } ], "Triggers": [] }, { "Name": "batch_changes", "Comment": "", "Columns": [ { "Name": "batch_spec_id", "Index": 10, "TypeName": "bigint", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "closed_at", "Index": 9, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_at", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "creator_id", "Index": 4, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "description", "Index": 3, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('batch_changes_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "last_applied_at", "Index": 12, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "last_applier_id", "Index": 11, "TypeName": "bigint", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "name", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "namespace_org_id", "Index": 6, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "namespace_user_id", "Index": 5, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 8, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "batch_changes_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX batch_changes_pkey ON batch_changes USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "batch_changes_unique_org_id", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX batch_changes_unique_org_id ON batch_changes USING btree (name, namespace_org_id) WHERE namespace_org_id IS NOT NULL", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "batch_changes_unique_user_id", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX batch_changes_unique_user_id ON batch_changes USING btree (name, namespace_user_id) WHERE namespace_user_id IS NOT NULL", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "batch_changes_namespace_org_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX batch_changes_namespace_org_id ON batch_changes USING btree (namespace_org_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "batch_changes_namespace_user_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX batch_changes_namespace_user_id ON batch_changes USING btree (namespace_user_id)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "batch_change_name_is_valid", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (name ~ '^[\\w.-]+$'::text)" }, { "Name": "batch_changes_batch_spec_id_fkey", "ConstraintType": "f", "RefTableName": "batch_specs", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (batch_spec_id) REFERENCES batch_specs(id) DEFERRABLE" }, { "Name": "batch_changes_has_1_namespace", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK ((namespace_user_id IS NULL) \u003c\u003e (namespace_org_id IS NULL))" }, { "Name": "batch_changes_initial_applier_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (creator_id) REFERENCES users(id) ON DELETE SET NULL DEFERRABLE" }, { "Name": "batch_changes_last_applier_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (last_applier_id) REFERENCES users(id) ON DELETE SET NULL DEFERRABLE" }, { "Name": "batch_changes_name_not_blank", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (name \u003c\u003e ''::text)" }, { "Name": "batch_changes_namespace_org_id_fkey", "ConstraintType": "f", "RefTableName": "orgs", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (namespace_org_id) REFERENCES orgs(id) ON DELETE CASCADE DEFERRABLE" }, { "Name": "batch_changes_namespace_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (namespace_user_id) REFERENCES users(id) ON DELETE CASCADE DEFERRABLE" } ], "Triggers": [ { "Name": "trig_delete_batch_change_reference_on_changesets", "Definition": "CREATE TRIGGER trig_delete_batch_change_reference_on_changesets AFTER DELETE ON batch_changes FOR EACH ROW EXECUTE FUNCTION delete_batch_change_reference_on_changesets()" } ] }, { "Name": "batch_changes_site_credentials", "Comment": "", "Columns": [ { "Name": "created_at", "Index": 4, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "credential", "Index": 6, "TypeName": "bytea", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "encryption_key_id", "Index": 7, "TypeName": "text", "IsNullable": false, "Default": "''::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "external_service_id", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "external_service_type", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('batch_changes_site_credentials_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "batch_changes_site_credentials_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX batch_changes_site_credentials_pkey ON batch_changes_site_credentials USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "batch_changes_site_credentials_unique", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX batch_changes_site_credentials_unique ON batch_changes_site_credentials USING btree (external_service_type, external_service_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "batch_changes_site_credentials_credential_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX batch_changes_site_credentials_credential_idx ON batch_changes_site_credentials USING btree ((encryption_key_id = ANY (ARRAY[''::text, 'previously-migrated'::text])))", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": null, "Triggers": [] }, { "Name": "batch_spec_execution_cache_entries", "Comment": "", "Columns": [ { "Name": "created_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('batch_spec_execution_cache_entries_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "key", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "last_used_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "user_id", "Index": 7, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "value", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "version", "Index": 4, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "batch_spec_execution_cache_entries_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX batch_spec_execution_cache_entries_pkey ON batch_spec_execution_cache_entries USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "batch_spec_execution_cache_entries_user_id_key_unique", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX batch_spec_execution_cache_entries_user_id_key_unique ON batch_spec_execution_cache_entries USING btree (user_id, key)", "ConstraintType": "u", "ConstraintDefinition": "UNIQUE (user_id, key)" } ], "Constraints": [ { "Name": "batch_spec_execution_cache_entries_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE DEFERRABLE" } ], "Triggers": [] }, { "Name": "batch_spec_resolution_jobs", "Comment": "", "Columns": [ { "Name": "batch_spec_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "cancel", "Index": 17, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_at", "Index": 13, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "execution_logs", "Index": 10, "TypeName": "json[]", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "failure_message", "Index": 4, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "finished_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('batch_spec_resolution_jobs_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "initiator_id", "Index": 16, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "last_heartbeat_at", "Index": 12, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_failures", "Index": 9, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_resets", "Index": 8, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "process_after", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "queued_at", "Index": 15, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "started_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "state", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "'queued'::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 14, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "worker_hostname", "Index": 11, "TypeName": "text", "IsNullable": false, "Default": "''::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "batch_spec_resolution_jobs_batch_spec_id_unique", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX batch_spec_resolution_jobs_batch_spec_id_unique ON batch_spec_resolution_jobs USING btree (batch_spec_id)", "ConstraintType": "u", "ConstraintDefinition": "UNIQUE (batch_spec_id)" }, { "Name": "batch_spec_resolution_jobs_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX batch_spec_resolution_jobs_pkey ON batch_spec_resolution_jobs USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "batch_spec_resolution_jobs_state", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX batch_spec_resolution_jobs_state ON batch_spec_resolution_jobs USING btree (state)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "batch_spec_resolution_jobs_batch_spec_id_fkey", "ConstraintType": "f", "RefTableName": "batch_specs", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (batch_spec_id) REFERENCES batch_specs(id) ON DELETE CASCADE DEFERRABLE" }, { "Name": "batch_spec_resolution_jobs_initiator_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (initiator_id) REFERENCES users(id) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE" } ], "Triggers": [] }, { "Name": "batch_spec_workspace_execution_jobs", "Comment": "", "Columns": [ { "Name": "batch_spec_workspace_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "cancel", "Index": 15, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_at", "Index": 13, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "execution_logs", "Index": 10, "TypeName": "json[]", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "failure_message", "Index": 4, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "finished_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('batch_spec_workspace_execution_jobs_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "last_heartbeat_at", "Index": 12, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_failures", "Index": 9, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_resets", "Index": 8, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "process_after", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "queued_at", "Index": 17, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "started_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "state", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "'queued'::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 14, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "user_id", "Index": 18, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "version", "Index": 19, "TypeName": "integer", "IsNullable": false, "Default": "1", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "worker_hostname", "Index": 11, "TypeName": "text", "IsNullable": false, "Default": "''::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "batch_spec_workspace_execution_jobs_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX batch_spec_workspace_execution_jobs_pkey ON batch_spec_workspace_execution_jobs USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "batch_spec_workspace_execution_jobs_batch_spec_workspace_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX batch_spec_workspace_execution_jobs_batch_spec_workspace_id ON batch_spec_workspace_execution_jobs USING btree (batch_spec_workspace_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "batch_spec_workspace_execution_jobs_cancel", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX batch_spec_workspace_execution_jobs_cancel ON batch_spec_workspace_execution_jobs USING btree (cancel)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "batch_spec_workspace_execution_jobs_last_dequeue", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX batch_spec_workspace_execution_jobs_last_dequeue ON batch_spec_workspace_execution_jobs USING btree (user_id, started_at DESC)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "batch_spec_workspace_execution_jobs_state", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX batch_spec_workspace_execution_jobs_state ON batch_spec_workspace_execution_jobs USING btree (state)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "batch_spec_workspace_execution_job_batch_spec_workspace_id_fkey", "ConstraintType": "f", "RefTableName": "batch_spec_workspaces", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (batch_spec_workspace_id) REFERENCES batch_spec_workspaces(id) ON DELETE CASCADE DEFERRABLE" } ], "Triggers": [ { "Name": "batch_spec_workspace_execution_last_dequeues_insert", "Definition": "CREATE TRIGGER batch_spec_workspace_execution_last_dequeues_insert AFTER INSERT ON batch_spec_workspace_execution_jobs REFERENCING NEW TABLE AS newtab FOR EACH STATEMENT EXECUTE FUNCTION batch_spec_workspace_execution_last_dequeues_upsert()" }, { "Name": "batch_spec_workspace_execution_last_dequeues_update", "Definition": "CREATE TRIGGER batch_spec_workspace_execution_last_dequeues_update AFTER UPDATE ON batch_spec_workspace_execution_jobs REFERENCING NEW TABLE AS newtab FOR EACH STATEMENT EXECUTE FUNCTION batch_spec_workspace_execution_last_dequeues_upsert()" } ] }, { "Name": "batch_spec_workspace_execution_last_dequeues", "Comment": "", "Columns": [ { "Name": "latest_dequeue", "Index": 2, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "user_id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "batch_spec_workspace_execution_last_dequeues_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX batch_spec_workspace_execution_last_dequeues_pkey ON batch_spec_workspace_execution_last_dequeues USING btree (user_id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (user_id)" } ], "Constraints": [ { "Name": "batch_spec_workspace_execution_last_dequeues_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (user_id) REFERENCES users(id) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED" } ], "Triggers": [] }, { "Name": "batch_spec_workspace_files", "Comment": "", "Columns": [ { "Name": "batch_spec_id", "Index": 3, "TypeName": "bigint", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "content", "Index": 7, "TypeName": "bytea", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_at", "Index": 9, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "filename", "Index": 4, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('batch_spec_workspace_files_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "modified_at", "Index": 8, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "path", "Index": 5, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "rand_id", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "size", "Index": 6, "TypeName": "bigint", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 10, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "batch_spec_workspace_files_batch_spec_id_filename_path", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX batch_spec_workspace_files_batch_spec_id_filename_path ON batch_spec_workspace_files USING btree (batch_spec_id, filename, path)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "batch_spec_workspace_files_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX batch_spec_workspace_files_pkey ON batch_spec_workspace_files USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "batch_spec_workspace_files_rand_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX batch_spec_workspace_files_rand_id ON batch_spec_workspace_files USING btree (rand_id)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "batch_spec_workspace_files_batch_spec_id_fkey", "ConstraintType": "f", "RefTableName": "batch_specs", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (batch_spec_id) REFERENCES batch_specs(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "batch_spec_workspaces", "Comment": "", "Columns": [ { "Name": "batch_spec_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "branch", "Index": 5, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "cached_result_found", "Index": 15, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "changeset_spec_ids", "Index": 3, "TypeName": "jsonb", "IsNullable": false, "Default": "'{}'::jsonb", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "commit", "Index": 6, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_at", "Index": 10, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "file_matches", "Index": 8, "TypeName": "text[]", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('batch_spec_workspaces_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "ignored", "Index": 12, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "only_fetch_workspace", "Index": 9, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "path", "Index": 7, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "repo_id", "Index": 4, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "skipped", "Index": 14, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "step_cache_results", "Index": 16, "TypeName": "jsonb", "IsNullable": false, "Default": "'{}'::jsonb", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "unsupported", "Index": 13, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 11, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "batch_spec_workspaces_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX batch_spec_workspaces_pkey ON batch_spec_workspaces USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "batch_spec_workspaces_batch_spec_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX batch_spec_workspaces_batch_spec_id ON batch_spec_workspaces USING btree (batch_spec_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "batch_spec_workspaces_id_batch_spec_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX batch_spec_workspaces_id_batch_spec_id ON batch_spec_workspaces USING btree (id, batch_spec_id)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "batch_spec_workspaces_batch_spec_id_fkey", "ConstraintType": "f", "RefTableName": "batch_specs", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (batch_spec_id) REFERENCES batch_specs(id) ON DELETE CASCADE DEFERRABLE" }, { "Name": "batch_spec_workspaces_repo_id_fkey", "ConstraintType": "f", "RefTableName": "repo", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (repo_id) REFERENCES repo(id) DEFERRABLE" } ], "Triggers": [] }, { "Name": "batch_specs", "Comment": "", "Columns": [ { "Name": "allow_ignored", "Index": 12, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "allow_unsupported", "Index": 11, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "batch_change_id", "Index": 14, "TypeName": "bigint", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_at", "Index": 8, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_from_raw", "Index": 10, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('batch_specs_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "namespace_org_id", "Index": 6, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "namespace_user_id", "Index": 5, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "no_cache", "Index": 13, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "rand_id", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "raw_spec", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "spec", "Index": 4, "TypeName": "jsonb", "IsNullable": false, "Default": "'{}'::jsonb", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 9, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "user_id", "Index": 7, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "batch_specs_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX batch_specs_pkey ON batch_specs USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "batch_specs_unique_rand_id", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX batch_specs_unique_rand_id ON batch_specs USING btree (rand_id)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "batch_specs_batch_change_id_fkey", "ConstraintType": "f", "RefTableName": "batch_changes", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (batch_change_id) REFERENCES batch_changes(id) ON DELETE SET NULL DEFERRABLE" }, { "Name": "batch_specs_has_1_namespace", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK ((namespace_user_id IS NULL) \u003c\u003e (namespace_org_id IS NULL))" }, { "Name": "batch_specs_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL DEFERRABLE" } ], "Triggers": [] }, { "Name": "cached_available_indexers", "Comment": "", "Columns": [ { "Name": "available_indexers", "Index": 4, "TypeName": "jsonb", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('cached_available_indexers_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_events", "Index": 3, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "repository_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "cached_available_indexers_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX cached_available_indexers_pkey ON cached_available_indexers USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "cached_available_indexers_repository_id", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX cached_available_indexers_repository_id ON cached_available_indexers USING btree (repository_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "cached_available_indexers_num_events", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX cached_available_indexers_num_events ON cached_available_indexers USING btree (num_events DESC) WHERE available_indexers::text \u003c\u003e '{}'::text", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": null, "Triggers": [] }, { "Name": "changeset_events", "Comment": "", "Columns": [ { "Name": "changeset_id", "Index": 2, "TypeName": "bigint", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('changeset_events_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "key", "Index": 4, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "kind", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "metadata", "Index": 6, "TypeName": "jsonb", "IsNullable": false, "Default": "'{}'::jsonb", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "changeset_events_changeset_id_kind_key_unique", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX changeset_events_changeset_id_kind_key_unique ON changeset_events USING btree (changeset_id, kind, key)", "ConstraintType": "u", "ConstraintDefinition": "UNIQUE (changeset_id, kind, key)" }, { "Name": "changeset_events_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX changeset_events_pkey ON changeset_events USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" } ], "Constraints": [ { "Name": "changeset_events_changeset_id_fkey", "ConstraintType": "f", "RefTableName": "changesets", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (changeset_id) REFERENCES changesets(id) ON DELETE CASCADE DEFERRABLE" }, { "Name": "changeset_events_key_check", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (key \u003c\u003e ''::text)" }, { "Name": "changeset_events_kind_check", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (kind \u003c\u003e ''::text)" }, { "Name": "changeset_events_metadata_check", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (jsonb_typeof(metadata) = 'object'::text)" } ], "Triggers": [] }, { "Name": "changeset_jobs", "Comment": "", "Columns": [ { "Name": "batch_change_id", "Index": 4, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "bulk_group", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "cancel", "Index": 21, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "changeset_id", "Index": 5, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_at", "Index": 16, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "execution_logs", "Index": 15, "TypeName": "json[]", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "failure_message", "Index": 9, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "finished_at", "Index": 11, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('changeset_jobs_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "job_type", "Index": 6, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "last_heartbeat_at", "Index": 19, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_failures", "Index": 14, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_resets", "Index": 13, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "payload", "Index": 7, "TypeName": "jsonb", "IsNullable": true, "Default": "'{}'::jsonb", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "process_after", "Index": 12, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "queued_at", "Index": 20, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "started_at", "Index": 10, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "state", "Index": 8, "TypeName": "text", "IsNullable": false, "Default": "'queued'::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 17, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "user_id", "Index": 3, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "worker_hostname", "Index": 18, "TypeName": "text", "IsNullable": false, "Default": "''::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "changeset_jobs_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX changeset_jobs_pkey ON changeset_jobs USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "changeset_jobs_bulk_group_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX changeset_jobs_bulk_group_idx ON changeset_jobs USING btree (bulk_group)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "changeset_jobs_state_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX changeset_jobs_state_idx ON changeset_jobs USING btree (state)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "changeset_jobs_batch_change_id_fkey", "ConstraintType": "f", "RefTableName": "batch_changes", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (batch_change_id) REFERENCES batch_changes(id) ON DELETE CASCADE DEFERRABLE" }, { "Name": "changeset_jobs_changeset_id_fkey", "ConstraintType": "f", "RefTableName": "changesets", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (changeset_id) REFERENCES changesets(id) ON DELETE CASCADE DEFERRABLE" }, { "Name": "changeset_jobs_payload_check", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (jsonb_typeof(payload) = 'object'::text)" }, { "Name": "changeset_jobs_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE DEFERRABLE" } ], "Triggers": [] }, { "Name": "changeset_specs", "Comment": "", "Columns": [ { "Name": "base_ref", "Index": 18, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "base_rev", "Index": 17, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "batch_spec_id", "Index": 4, "TypeName": "bigint", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "body", "Index": 19, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "commit_author_email", "Index": 23, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "commit_author_name", "Index": 22, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "commit_message", "Index": 21, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_at", "Index": 10, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "diff", "Index": 16, "TypeName": "bytea", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "diff_stat_added", "Index": 7, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "diff_stat_deleted", "Index": 9, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "external_id", "Index": 14, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "fork_namespace", "Index": 15, "TypeName": "citext", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "head_ref", "Index": 12, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('changeset_specs_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "published", "Index": 20, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "rand_id", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "repo_id", "Index": 5, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "spec", "Index": 3, "TypeName": "jsonb", "IsNullable": true, "Default": "'{}'::jsonb", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "title", "Index": 13, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "type", "Index": 24, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 11, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "user_id", "Index": 6, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "changeset_specs_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX changeset_specs_pkey ON changeset_specs USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "changeset_specs_unique_rand_id", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX changeset_specs_unique_rand_id ON changeset_specs USING btree (rand_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "changeset_specs_batch_spec_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX changeset_specs_batch_spec_id ON changeset_specs USING btree (batch_spec_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "changeset_specs_created_at", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX changeset_specs_created_at ON changeset_specs USING btree (created_at)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "changeset_specs_external_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX changeset_specs_external_id ON changeset_specs USING btree (external_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "changeset_specs_head_ref", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX changeset_specs_head_ref ON changeset_specs USING btree (head_ref)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "changeset_specs_title", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX changeset_specs_title ON changeset_specs USING btree (title)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "changeset_specs_batch_spec_id_fkey", "ConstraintType": "f", "RefTableName": "batch_specs", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (batch_spec_id) REFERENCES batch_specs(id) ON DELETE CASCADE DEFERRABLE" }, { "Name": "changeset_specs_published_valid_values", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (published = 'true'::text OR published = 'false'::text OR published = '\"draft\"'::text OR published IS NULL)" }, { "Name": "changeset_specs_repo_id_fkey", "ConstraintType": "f", "RefTableName": "repo", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (repo_id) REFERENCES repo(id) DEFERRABLE" }, { "Name": "changeset_specs_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL DEFERRABLE" } ], "Triggers": [] }, { "Name": "changesets", "Comment": "", "Columns": [ { "Name": "batch_change_ids", "Index": 2, "TypeName": "jsonb", "IsNullable": false, "Default": "'{}'::jsonb", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "cancel", "Index": 40, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "closing", "Index": 29, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "commit_verification", "Index": 45, "TypeName": "jsonb", "IsNullable": false, "Default": "'{}'::jsonb", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "computed_state", "Index": 42, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_at", "Index": 4, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "current_spec_id", "Index": 19, "TypeName": "bigint", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "detached_at", "Index": 41, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "diff_stat_added", "Index": 15, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "diff_stat_deleted", "Index": 17, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "execution_logs", "Index": 32, "TypeName": "json[]", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "external_branch", "Index": 10, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "external_check_state", "Index": 14, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "external_deleted_at", "Index": 9, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "external_fork_name", "Index": 43, "TypeName": "citext", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "external_fork_namespace", "Index": 38, "TypeName": "citext", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "external_id", "Index": 7, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "external_review_state", "Index": 13, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "external_service_type", "Index": 8, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "external_state", "Index": 12, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "external_title", "Index": 34, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Normalized property generated on save using Changeset.Title()" }, { "Name": "external_updated_at", "Index": 11, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "failure_message", "Index": 24, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "finished_at", "Index": 26, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('changesets_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "last_heartbeat_at", "Index": 37, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "log_contents", "Index": 31, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "metadata", "Index": 6, "TypeName": "jsonb", "IsNullable": true, "Default": "'{}'::jsonb", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_failures", "Index": 30, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_resets", "Index": 28, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "owned_by_batch_change_id", "Index": 22, "TypeName": "bigint", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "previous_failure_message", "Index": 44, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "previous_spec_id", "Index": 20, "TypeName": "bigint", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "process_after", "Index": 27, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "publication_state", "Index": 21, "TypeName": "text", "IsNullable": true, "Default": "'UNPUBLISHED'::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "queued_at", "Index": 39, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "reconciler_state", "Index": 23, "TypeName": "text", "IsNullable": true, "Default": "'queued'::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "repo_id", "Index": 3, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "started_at", "Index": 25, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "sync_state", "Index": 18, "TypeName": "jsonb", "IsNullable": false, "Default": "'{}'::jsonb", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "syncer_error", "Index": 33, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "ui_publication_state", "Index": 36, "TypeName": "batch_changes_changeset_ui_publication_state", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "worker_hostname", "Index": 35, "TypeName": "text", "IsNullable": false, "Default": "''::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "changesets_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX changesets_pkey ON changesets USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "changesets_repo_external_id_unique", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX changesets_repo_external_id_unique ON changesets USING btree (repo_id, external_id)", "ConstraintType": "u", "ConstraintDefinition": "UNIQUE (repo_id, external_id)" }, { "Name": "changesets_batch_change_ids", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX changesets_batch_change_ids ON changesets USING gin (batch_change_ids)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "changesets_bitbucket_cloud_metadata_source_commit_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX changesets_bitbucket_cloud_metadata_source_commit_idx ON changesets USING btree ((((metadata -\u003e 'source'::text) -\u003e 'commit'::text) -\u003e\u003e 'hash'::text))", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "changesets_changeset_specs", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX changesets_changeset_specs ON changesets USING btree (current_spec_id, previous_spec_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "changesets_computed_state", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX changesets_computed_state ON changesets USING btree (computed_state)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "changesets_detached_at", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX changesets_detached_at ON changesets USING btree (detached_at)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "changesets_external_state_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX changesets_external_state_idx ON changesets USING btree (external_state)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "changesets_external_title_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX changesets_external_title_idx ON changesets USING btree (external_title)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "changesets_publication_state_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX changesets_publication_state_idx ON changesets USING btree (publication_state)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "changesets_reconciler_state_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX changesets_reconciler_state_idx ON changesets USING btree (reconciler_state)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "changesets_batch_change_ids_check", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (jsonb_typeof(batch_change_ids) = 'object'::text)" }, { "Name": "changesets_changeset_spec_id_fkey", "ConstraintType": "f", "RefTableName": "changeset_specs", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (current_spec_id) REFERENCES changeset_specs(id) DEFERRABLE" }, { "Name": "changesets_external_id_check", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (external_id \u003c\u003e ''::text)" }, { "Name": "changesets_external_service_type_not_blank", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (external_service_type \u003c\u003e ''::text)" }, { "Name": "changesets_metadata_check", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (jsonb_typeof(metadata) = 'object'::text)" }, { "Name": "changesets_owned_by_batch_spec_id_fkey", "ConstraintType": "f", "RefTableName": "batch_changes", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (owned_by_batch_change_id) REFERENCES batch_changes(id) ON DELETE SET NULL DEFERRABLE" }, { "Name": "changesets_previous_spec_id_fkey", "ConstraintType": "f", "RefTableName": "changeset_specs", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (previous_spec_id) REFERENCES changeset_specs(id) DEFERRABLE" }, { "Name": "changesets_repo_id_fkey", "ConstraintType": "f", "RefTableName": "repo", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (repo_id) REFERENCES repo(id) ON DELETE CASCADE DEFERRABLE" }, { "Name": "external_branch_ref_prefix", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (external_branch ~~ 'refs/heads/%'::text)" } ], "Triggers": [ { "Name": "changesets_update_computed_state", "Definition": "CREATE TRIGGER changesets_update_computed_state BEFORE INSERT OR UPDATE ON changesets FOR EACH ROW EXECUTE FUNCTION changesets_computed_state_ensure()" } ] }, { "Name": "cm_action_jobs", "Comment": "", "Columns": [ { "Name": "cancel", "Index": 18, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "email", "Index": 2, "TypeName": "bigint", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The ID of the cm_emails action to execute if this is an email job. Mutually exclusive with webhook and slack_webhook" }, { "Name": "execution_logs", "Index": 14, "TypeName": "json[]", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "failure_message", "Index": 4, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "finished_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('cm_action_jobs_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "last_heartbeat_at", "Index": 13, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "log_contents", "Index": 10, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_failures", "Index": 9, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_resets", "Index": 8, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "process_after", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "queued_at", "Index": 17, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "slack_webhook", "Index": 16, "TypeName": "bigint", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The ID of the cm_slack_webhook action to execute if this is a slack webhook job. Mutually exclusive with email and webhook" }, { "Name": "started_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "state", "Index": 3, "TypeName": "text", "IsNullable": true, "Default": "'queued'::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "trigger_event", "Index": 11, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "webhook", "Index": 15, "TypeName": "bigint", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The ID of the cm_webhooks action to execute if this is a webhook job. Mutually exclusive with email and slack_webhook" }, { "Name": "worker_hostname", "Index": 12, "TypeName": "text", "IsNullable": false, "Default": "''::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "cm_action_jobs_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX cm_action_jobs_pkey ON cm_action_jobs USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "cm_action_jobs_state_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX cm_action_jobs_state_idx ON cm_action_jobs USING btree (state)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "cm_action_jobs_trigger_event", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX cm_action_jobs_trigger_event ON cm_action_jobs USING btree (trigger_event)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "cm_action_jobs_email_fk", "ConstraintType": "f", "RefTableName": "cm_emails", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (email) REFERENCES cm_emails(id) ON DELETE CASCADE" }, { "Name": "cm_action_jobs_only_one_action_type", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK ((\nCASE\n WHEN email IS NULL THEN 0\n ELSE 1\nEND +\nCASE\n WHEN webhook IS NULL THEN 0\n ELSE 1\nEND +\nCASE\n WHEN slack_webhook IS NULL THEN 0\n ELSE 1\nEND) = 1)" }, { "Name": "cm_action_jobs_slack_webhook_fkey", "ConstraintType": "f", "RefTableName": "cm_slack_webhooks", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (slack_webhook) REFERENCES cm_slack_webhooks(id) ON DELETE CASCADE" }, { "Name": "cm_action_jobs_trigger_event_fk", "ConstraintType": "f", "RefTableName": "cm_trigger_jobs", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (trigger_event) REFERENCES cm_trigger_jobs(id) ON DELETE CASCADE" }, { "Name": "cm_action_jobs_webhook_fkey", "ConstraintType": "f", "RefTableName": "cm_webhooks", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (webhook) REFERENCES cm_webhooks(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "cm_emails", "Comment": "", "Columns": [ { "Name": "changed_at", "Index": 9, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "changed_by", "Index": 8, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_at", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_by", "Index": 6, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "enabled", "Index": 3, "TypeName": "boolean", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "header", "Index": 5, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('cm_emails_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "include_results", "Index": 10, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "monitor", "Index": 2, "TypeName": "bigint", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "priority", "Index": 4, "TypeName": "cm_email_priority", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "cm_emails_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX cm_emails_pkey ON cm_emails USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" } ], "Constraints": [ { "Name": "cm_emails_changed_by_fk", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (changed_by) REFERENCES users(id) ON DELETE CASCADE" }, { "Name": "cm_emails_created_by_fk", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (created_by) REFERENCES users(id) ON DELETE CASCADE" }, { "Name": "cm_emails_monitor", "ConstraintType": "f", "RefTableName": "cm_monitors", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (monitor) REFERENCES cm_monitors(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "cm_last_searched", "Comment": "The last searched commit hashes for the given code monitor and unique set of search arguments", "Columns": [ { "Name": "commit_oids", "Index": 3, "TypeName": "text[]", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The set of commit OIDs that was previously successfully searched and should be excluded on the next run" }, { "Name": "monitor_id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "repo_id", "Index": 4, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "cm_last_searched_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX cm_last_searched_pkey ON cm_last_searched USING btree (monitor_id, repo_id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (monitor_id, repo_id)" } ], "Constraints": [ { "Name": "cm_last_searched_monitor_id_fkey", "ConstraintType": "f", "RefTableName": "cm_monitors", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (monitor_id) REFERENCES cm_monitors(id) ON DELETE CASCADE" }, { "Name": "cm_last_searched_repo_id_fkey", "ConstraintType": "f", "RefTableName": "repo", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (repo_id) REFERENCES repo(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "cm_monitors", "Comment": "", "Columns": [ { "Name": "changed_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "changed_by", "Index": 6, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_at", "Index": 3, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_by", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "description", "Index": 4, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "enabled", "Index": 7, "TypeName": "boolean", "IsNullable": false, "Default": "true", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('cm_monitors_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "namespace_org_id", "Index": 9, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "DEPRECATED: code monitors cannot be owned by an org" }, { "Name": "namespace_user_id", "Index": 8, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "cm_monitors_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX cm_monitors_pkey ON cm_monitors USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" } ], "Constraints": [ { "Name": "cm_monitors_changed_by_fk", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (changed_by) REFERENCES users(id) ON DELETE CASCADE" }, { "Name": "cm_monitors_created_by_fk", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (created_by) REFERENCES users(id) ON DELETE CASCADE" }, { "Name": "cm_monitors_org_id_fk", "ConstraintType": "f", "RefTableName": "orgs", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (namespace_org_id) REFERENCES orgs(id) ON DELETE CASCADE" }, { "Name": "cm_monitors_user_id_fk", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (namespace_user_id) REFERENCES users(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "cm_queries", "Comment": "", "Columns": [ { "Name": "changed_at", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "changed_by", "Index": 6, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_by", "Index": 4, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('cm_queries_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "latest_result", "Index": 9, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "monitor", "Index": 2, "TypeName": "bigint", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "next_run", "Index": 8, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "query", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "cm_queries_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX cm_queries_pkey ON cm_queries USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" } ], "Constraints": [ { "Name": "cm_triggers_changed_by_fk", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (changed_by) REFERENCES users(id) ON DELETE CASCADE" }, { "Name": "cm_triggers_created_by_fk", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (created_by) REFERENCES users(id) ON DELETE CASCADE" }, { "Name": "cm_triggers_monitor", "ConstraintType": "f", "RefTableName": "cm_monitors", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (monitor) REFERENCES cm_monitors(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "cm_recipients", "Comment": "", "Columns": [ { "Name": "email", "Index": 2, "TypeName": "bigint", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('cm_recipients_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "namespace_org_id", "Index": 4, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "namespace_user_id", "Index": 3, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "cm_recipients_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX cm_recipients_pkey ON cm_recipients USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" } ], "Constraints": [ { "Name": "cm_recipients_emails", "ConstraintType": "f", "RefTableName": "cm_emails", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (email) REFERENCES cm_emails(id) ON DELETE CASCADE" }, { "Name": "cm_recipients_org_id_fk", "ConstraintType": "f", "RefTableName": "orgs", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (namespace_org_id) REFERENCES orgs(id) ON DELETE CASCADE" }, { "Name": "cm_recipients_user_id_fk", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (namespace_user_id) REFERENCES users(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "cm_slack_webhooks", "Comment": "Slack webhook actions configured on code monitors", "Columns": [ { "Name": "changed_at", "Index": 8, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "changed_by", "Index": 7, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_by", "Index": 5, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "enabled", "Index": 4, "TypeName": "boolean", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('cm_slack_webhooks_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "include_results", "Index": 9, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "monitor", "Index": 2, "TypeName": "bigint", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The code monitor that the action is defined on" }, { "Name": "url", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The Slack webhook URL we send the code monitor event to" } ], "Indexes": [ { "Name": "cm_slack_webhooks_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX cm_slack_webhooks_pkey ON cm_slack_webhooks USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "cm_slack_webhooks_monitor", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX cm_slack_webhooks_monitor ON cm_slack_webhooks USING btree (monitor)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "cm_slack_webhooks_changed_by_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (changed_by) REFERENCES users(id) ON DELETE CASCADE" }, { "Name": "cm_slack_webhooks_created_by_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (created_by) REFERENCES users(id) ON DELETE CASCADE" }, { "Name": "cm_slack_webhooks_monitor_fkey", "ConstraintType": "f", "RefTableName": "cm_monitors", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (monitor) REFERENCES cm_monitors(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "cm_trigger_jobs", "Comment": "", "Columns": [ { "Name": "cancel", "Index": 19, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "execution_logs", "Index": 16, "TypeName": "json[]", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "failure_message", "Index": 4, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "finished_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('cm_trigger_jobs_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "last_heartbeat_at", "Index": 15, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "log_contents", "Index": 10, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_failures", "Index": 9, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_resets", "Index": 8, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "process_after", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "query", "Index": 2, "TypeName": "bigint", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "query_string", "Index": 11, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "queued_at", "Index": 18, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "search_results", "Index": 17, "TypeName": "jsonb", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "started_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "state", "Index": 3, "TypeName": "text", "IsNullable": true, "Default": "'queued'::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "worker_hostname", "Index": 14, "TypeName": "text", "IsNullable": false, "Default": "''::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "cm_trigger_jobs_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX cm_trigger_jobs_pkey ON cm_trigger_jobs USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "cm_trigger_jobs_finished_at", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX cm_trigger_jobs_finished_at ON cm_trigger_jobs USING btree (finished_at)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "cm_trigger_jobs_state_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX cm_trigger_jobs_state_idx ON cm_trigger_jobs USING btree (state)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "cm_trigger_jobs_query_fk", "ConstraintType": "f", "RefTableName": "cm_queries", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (query) REFERENCES cm_queries(id) ON DELETE CASCADE" }, { "Name": "search_results_is_array", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (jsonb_typeof(search_results) = 'array'::text)" } ], "Triggers": [] }, { "Name": "cm_webhooks", "Comment": "Webhook actions configured on code monitors", "Columns": [ { "Name": "changed_at", "Index": 8, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "changed_by", "Index": 7, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_by", "Index": 5, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "enabled", "Index": 4, "TypeName": "boolean", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Whether this Slack webhook action is enabled. When not enabled, the action will not be run when its code monitor generates events" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('cm_webhooks_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "include_results", "Index": 9, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "monitor", "Index": 2, "TypeName": "bigint", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The code monitor that the action is defined on" }, { "Name": "url", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The webhook URL we send the code monitor event to" } ], "Indexes": [ { "Name": "cm_webhooks_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX cm_webhooks_pkey ON cm_webhooks USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "cm_webhooks_monitor", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX cm_webhooks_monitor ON cm_webhooks USING btree (monitor)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "cm_webhooks_changed_by_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (changed_by) REFERENCES users(id) ON DELETE CASCADE" }, { "Name": "cm_webhooks_created_by_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (created_by) REFERENCES users(id) ON DELETE CASCADE" }, { "Name": "cm_webhooks_monitor_fkey", "ConstraintType": "f", "RefTableName": "cm_monitors", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (monitor) REFERENCES cm_monitors(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "code_hosts", "Comment": "", "Columns": [ { "Name": "api_rate_limit_interval_seconds", "Index": 5, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "api_rate_limit_quota", "Index": 4, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_at", "Index": 8, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "git_rate_limit_interval_seconds", "Index": 7, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "git_rate_limit_quota", "Index": 6, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('code_hosts_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "kind", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 9, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "url", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "code_hosts_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX code_hosts_pkey ON code_hosts USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "code_hosts_url_key", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX code_hosts_url_key ON code_hosts USING btree (url)", "ConstraintType": "u", "ConstraintDefinition": "UNIQUE (url)" } ], "Constraints": null, "Triggers": [] }, { "Name": "codeintel_autoindex_queue", "Comment": "", "Columns": [ { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('codeintel_autoindex_queue_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "processed_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "queued_at", "Index": 4, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "repository_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "rev", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "codeintel_autoindex_queue_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX codeintel_autoindex_queue_pkey ON codeintel_autoindex_queue USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "codeintel_autoindex_queue_repository_id_commit", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX codeintel_autoindex_queue_repository_id_commit ON codeintel_autoindex_queue USING btree (repository_id, rev)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": null, "Triggers": [] }, { "Name": "codeintel_autoindexing_exceptions", "Comment": "", "Columns": [ { "Name": "disable_inference", "Index": 4, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "disable_scheduling", "Index": 3, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('codeintel_autoindexing_exceptions_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "repository_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "codeintel_autoindexing_exceptions_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX codeintel_autoindexing_exceptions_pkey ON codeintel_autoindexing_exceptions USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "codeintel_autoindexing_exceptions_repository_id_key", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX codeintel_autoindexing_exceptions_repository_id_key ON codeintel_autoindexing_exceptions USING btree (repository_id)", "ConstraintType": "u", "ConstraintDefinition": "UNIQUE (repository_id)" } ], "Constraints": [ { "Name": "codeintel_autoindexing_exceptions_repository_id_fkey", "ConstraintType": "f", "RefTableName": "repo", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (repository_id) REFERENCES repo(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "codeintel_commit_dates", "Comment": "Maps commits within a repository to the commit date as reported by gitserver.", "Columns": [ { "Name": "commit_bytea", "Index": 2, "TypeName": "bytea", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Identifies the 40-character commit hash." }, { "Name": "committed_at", "Index": 3, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The commit date (may be -infinity if unresolvable)." }, { "Name": "repository_id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Identifies a row in the `repo` table." } ], "Indexes": [ { "Name": "codeintel_commit_dates_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX codeintel_commit_dates_pkey ON codeintel_commit_dates USING btree (repository_id, commit_bytea)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (repository_id, commit_bytea)" } ], "Constraints": null, "Triggers": [] }, { "Name": "codeintel_inference_scripts", "Comment": "Contains auto-index job inference Lua scripts as an alternative to setting via environment variables.", "Columns": [ { "Name": "insert_timestamp", "Index": 1, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "script", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [], "Constraints": null, "Triggers": [] }, { "Name": "codeintel_initial_path_ranks", "Comment": "", "Columns": [ { "Name": "document_path", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "''::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "document_paths", "Index": 6, "TypeName": "text[]", "IsNullable": false, "Default": "'{}'::text[]", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "exported_upload_id", "Index": 8, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "graph_key", "Index": 4, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('codeintel_initial_path_ranks_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "codeintel_initial_path_ranks_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX codeintel_initial_path_ranks_pkey ON codeintel_initial_path_ranks USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "codeintel_initial_path_ranks_exported_upload_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX codeintel_initial_path_ranks_exported_upload_id ON codeintel_initial_path_ranks USING btree (exported_upload_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "codeintel_initial_path_ranks_graph_key_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX codeintel_initial_path_ranks_graph_key_id ON codeintel_initial_path_ranks USING btree (graph_key, id)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "codeintel_initial_path_ranks_exported_upload_id_fkey", "ConstraintType": "f", "RefTableName": "codeintel_ranking_exports", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (exported_upload_id) REFERENCES codeintel_ranking_exports(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "codeintel_initial_path_ranks_processed", "Comment": "", "Columns": [ { "Name": "codeintel_initial_path_ranks_id", "Index": 3, "TypeName": "bigint", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "graph_key", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('codeintel_initial_path_ranks_processed_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "codeintel_initial_path_ranks_processed_cgraph_key_codeintel_ini", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX codeintel_initial_path_ranks_processed_cgraph_key_codeintel_ini ON codeintel_initial_path_ranks_processed USING btree (graph_key, codeintel_initial_path_ranks_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "codeintel_initial_path_ranks_processed_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX codeintel_initial_path_ranks_processed_pkey ON codeintel_initial_path_ranks_processed USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "codeintel_initial_path_ranks_processed_codeintel_initial_path_r", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX codeintel_initial_path_ranks_processed_codeintel_initial_path_r ON codeintel_initial_path_ranks_processed USING btree (codeintel_initial_path_ranks_id)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "fk_codeintel_initial_path_ranks", "ConstraintType": "f", "RefTableName": "codeintel_initial_path_ranks", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (codeintel_initial_path_ranks_id) REFERENCES codeintel_initial_path_ranks(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "codeintel_langugage_support_requests", "Comment": "", "Columns": [ { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('codeintel_langugage_support_requests_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "language_id", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "user_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "codeintel_langugage_support_requests_user_id_language", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX codeintel_langugage_support_requests_user_id_language ON codeintel_langugage_support_requests USING btree (user_id, language_id)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": null, "Triggers": [] }, { "Name": "codeintel_path_ranks", "Comment": "", "Columns": [ { "Name": "graph_key", "Index": 5, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 8, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('codeintel_path_ranks_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_paths", "Index": 6, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "payload", "Index": 2, "TypeName": "jsonb", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "refcount_logsum", "Index": 7, "TypeName": "double precision", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "repository_id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 4, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "codeintel_path_ranks_graph_key_repository_id", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX codeintel_path_ranks_graph_key_repository_id ON codeintel_path_ranks USING btree (graph_key, repository_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "codeintel_path_ranks_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX codeintel_path_ranks_pkey ON codeintel_path_ranks USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "codeintel_path_ranks_graph_key", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX codeintel_path_ranks_graph_key ON codeintel_path_ranks USING btree (graph_key, updated_at NULLS FIRST, id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "codeintel_path_ranks_repository_id_updated_at_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX codeintel_path_ranks_repository_id_updated_at_id ON codeintel_path_ranks USING btree (repository_id, updated_at NULLS FIRST, id)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": null, "Triggers": [ { "Name": "insert_codeintel_path_ranks_statistics", "Definition": "CREATE TRIGGER insert_codeintel_path_ranks_statistics BEFORE INSERT ON codeintel_path_ranks FOR EACH ROW EXECUTE FUNCTION update_codeintel_path_ranks_statistics_columns()" }, { "Name": "update_codeintel_path_ranks_statistics", "Definition": "CREATE TRIGGER update_codeintel_path_ranks_statistics BEFORE UPDATE ON codeintel_path_ranks FOR EACH ROW WHEN (new.* IS DISTINCT FROM old.*) EXECUTE FUNCTION update_codeintel_path_ranks_statistics_columns()" }, { "Name": "update_codeintel_path_ranks_updated_at", "Definition": "CREATE TRIGGER update_codeintel_path_ranks_updated_at BEFORE UPDATE ON codeintel_path_ranks FOR EACH ROW WHEN (new.* IS DISTINCT FROM old.*) EXECUTE FUNCTION update_codeintel_path_ranks_updated_at_column()" } ] }, { "Name": "codeintel_ranking_definitions", "Comment": "", "Columns": [ { "Name": "document_path", "Index": 5, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "exported_upload_id", "Index": 9, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "graph_key", "Index": 6, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('codeintel_ranking_definitions_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "symbol_checksum", "Index": 10, "TypeName": "bytea", "IsNullable": false, "Default": "'\\x'::bytea", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "symbol_name", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "codeintel_ranking_definitions_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX codeintel_ranking_definitions_pkey ON codeintel_ranking_definitions USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "codeintel_ranking_definitions_exported_upload_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX codeintel_ranking_definitions_exported_upload_id ON codeintel_ranking_definitions USING btree (exported_upload_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "codeintel_ranking_definitions_graph_key_symbol_checksum_search", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX codeintel_ranking_definitions_graph_key_symbol_checksum_search ON codeintel_ranking_definitions USING btree (graph_key, symbol_checksum, exported_upload_id, document_path)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "codeintel_ranking_definitions_exported_upload_id_fkey", "ConstraintType": "f", "RefTableName": "codeintel_ranking_exports", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (exported_upload_id) REFERENCES codeintel_ranking_exports(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "codeintel_ranking_exports", "Comment": "", "Columns": [ { "Name": "deleted_at", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "graph_key", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 4, "TypeName": "integer", "IsNullable": false, "Default": "nextval('codeintel_ranking_exports_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "last_scanned_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "locked_at", "Index": 3, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "upload_id", "Index": 1, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "upload_key", "Index": 8, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "codeintel_ranking_exports_graph_key_upload_id", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX codeintel_ranking_exports_graph_key_upload_id ON codeintel_ranking_exports USING btree (graph_key, upload_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "codeintel_ranking_exports_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX codeintel_ranking_exports_pkey ON codeintel_ranking_exports USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "codeintel_ranking_exports_graph_key_deleted_at_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX codeintel_ranking_exports_graph_key_deleted_at_id ON codeintel_ranking_exports USING btree (graph_key, deleted_at DESC, id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "codeintel_ranking_exports_graph_key_last_scanned_at", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX codeintel_ranking_exports_graph_key_last_scanned_at ON codeintel_ranking_exports USING btree (graph_key, last_scanned_at NULLS FIRST, id)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "codeintel_ranking_exports_upload_id_fkey", "ConstraintType": "f", "RefTableName": "lsif_uploads", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (upload_id) REFERENCES lsif_uploads(id) ON DELETE SET NULL" } ], "Triggers": [] }, { "Name": "codeintel_ranking_graph_keys", "Comment": "", "Columns": [ { "Name": "created_at", "Index": 3, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "graph_key", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('codeintel_ranking_graph_keys_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "codeintel_ranking_graph_keys_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX codeintel_ranking_graph_keys_pkey ON codeintel_ranking_graph_keys USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" } ], "Constraints": null, "Triggers": [] }, { "Name": "codeintel_ranking_path_counts_inputs", "Comment": "", "Columns": [ { "Name": "count", "Index": 4, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "definition_id", "Index": 8, "TypeName": "bigint", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "graph_key", "Index": 5, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('codeintel_ranking_path_counts_inputs_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "processed", "Index": 6, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "codeintel_ranking_path_counts_inputs_graph_key_unique_definitio", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX codeintel_ranking_path_counts_inputs_graph_key_unique_definitio ON codeintel_ranking_path_counts_inputs USING btree (graph_key, definition_id) WHERE NOT processed", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "codeintel_ranking_path_counts_inputs_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX codeintel_ranking_path_counts_inputs_pkey ON codeintel_ranking_path_counts_inputs USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "codeintel_ranking_path_counts_inputs_graph_key_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX codeintel_ranking_path_counts_inputs_graph_key_id ON codeintel_ranking_path_counts_inputs USING btree (graph_key, id)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": null, "Triggers": [] }, { "Name": "codeintel_ranking_progress", "Comment": "", "Columns": [ { "Name": "graph_key", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('codeintel_ranking_progress_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "mapper_completed_at", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "mappers_started_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "max_export_id", "Index": 20, "TypeName": "bigint", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_count_records_processed", "Index": 16, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_count_records_total", "Index": 13, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_path_records_processed", "Index": 14, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_path_records_total", "Index": 11, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_reference_records_processed", "Index": 15, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_reference_records_total", "Index": 12, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "path_cursor_deleted_export_at", "Index": 23, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "path_cursor_export_id", "Index": 24, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "reducer_completed_at", "Index": 10, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "reducer_started_at", "Index": 9, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "reference_cursor_export_deleted_at", "Index": 21, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "reference_cursor_export_id", "Index": 22, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "seed_mapper_completed_at", "Index": 8, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "codeintel_ranking_progress_graph_key_key", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX codeintel_ranking_progress_graph_key_key ON codeintel_ranking_progress USING btree (graph_key)", "ConstraintType": "u", "ConstraintDefinition": "UNIQUE (graph_key)" }, { "Name": "codeintel_ranking_progress_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX codeintel_ranking_progress_pkey ON codeintel_ranking_progress USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" } ], "Constraints": null, "Triggers": [] }, { "Name": "codeintel_ranking_references", "Comment": "References for a given upload proceduced by background job consuming SCIP indexes.", "Columns": [ { "Name": "exported_upload_id", "Index": 8, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "graph_key", "Index": 4, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('codeintel_ranking_references_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "symbol_checksums", "Index": 9, "TypeName": "bytea[]", "IsNullable": false, "Default": "'{}'::bytea[]", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "symbol_names", "Index": 3, "TypeName": "text[]", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "codeintel_ranking_references_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX codeintel_ranking_references_pkey ON codeintel_ranking_references USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "codeintel_ranking_references_exported_upload_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX codeintel_ranking_references_exported_upload_id ON codeintel_ranking_references USING btree (exported_upload_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "codeintel_ranking_references_graph_key_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX codeintel_ranking_references_graph_key_id ON codeintel_ranking_references USING btree (graph_key, id)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "codeintel_ranking_references_exported_upload_id_fkey", "ConstraintType": "f", "RefTableName": "codeintel_ranking_exports", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (exported_upload_id) REFERENCES codeintel_ranking_exports(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "codeintel_ranking_references_processed", "Comment": "", "Columns": [ { "Name": "codeintel_ranking_reference_id", "Index": 3, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "graph_key", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 4, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('codeintel_ranking_references_processed_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "codeintel_ranking_references_processed_graph_key_codeintel_rank", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX codeintel_ranking_references_processed_graph_key_codeintel_rank ON codeintel_ranking_references_processed USING btree (graph_key, codeintel_ranking_reference_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "codeintel_ranking_references_processed_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX codeintel_ranking_references_processed_pkey ON codeintel_ranking_references_processed USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "codeintel_ranking_references_processed_reference_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX codeintel_ranking_references_processed_reference_id ON codeintel_ranking_references_processed USING btree (codeintel_ranking_reference_id)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "fk_codeintel_ranking_reference", "ConstraintType": "f", "RefTableName": "codeintel_ranking_references", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (codeintel_ranking_reference_id) REFERENCES codeintel_ranking_references(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "codeowners", "Comment": "", "Columns": [ { "Name": "contents", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "contents_proto", "Index": 3, "TypeName": "bytea", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('codeowners_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "repo_id", "Index": 4, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "codeowners_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX codeowners_pkey ON codeowners USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "codeowners_repo_id_key", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX codeowners_repo_id_key ON codeowners USING btree (repo_id)", "ConstraintType": "u", "ConstraintDefinition": "UNIQUE (repo_id)" } ], "Constraints": [ { "Name": "codeowners_repo_id_fkey", "ConstraintType": "f", "RefTableName": "repo", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (repo_id) REFERENCES repo(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "codeowners_individual_stats", "Comment": "Data on how many files in given tree are owned by given owner.\n\nAs opposed to ownership-general `ownership_path_stats` table, the individual \u003cpath x owner\u003e stats\nare stored in CODEOWNERS-specific table `codeowners_individual_stats`. The reason for that is that\nwe are also indexing on owner_id which is CODEOWNERS-specific.", "Columns": [ { "Name": "file_path_id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "owner_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "tree_owned_files_count", "Index": 3, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Total owned file count by given owner at given file tree." }, { "Name": "updated_at", "Index": 4, "TypeName": "timestamp without time zone", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "When the last background job updating counts run." } ], "Indexes": [ { "Name": "codeowners_individual_stats_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX codeowners_individual_stats_pkey ON codeowners_individual_stats USING btree (file_path_id, owner_id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (file_path_id, owner_id)" } ], "Constraints": [ { "Name": "codeowners_individual_stats_file_path_id_fkey", "ConstraintType": "f", "RefTableName": "repo_paths", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (file_path_id) REFERENCES repo_paths(id)" }, { "Name": "codeowners_individual_stats_owner_id_fkey", "ConstraintType": "f", "RefTableName": "codeowners_owners", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (owner_id) REFERENCES codeowners_owners(id)" } ], "Triggers": [] }, { "Name": "codeowners_owners", "Comment": "Text reference in CODEOWNERS entry to use in codeowners_individual_stats. Reference is either email or handle without @ in front.", "Columns": [ { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('codeowners_owners_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "reference", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "We just keep the reference as opposed to splitting it to handle or email\nsince the distinction is not relevant for query, and this makes indexing way easier." } ], "Indexes": [ { "Name": "codeowners_owners_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX codeowners_owners_pkey ON codeowners_owners USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "codeowners_owners_reference", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX codeowners_owners_reference ON codeowners_owners USING btree (reference)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": null, "Triggers": [] }, { "Name": "commit_authors", "Comment": "", "Columns": [ { "Name": "email", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('commit_authors_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "name", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "commit_authors_email_name", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX commit_authors_email_name ON commit_authors USING btree (email, name)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "commit_authors_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX commit_authors_pkey ON commit_authors USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" } ], "Constraints": null, "Triggers": [] }, { "Name": "configuration_policies_audit_logs", "Comment": "", "Columns": [ { "Name": "log_timestamp", "Index": 1, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "clock_timestamp()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Timestamp for this log entry." }, { "Name": "operation", "Index": 6, "TypeName": "audit_log_operation", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "policy_id", "Index": 3, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "record_deleted_at", "Index": 2, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Set once the upload this entry is associated with is deleted. Once NOW() - record_deleted_at is above a certain threshold, this log entry will be deleted." }, { "Name": "sequence", "Index": 5, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('configuration_policies_audit_logs_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "transition_columns", "Index": 4, "TypeName": "USER-DEFINED[]", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Array of changes that occurred to the upload for this entry, in the form of {\"column\"=\u003e\"\u003ccolumn name\u003e\", \"old\"=\u003e\"\u003cprevious value\u003e\", \"new\"=\u003e\"\u003cnew value\u003e\"}." } ], "Indexes": [ { "Name": "configuration_policies_audit_logs_policy_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX configuration_policies_audit_logs_policy_id ON configuration_policies_audit_logs USING btree (policy_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "configuration_policies_audit_logs_timestamp", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX configuration_policies_audit_logs_timestamp ON configuration_policies_audit_logs USING brin (log_timestamp)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": null, "Triggers": [] }, { "Name": "context_detection_embedding_jobs", "Comment": "", "Columns": [ { "Name": "cancel", "Index": 13, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "execution_logs", "Index": 11, "TypeName": "json[]", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "failure_message", "Index": 3, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "finished_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('context_detection_embedding_jobs_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "last_heartbeat_at", "Index": 10, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_failures", "Index": 9, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_resets", "Index": 8, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "process_after", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "queued_at", "Index": 4, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "started_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "state", "Index": 2, "TypeName": "text", "IsNullable": true, "Default": "'queued'::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "worker_hostname", "Index": 12, "TypeName": "text", "IsNullable": false, "Default": "''::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "context_detection_embedding_jobs_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX context_detection_embedding_jobs_pkey ON context_detection_embedding_jobs USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" } ], "Constraints": null, "Triggers": [] }, { "Name": "critical_and_site_config", "Comment": "", "Columns": [ { "Name": "author_user_id", "Index": 6, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "A null value indicates that this config was most likely added by code on the start-up path, for example from the SITE_CONFIG_FILE unless the config itself was added before this column existed in which case it could also have been a user." }, { "Name": "contents", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_at", "Index": 4, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('critical_and_site_config_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "redacted_contents", "Index": 7, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "This column stores the contents but redacts all secrets. The redacted form is a sha256 hash of the secret appended to the REDACTED string. This is used to generate diffs between two subsequent changes in a way that allows us to detect changes to any secrets while also ensuring that we do not leak it in the diff. A null value indicates that this config was added before this column was added or redacting the secrets during write failed so we skipped writing to this column instead of a hard failure." }, { "Name": "type", "Index": 2, "TypeName": "critical_or_site", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "critical_and_site_config_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX critical_and_site_config_pkey ON critical_and_site_config USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "critical_and_site_config_unique", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX critical_and_site_config_unique ON critical_and_site_config USING btree (id, type)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": null, "Triggers": [] }, { "Name": "discussion_comments", "Comment": "", "Columns": [ { "Name": "author_user_id", "Index": 3, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "contents", "Index": 4, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "deleted_at", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('discussion_comments_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "reports", "Index": 8, "TypeName": "text[]", "IsNullable": false, "Default": "'{}'::text[]", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "thread_id", "Index": 2, "TypeName": "bigint", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "discussion_comments_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX discussion_comments_pkey ON discussion_comments USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "discussion_comments_author_user_id_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX discussion_comments_author_user_id_idx ON discussion_comments USING btree (author_user_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "discussion_comments_reports_array_length_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX discussion_comments_reports_array_length_idx ON discussion_comments USING btree (array_length(reports, 1))", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "discussion_comments_thread_id_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX discussion_comments_thread_id_idx ON discussion_comments USING btree (thread_id)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "discussion_comments_author_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (author_user_id) REFERENCES users(id) ON DELETE RESTRICT" }, { "Name": "discussion_comments_thread_id_fkey", "ConstraintType": "f", "RefTableName": "discussion_threads", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (thread_id) REFERENCES discussion_threads(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "discussion_mail_reply_tokens", "Comment": "", "Columns": [ { "Name": "deleted_at", "Index": 4, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "thread_id", "Index": 3, "TypeName": "bigint", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "token", "Index": 1, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "user_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "discussion_mail_reply_tokens_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX discussion_mail_reply_tokens_pkey ON discussion_mail_reply_tokens USING btree (token)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (token)" }, { "Name": "discussion_mail_reply_tokens_user_id_thread_id_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX discussion_mail_reply_tokens_user_id_thread_id_idx ON discussion_mail_reply_tokens USING btree (user_id, thread_id)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "discussion_mail_reply_tokens_thread_id_fkey", "ConstraintType": "f", "RefTableName": "discussion_threads", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (thread_id) REFERENCES discussion_threads(id) ON DELETE CASCADE" }, { "Name": "discussion_mail_reply_tokens_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE RESTRICT" } ], "Triggers": [] }, { "Name": "discussion_threads", "Comment": "", "Columns": [ { "Name": "archived_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "author_user_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "deleted_at", "Index": 8, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('discussion_threads_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "target_repo_id", "Index": 4, "TypeName": "bigint", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "title", "Index": 3, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "discussion_threads_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX discussion_threads_pkey ON discussion_threads USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "discussion_threads_author_user_id_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX discussion_threads_author_user_id_idx ON discussion_threads USING btree (author_user_id)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "discussion_threads_author_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (author_user_id) REFERENCES users(id) ON DELETE RESTRICT" }, { "Name": "discussion_threads_target_repo_id_fk", "ConstraintType": "f", "RefTableName": "discussion_threads_target_repo", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (target_repo_id) REFERENCES discussion_threads_target_repo(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "discussion_threads_target_repo", "Comment": "", "Columns": [ { "Name": "branch", "Index": 5, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "end_character", "Index": 10, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "end_line", "Index": 8, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('discussion_threads_target_repo_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "lines", "Index": 12, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "lines_after", "Index": 13, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "lines_before", "Index": 11, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "path", "Index": 4, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "repo_id", "Index": 3, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "revision", "Index": 6, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "start_character", "Index": 9, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "start_line", "Index": 7, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "thread_id", "Index": 2, "TypeName": "bigint", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "discussion_threads_target_repo_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX discussion_threads_target_repo_pkey ON discussion_threads_target_repo USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "discussion_threads_target_repo_repo_id_path_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX discussion_threads_target_repo_repo_id_path_idx ON discussion_threads_target_repo USING btree (repo_id, path)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "discussion_threads_target_repo_repo_id_fkey", "ConstraintType": "f", "RefTableName": "repo", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (repo_id) REFERENCES repo(id) ON DELETE CASCADE" }, { "Name": "discussion_threads_target_repo_thread_id_fkey", "ConstraintType": "f", "RefTableName": "discussion_threads", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (thread_id) REFERENCES discussion_threads(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "event_logs", "Comment": "", "Columns": [ { "Name": "anonymous_user_id", "Index": 5, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "argument", "Index": 7, "TypeName": "jsonb", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "billing_event_id", "Index": 19, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "billing_product_category", "Index": 18, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "client", "Index": 20, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "cohort_id", "Index": 11, "TypeName": "date", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "device_id", "Index": 16, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "feature_flags", "Index": 10, "TypeName": "jsonb", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "first_source_url", "Index": 13, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('event_logs_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "insert_id", "Index": 17, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "last_source_url", "Index": 14, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "name", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "public_argument", "Index": 12, "TypeName": "jsonb", "IsNullable": false, "Default": "'{}'::jsonb", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "referrer", "Index": 15, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "source", "Index": 6, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "timestamp", "Index": 9, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "url", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "user_id", "Index": 4, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "version", "Index": 8, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "event_logs_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX event_logs_pkey ON event_logs USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "event_logs_anonymous_user_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX event_logs_anonymous_user_id ON event_logs USING btree (anonymous_user_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "event_logs_name_timestamp", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX event_logs_name_timestamp ON event_logs USING btree (name, \"timestamp\" DESC)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "event_logs_source", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX event_logs_source ON event_logs USING btree (source)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "event_logs_timestamp", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX event_logs_timestamp ON event_logs USING btree (\"timestamp\")", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "event_logs_timestamp_at_utc", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX event_logs_timestamp_at_utc ON event_logs USING btree (date(timezone('UTC'::text, \"timestamp\")))", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "event_logs_user_id_name", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX event_logs_user_id_name ON event_logs USING btree (user_id, name)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "event_logs_user_id_timestamp", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX event_logs_user_id_timestamp ON event_logs USING btree (user_id, \"timestamp\")", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "event_logs_check_has_user", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (user_id = 0 AND anonymous_user_id \u003c\u003e ''::text OR user_id \u003c\u003e 0 AND anonymous_user_id = ''::text OR user_id \u003c\u003e 0 AND anonymous_user_id \u003c\u003e ''::text)" }, { "Name": "event_logs_check_name_not_empty", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (name \u003c\u003e ''::text)" }, { "Name": "event_logs_check_source_not_empty", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (source \u003c\u003e ''::text)" }, { "Name": "event_logs_check_version_not_empty", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (version \u003c\u003e ''::text)" } ], "Triggers": [] }, { "Name": "event_logs_export_allowlist", "Comment": "An allowlist of events that are approved for export if the scraping job is enabled", "Columns": [ { "Name": "event_name", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Name of the event that corresponds to event_logs.name" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('event_logs_export_allowlist_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "event_logs_export_allowlist_event_name_idx", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX event_logs_export_allowlist_event_name_idx ON event_logs_export_allowlist USING btree (event_name)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "event_logs_export_allowlist_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX event_logs_export_allowlist_pkey ON event_logs_export_allowlist USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" } ], "Constraints": null, "Triggers": [] }, { "Name": "event_logs_scrape_state", "Comment": "Contains state for the periodic telemetry job that scrapes events if enabled.", "Columns": [ { "Name": "bookmark_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Bookmarks the maximum most recent successful event_logs.id that was scraped" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('event_logs_scrape_state_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "event_logs_scrape_state_pk", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX event_logs_scrape_state_pk ON event_logs_scrape_state USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" } ], "Constraints": null, "Triggers": [] }, { "Name": "event_logs_scrape_state_own", "Comment": "Contains state for own jobs that scrape events if enabled.", "Columns": [ { "Name": "bookmark_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Bookmarks the maximum most recent successful event_logs.id that was scraped" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('event_logs_scrape_state_own_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "job_type", "Index": 3, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "event_logs_scrape_state_own_pk", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX event_logs_scrape_state_own_pk ON event_logs_scrape_state_own USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" } ], "Constraints": null, "Triggers": [] }, { "Name": "executor_heartbeats", "Comment": "Tracks the most recent activity of executors attached to this Sourcegraph instance.", "Columns": [ { "Name": "architecture", "Index": 5, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The machine architure running the executor." }, { "Name": "docker_version", "Index": 6, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The version of Docker used by the executor." }, { "Name": "executor_version", "Index": 7, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The version of the executor." }, { "Name": "first_seen_at", "Index": 11, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The first time a heartbeat from the executor was received." }, { "Name": "git_version", "Index": 8, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The version of Git used by the executor." }, { "Name": "hostname", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The uniquely identifying name of the executor." }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('executor_heartbeats_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "ignite_version", "Index": 9, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The version of Ignite used by the executor." }, { "Name": "last_seen_at", "Index": 12, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The last time a heartbeat from the executor was received." }, { "Name": "os", "Index": 4, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The operating system running the executor." }, { "Name": "queue_name", "Index": 3, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The queue name that the executor polls for work." }, { "Name": "queue_names", "Index": 13, "TypeName": "text[]", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The list of queue names that the executor polls for work." }, { "Name": "src_cli_version", "Index": 10, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The version of src-cli used by the executor." } ], "Indexes": [ { "Name": "executor_heartbeats_hostname_key", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX executor_heartbeats_hostname_key ON executor_heartbeats USING btree (hostname)", "ConstraintType": "u", "ConstraintDefinition": "UNIQUE (hostname)" }, { "Name": "executor_heartbeats_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX executor_heartbeats_pkey ON executor_heartbeats USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" } ], "Constraints": [ { "Name": "one_of_queue_name_queue_names", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (queue_name IS NOT NULL AND queue_names IS NULL OR queue_names IS NOT NULL AND queue_name IS NULL)" } ], "Triggers": [] }, { "Name": "executor_job_tokens", "Comment": "", "Columns": [ { "Name": "created_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('executor_job_tokens_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "job_id", "Index": 3, "TypeName": "bigint", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "queue", "Index": 4, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "repo_id", "Index": 5, "TypeName": "bigint", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "value_sha256", "Index": 2, "TypeName": "bytea", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "executor_job_tokens_job_id_queue_repo_id_key", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX executor_job_tokens_job_id_queue_repo_id_key ON executor_job_tokens USING btree (job_id, queue, repo_id)", "ConstraintType": "u", "ConstraintDefinition": "UNIQUE (job_id, queue, repo_id)" }, { "Name": "executor_job_tokens_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX executor_job_tokens_pkey ON executor_job_tokens USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "executor_job_tokens_value_sha256_key", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX executor_job_tokens_value_sha256_key ON executor_job_tokens USING btree (value_sha256)", "ConstraintType": "u", "ConstraintDefinition": "UNIQUE (value_sha256)" } ], "Constraints": null, "Triggers": [] }, { "Name": "executor_secret_access_logs", "Comment": "", "Columns": [ { "Name": "created_at", "Index": 4, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "executor_secret_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('executor_secret_access_logs_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "machine_user", "Index": 5, "TypeName": "text", "IsNullable": false, "Default": "''::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "user_id", "Index": 3, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "executor_secret_access_logs_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX executor_secret_access_logs_pkey ON executor_secret_access_logs USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" } ], "Constraints": [ { "Name": "executor_secret_access_logs_executor_secret_id_fkey", "ConstraintType": "f", "RefTableName": "executor_secrets", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (executor_secret_id) REFERENCES executor_secrets(id) ON DELETE CASCADE" }, { "Name": "executor_secret_access_logs_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE" }, { "Name": "user_id_or_machine_user", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (user_id IS NULL AND machine_user \u003c\u003e ''::text OR user_id IS NOT NULL AND machine_user = ''::text)" } ], "Triggers": [] }, { "Name": "executor_secrets", "Comment": "", "Columns": [ { "Name": "created_at", "Index": 8, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "creator_id", "Index": 10, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "NULL, if the user has been deleted." }, { "Name": "encryption_key_id", "Index": 5, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('executor_secrets_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "key", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "namespace_org_id", "Index": 7, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "namespace_user_id", "Index": 6, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "scope", "Index": 4, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 9, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "value", "Index": 3, "TypeName": "bytea", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "executor_secrets_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX executor_secrets_pkey ON executor_secrets USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "executor_secrets_unique_key_global", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX executor_secrets_unique_key_global ON executor_secrets USING btree (key, scope) WHERE namespace_user_id IS NULL AND namespace_org_id IS NULL", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "executor_secrets_unique_key_namespace_org", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX executor_secrets_unique_key_namespace_org ON executor_secrets USING btree (key, namespace_org_id, scope) WHERE namespace_org_id IS NOT NULL", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "executor_secrets_unique_key_namespace_user", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX executor_secrets_unique_key_namespace_user ON executor_secrets USING btree (key, namespace_user_id, scope) WHERE namespace_user_id IS NOT NULL", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "executor_secrets_creator_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (creator_id) REFERENCES users(id) ON DELETE SET NULL" }, { "Name": "executor_secrets_namespace_org_id_fkey", "ConstraintType": "f", "RefTableName": "orgs", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (namespace_org_id) REFERENCES orgs(id) ON DELETE CASCADE" }, { "Name": "executor_secrets_namespace_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (namespace_user_id) REFERENCES users(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "exhaustive_search_jobs", "Comment": "", "Columns": [ { "Name": "cancel", "Index": 14, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_at", "Index": 15, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "execution_logs", "Index": 12, "TypeName": "json[]", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "failure_message", "Index": 5, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "finished_at", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('exhaustive_search_jobs_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "initiator_id", "Index": 3, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "last_heartbeat_at", "Index": 11, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_failures", "Index": 10, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_resets", "Index": 9, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "process_after", "Index": 8, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "query", "Index": 4, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "queued_at", "Index": 17, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "started_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "state", "Index": 2, "TypeName": "text", "IsNullable": true, "Default": "'queued'::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 16, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "worker_hostname", "Index": 13, "TypeName": "text", "IsNullable": false, "Default": "''::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "exhaustive_search_jobs_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX exhaustive_search_jobs_pkey ON exhaustive_search_jobs USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" } ], "Constraints": [ { "Name": "exhaustive_search_jobs_initiator_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (initiator_id) REFERENCES users(id) ON UPDATE CASCADE ON DELETE CASCADE DEFERRABLE" } ], "Triggers": [] }, { "Name": "exhaustive_search_repo_jobs", "Comment": "", "Columns": [ { "Name": "cancel", "Index": 15, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_at", "Index": 16, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "execution_logs", "Index": 13, "TypeName": "json[]", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "failure_message", "Index": 6, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "finished_at", "Index": 8, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('exhaustive_search_repo_jobs_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "last_heartbeat_at", "Index": 12, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_failures", "Index": 11, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_resets", "Index": 10, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "process_after", "Index": 9, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "queued_at", "Index": 18, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "ref_spec", "Index": 4, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "repo_id", "Index": 3, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "search_job_id", "Index": 5, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "started_at", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "state", "Index": 2, "TypeName": "text", "IsNullable": true, "Default": "'queued'::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 17, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "worker_hostname", "Index": 14, "TypeName": "text", "IsNullable": false, "Default": "''::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "exhaustive_search_repo_jobs_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX exhaustive_search_repo_jobs_pkey ON exhaustive_search_repo_jobs USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" } ], "Constraints": [ { "Name": "exhaustive_search_repo_jobs_repo_id_fkey", "ConstraintType": "f", "RefTableName": "repo", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (repo_id) REFERENCES repo(id) ON DELETE CASCADE" }, { "Name": "exhaustive_search_repo_jobs_search_job_id_fkey", "ConstraintType": "f", "RefTableName": "exhaustive_search_jobs", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (search_job_id) REFERENCES exhaustive_search_jobs(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "exhaustive_search_repo_revision_jobs", "Comment": "", "Columns": [ { "Name": "cancel", "Index": 14, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_at", "Index": 15, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "execution_logs", "Index": 12, "TypeName": "json[]", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "failure_message", "Index": 5, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "finished_at", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('exhaustive_search_repo_revision_jobs_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "last_heartbeat_at", "Index": 11, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_failures", "Index": 10, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_resets", "Index": 9, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "process_after", "Index": 8, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "queued_at", "Index": 17, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "revision", "Index": 4, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "search_repo_job_id", "Index": 3, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "started_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "state", "Index": 2, "TypeName": "text", "IsNullable": true, "Default": "'queued'::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 16, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "worker_hostname", "Index": 13, "TypeName": "text", "IsNullable": false, "Default": "''::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "exhaustive_search_repo_revision_jobs_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX exhaustive_search_repo_revision_jobs_pkey ON exhaustive_search_repo_revision_jobs USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" } ], "Constraints": [ { "Name": "exhaustive_search_repo_revision_jobs_search_repo_job_id_fkey", "ConstraintType": "f", "RefTableName": "exhaustive_search_repo_jobs", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (search_repo_job_id) REFERENCES exhaustive_search_repo_jobs(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "explicit_permissions_bitbucket_projects_jobs", "Comment": "", "Columns": [ { "Name": "cancel", "Index": 17, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "execution_logs", "Index": 11, "TypeName": "json[]", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "external_service_id", "Index": 14, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "failure_message", "Index": 3, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "finished_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('explicit_permissions_bitbucket_projects_jobs_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "last_heartbeat_at", "Index": 10, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_failures", "Index": 9, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_resets", "Index": 8, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "permissions", "Index": 15, "TypeName": "json[]", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "process_after", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "project_key", "Index": 13, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "queued_at", "Index": 4, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "started_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "state", "Index": 2, "TypeName": "text", "IsNullable": true, "Default": "'queued'::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "unrestricted", "Index": 16, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "worker_hostname", "Index": 12, "TypeName": "text", "IsNullable": false, "Default": "''::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "explicit_permissions_bitbucket_projects_jobs_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX explicit_permissions_bitbucket_projects_jobs_pkey ON explicit_permissions_bitbucket_projects_jobs USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "explicit_permissions_bitbucket_projects_jobs_project_key_extern", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX explicit_permissions_bitbucket_projects_jobs_project_key_extern ON explicit_permissions_bitbucket_projects_jobs USING btree (project_key, external_service_id, state)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "explicit_permissions_bitbucket_projects_jobs_queued_at_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX explicit_permissions_bitbucket_projects_jobs_queued_at_idx ON explicit_permissions_bitbucket_projects_jobs USING btree (queued_at)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "explicit_permissions_bitbucket_projects_jobs_state_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX explicit_permissions_bitbucket_projects_jobs_state_idx ON explicit_permissions_bitbucket_projects_jobs USING btree (state)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "explicit_permissions_bitbucket_projects_jobs_check", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (permissions IS NOT NULL AND unrestricted IS FALSE OR permissions IS NULL AND unrestricted IS TRUE)" } ], "Triggers": [] }, { "Name": "external_service_repos", "Comment": "", "Columns": [ { "Name": "clone_url", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "transaction_timestamp()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "external_service_id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "org_id", "Index": 5, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "repo_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "user_id", "Index": 4, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "external_service_repos_repo_id_external_service_id_unique", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX external_service_repos_repo_id_external_service_id_unique ON external_service_repos USING btree (repo_id, external_service_id)", "ConstraintType": "u", "ConstraintDefinition": "UNIQUE (repo_id, external_service_id)" }, { "Name": "external_service_repos_clone_url_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX external_service_repos_clone_url_idx ON external_service_repos USING btree (clone_url)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "external_service_repos_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX external_service_repos_idx ON external_service_repos USING btree (external_service_id, repo_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "external_service_repos_org_id_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX external_service_repos_org_id_idx ON external_service_repos USING btree (org_id) WHERE org_id IS NOT NULL", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "external_service_user_repos_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX external_service_user_repos_idx ON external_service_repos USING btree (user_id, repo_id) WHERE user_id IS NOT NULL", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "external_service_repos_external_service_id_fkey", "ConstraintType": "f", "RefTableName": "external_services", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (external_service_id) REFERENCES external_services(id) ON DELETE CASCADE DEFERRABLE" }, { "Name": "external_service_repos_org_id_fkey", "ConstraintType": "f", "RefTableName": "orgs", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (org_id) REFERENCES orgs(id) ON DELETE CASCADE" }, { "Name": "external_service_repos_repo_id_fkey", "ConstraintType": "f", "RefTableName": "repo", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (repo_id) REFERENCES repo(id) ON DELETE CASCADE DEFERRABLE" }, { "Name": "external_service_repos_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE DEFERRABLE" } ], "Triggers": [] }, { "Name": "external_service_sync_jobs", "Comment": "", "Columns": [ { "Name": "cancel", "Index": 15, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "execution_logs", "Index": 11, "TypeName": "json[]", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "external_service_id", "Index": 8, "TypeName": "bigint", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "failure_message", "Index": 3, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "finished_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('external_service_sync_jobs_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "last_heartbeat_at", "Index": 13, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "log_contents", "Index": 10, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_failures", "Index": 9, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_resets", "Index": 7, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "process_after", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "queued_at", "Index": 14, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "repo_sync_errors", "Index": 17, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The number of times an error occurred syncing a repo during this sync job." }, { "Name": "repos_added", "Index": 18, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The number of new repos discovered during this sync job." }, { "Name": "repos_deleted", "Index": 19, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The number of repos deleted as a result of this sync job." }, { "Name": "repos_modified", "Index": 20, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The number of existing repos whose metadata has changed during this sync job." }, { "Name": "repos_synced", "Index": 16, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The number of repos synced during this sync job." }, { "Name": "repos_unmodified", "Index": 21, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The number of existing repos whose metadata did not change during this sync job." }, { "Name": "started_at", "Index": 4, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "state", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "'queued'::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "worker_hostname", "Index": 12, "TypeName": "text", "IsNullable": false, "Default": "''::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "external_service_sync_jobs_state_external_service_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX external_service_sync_jobs_state_external_service_id ON external_service_sync_jobs USING btree (state, external_service_id) INCLUDE (finished_at)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "external_services_id_fk", "ConstraintType": "f", "RefTableName": "external_services", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (external_service_id) REFERENCES external_services(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "external_services", "Comment": "", "Columns": [ { "Name": "cloud_default", "Index": 12, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "code_host_id", "Index": 17, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "config", "Index": 4, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "deleted_at", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "display_name", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "encryption_key_id", "Index": 13, "TypeName": "text", "IsNullable": false, "Default": "''::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "has_webhooks", "Index": 15, "TypeName": "boolean", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('external_services_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "kind", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "last_sync_at", "Index": 8, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "namespace_org_id", "Index": 14, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "namespace_user_id", "Index": 10, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "next_sync_at", "Index": 9, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "token_expires_at", "Index": 16, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "unrestricted", "Index": 11, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "external_services_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX external_services_pkey ON external_services USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "external_services_unique_kind_org_id", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX external_services_unique_kind_org_id ON external_services USING btree (kind, namespace_org_id) WHERE deleted_at IS NULL AND namespace_user_id IS NULL AND namespace_org_id IS NOT NULL", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "external_services_unique_kind_user_id", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX external_services_unique_kind_user_id ON external_services USING btree (kind, namespace_user_id) WHERE deleted_at IS NULL AND namespace_org_id IS NULL AND namespace_user_id IS NOT NULL", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "kind_cloud_default", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX kind_cloud_default ON external_services USING btree (kind, cloud_default) WHERE cloud_default = true AND deleted_at IS NULL", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "external_services_has_webhooks_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX external_services_has_webhooks_idx ON external_services USING btree (has_webhooks)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "external_services_namespace_org_id_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX external_services_namespace_org_id_idx ON external_services USING btree (namespace_org_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "external_services_namespace_user_id_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX external_services_namespace_user_id_idx ON external_services USING btree (namespace_user_id)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "check_non_empty_config", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (btrim(config) \u003c\u003e ''::text)" }, { "Name": "external_services_code_host_id_fkey", "ConstraintType": "f", "RefTableName": "code_hosts", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (code_host_id) REFERENCES code_hosts(id) ON UPDATE CASCADE ON DELETE SET NULL DEFERRABLE INITIALLY DEFERRED" }, { "Name": "external_services_max_1_namespace", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (namespace_user_id IS NULL AND namespace_org_id IS NULL OR (namespace_user_id IS NULL) \u003c\u003e (namespace_org_id IS NULL))" }, { "Name": "external_services_namepspace_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (namespace_user_id) REFERENCES users(id) ON DELETE CASCADE DEFERRABLE" }, { "Name": "external_services_namespace_org_id_fkey", "ConstraintType": "f", "RefTableName": "orgs", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (namespace_org_id) REFERENCES orgs(id) ON DELETE CASCADE DEFERRABLE" } ], "Triggers": [] }, { "Name": "feature_flag_overrides", "Comment": "", "Columns": [ { "Name": "created_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "deleted_at", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "flag_name", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "flag_value", "Index": 4, "TypeName": "boolean", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "namespace_org_id", "Index": 1, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "namespace_user_id", "Index": 2, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "feature_flag_overrides_unique_org_flag", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX feature_flag_overrides_unique_org_flag ON feature_flag_overrides USING btree (namespace_org_id, flag_name)", "ConstraintType": "u", "ConstraintDefinition": "UNIQUE (namespace_org_id, flag_name)" }, { "Name": "feature_flag_overrides_unique_user_flag", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX feature_flag_overrides_unique_user_flag ON feature_flag_overrides USING btree (namespace_user_id, flag_name)", "ConstraintType": "u", "ConstraintDefinition": "UNIQUE (namespace_user_id, flag_name)" }, { "Name": "feature_flag_overrides_org_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX feature_flag_overrides_org_id ON feature_flag_overrides USING btree (namespace_org_id) WHERE namespace_org_id IS NOT NULL", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "feature_flag_overrides_user_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX feature_flag_overrides_user_id ON feature_flag_overrides USING btree (namespace_user_id) WHERE namespace_user_id IS NOT NULL", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "feature_flag_overrides_flag_name_fkey", "ConstraintType": "f", "RefTableName": "feature_flags", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (flag_name) REFERENCES feature_flags(flag_name) ON UPDATE CASCADE ON DELETE CASCADE" }, { "Name": "feature_flag_overrides_has_org_or_user_id", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (namespace_org_id IS NOT NULL OR namespace_user_id IS NOT NULL)" }, { "Name": "feature_flag_overrides_namespace_org_id_fkey", "ConstraintType": "f", "RefTableName": "orgs", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (namespace_org_id) REFERENCES orgs(id) ON DELETE CASCADE" }, { "Name": "feature_flag_overrides_namespace_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (namespace_user_id) REFERENCES users(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "feature_flags", "Comment": "", "Columns": [ { "Name": "bool_value", "Index": 3, "TypeName": "boolean", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Bool value only defined when flag_type is bool" }, { "Name": "created_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "deleted_at", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "flag_name", "Index": 1, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "flag_type", "Index": 2, "TypeName": "feature_flag_type", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "rollout", "Index": 4, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Rollout only defined when flag_type is rollout. Increments of 0.01%" }, { "Name": "updated_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "feature_flags_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX feature_flags_pkey ON feature_flags USING btree (flag_name)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (flag_name)" } ], "Constraints": [ { "Name": "feature_flags_rollout_check", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (rollout \u003e= 0 AND rollout \u003c= 10000)" }, { "Name": "required_bool_fields", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (1 =\nCASE\n WHEN flag_type = 'bool'::feature_flag_type AND bool_value IS NULL THEN 0\n WHEN flag_type \u003c\u003e 'bool'::feature_flag_type AND bool_value IS NOT NULL THEN 0\n ELSE 1\nEND)" }, { "Name": "required_rollout_fields", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (1 =\nCASE\n WHEN flag_type = 'rollout'::feature_flag_type AND rollout IS NULL THEN 0\n WHEN flag_type \u003c\u003e 'rollout'::feature_flag_type AND rollout IS NOT NULL THEN 0\n ELSE 1\nEND)" } ], "Triggers": [] }, { "Name": "github_app_installs", "Comment": "", "Columns": [ { "Name": "account_avatar_url", "Index": 7, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "account_login", "Index": 6, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "account_type", "Index": 9, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "account_url", "Index": 8, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "app_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_at", "Index": 4, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('github_app_installs_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "installation_id", "Index": 3, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 10, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "url", "Index": 5, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "github_app_installs_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX github_app_installs_pkey ON github_app_installs USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "unique_app_install", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX unique_app_install ON github_app_installs USING btree (app_id, installation_id)", "ConstraintType": "u", "ConstraintDefinition": "UNIQUE (app_id, installation_id)" }, { "Name": "app_id_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX app_id_idx ON github_app_installs USING btree (app_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "github_app_installs_account_login", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX github_app_installs_account_login ON github_app_installs USING btree (account_login)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "installation_id_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX installation_id_idx ON github_app_installs USING btree (installation_id)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "github_app_installs_app_id_fkey", "ConstraintType": "f", "RefTableName": "github_apps", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (app_id) REFERENCES github_apps(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "github_apps", "Comment": "", "Columns": [ { "Name": "app_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "app_url", "Index": 13, "TypeName": "text", "IsNullable": false, "Default": "''::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "base_url", "Index": 5, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "client_id", "Index": 6, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "client_secret", "Index": 7, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_at", "Index": 11, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "domain", "Index": 15, "TypeName": "text", "IsNullable": false, "Default": "'repos'::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "encryption_key_id", "Index": 9, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('github_apps_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "logo", "Index": 10, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "name", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "private_key", "Index": 8, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "slug", "Index": 4, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 12, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "webhook_id", "Index": 14, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "github_apps_app_id_slug_base_url_unique", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX github_apps_app_id_slug_base_url_unique ON github_apps USING btree (app_id, slug, base_url)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "github_apps_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX github_apps_pkey ON github_apps USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" } ], "Constraints": [ { "Name": "github_apps_webhook_id_fkey", "ConstraintType": "f", "RefTableName": "webhooks", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (webhook_id) REFERENCES webhooks(id) ON DELETE SET NULL" } ], "Triggers": [] }, { "Name": "gitserver_relocator_jobs", "Comment": "", "Columns": [ { "Name": "cancel", "Index": 17, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "delete_source", "Index": 16, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "dest_hostname", "Index": 15, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "execution_logs", "Index": 11, "TypeName": "json[]", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "failure_message", "Index": 4, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "finished_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('gitserver_relocator_jobs_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "last_heartbeat_at", "Index": 10, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_failures", "Index": 9, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_resets", "Index": 8, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "process_after", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "queued_at", "Index": 3, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "repo_id", "Index": 13, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "source_hostname", "Index": 14, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "started_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "state", "Index": 2, "TypeName": "text", "IsNullable": true, "Default": "'queued'::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "worker_hostname", "Index": 12, "TypeName": "text", "IsNullable": false, "Default": "''::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "gitserver_relocator_jobs_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX gitserver_relocator_jobs_pkey ON gitserver_relocator_jobs USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "gitserver_relocator_jobs_state", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX gitserver_relocator_jobs_state ON gitserver_relocator_jobs USING btree (state)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": null, "Triggers": [] }, { "Name": "gitserver_repos", "Comment": "", "Columns": [ { "Name": "clone_status", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "'not_cloned'::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "cloning_progress", "Index": 12, "TypeName": "text", "IsNullable": true, "Default": "''::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "corrupted_at", "Index": 10, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Timestamp of when repo corruption was detected" }, { "Name": "corruption_logs", "Index": 11, "TypeName": "jsonb", "IsNullable": false, "Default": "'[]'::jsonb", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Log output of repo corruptions that have been detected - encoded as json" }, { "Name": "last_changed", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "last_error", "Index": 4, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "last_fetched", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "repo_id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "repo_size_bytes", "Index": 8, "TypeName": "bigint", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "shard_id", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "gitserver_repos_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX gitserver_repos_pkey ON gitserver_repos USING btree (repo_id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (repo_id)" }, { "Name": "gitserver_repo_size_bytes", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX gitserver_repo_size_bytes ON gitserver_repos USING btree (repo_size_bytes)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "gitserver_repos_cloned_status_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX gitserver_repos_cloned_status_idx ON gitserver_repos USING btree (repo_id) WHERE clone_status = 'cloned'::text", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "gitserver_repos_cloning_status_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX gitserver_repos_cloning_status_idx ON gitserver_repos USING btree (repo_id) WHERE clone_status = 'cloning'::text", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "gitserver_repos_last_changed_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX gitserver_repos_last_changed_idx ON gitserver_repos USING btree (last_changed, repo_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "gitserver_repos_last_error_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX gitserver_repos_last_error_idx ON gitserver_repos USING btree (repo_id) WHERE last_error IS NOT NULL", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "gitserver_repos_not_cloned_status_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX gitserver_repos_not_cloned_status_idx ON gitserver_repos USING btree (repo_id) WHERE clone_status = 'not_cloned'::text", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "gitserver_repos_not_explicitly_cloned_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX gitserver_repos_not_explicitly_cloned_idx ON gitserver_repos USING btree (repo_id) WHERE clone_status \u003c\u003e 'cloned'::text", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "gitserver_repos_shard_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX gitserver_repos_shard_id ON gitserver_repos USING btree (shard_id, repo_id)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "gitserver_repos_repo_id_fkey", "ConstraintType": "f", "RefTableName": "repo", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (repo_id) REFERENCES repo(id) ON DELETE CASCADE" } ], "Triggers": [ { "Name": "trig_recalc_gitserver_repos_statistics_on_delete", "Definition": "CREATE TRIGGER trig_recalc_gitserver_repos_statistics_on_delete AFTER DELETE ON gitserver_repos REFERENCING OLD TABLE AS oldtab FOR EACH STATEMENT EXECUTE FUNCTION recalc_gitserver_repos_statistics_on_delete()" }, { "Name": "trig_recalc_gitserver_repos_statistics_on_insert", "Definition": "CREATE TRIGGER trig_recalc_gitserver_repos_statistics_on_insert AFTER INSERT ON gitserver_repos REFERENCING NEW TABLE AS newtab FOR EACH STATEMENT EXECUTE FUNCTION recalc_gitserver_repos_statistics_on_insert()" }, { "Name": "trig_recalc_gitserver_repos_statistics_on_update", "Definition": "CREATE TRIGGER trig_recalc_gitserver_repos_statistics_on_update AFTER UPDATE ON gitserver_repos REFERENCING OLD TABLE AS oldtab NEW TABLE AS newtab FOR EACH STATEMENT EXECUTE FUNCTION recalc_gitserver_repos_statistics_on_update()" } ] }, { "Name": "gitserver_repos_statistics", "Comment": "", "Columns": [ { "Name": "cloned", "Index": 5, "TypeName": "bigint", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Number of repositories in gitserver_repos table on this shard that are cloned" }, { "Name": "cloning", "Index": 4, "TypeName": "bigint", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Number of repositories in gitserver_repos table on this shard that cloning" }, { "Name": "corrupted", "Index": 7, "TypeName": "bigint", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Number of repositories that are NOT soft-deleted and not blocked and have corrupted_at set in gitserver_repos table" }, { "Name": "failed_fetch", "Index": 6, "TypeName": "bigint", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Number of repositories in gitserver_repos table on this shard where last_error is set" }, { "Name": "not_cloned", "Index": 3, "TypeName": "bigint", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Number of repositories in gitserver_repos table on this shard that are not cloned yet" }, { "Name": "shard_id", "Index": 1, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "ID of this gitserver shard. If an empty string then the repositories havent been assigned a shard." }, { "Name": "total", "Index": 2, "TypeName": "bigint", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Number of repositories in gitserver_repos table on this shard" } ], "Indexes": [ { "Name": "gitserver_repos_statistics_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX gitserver_repos_statistics_pkey ON gitserver_repos_statistics USING btree (shard_id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (shard_id)" } ], "Constraints": null, "Triggers": [] }, { "Name": "gitserver_repos_sync_output", "Comment": "Contains the most recent output from gitserver repository sync jobs.", "Columns": [ { "Name": "last_output", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "''::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "repo_id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 3, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "gitserver_repos_sync_output_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX gitserver_repos_sync_output_pkey ON gitserver_repos_sync_output USING btree (repo_id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (repo_id)" } ], "Constraints": [ { "Name": "gitserver_repos_sync_output_repo_id_fkey", "ConstraintType": "f", "RefTableName": "repo", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (repo_id) REFERENCES repo(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "global_state", "Comment": "", "Columns": [ { "Name": "initialized", "Index": 2, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "site_id", "Index": 1, "TypeName": "uuid", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "global_state_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX global_state_pkey ON global_state USING btree (site_id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (site_id)" } ], "Constraints": null, "Triggers": [] }, { "Name": "insights_query_runner_jobs", "Comment": "See [internal/insights/background/queryrunner/worker.go:Job](https://sourcegraph.com/search?q=repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+file:internal/insights/background/queryrunner/worker.go+type+Job\u0026patternType=literal)", "Columns": [ { "Name": "cancel", "Index": 19, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "cost", "Index": 16, "TypeName": "integer", "IsNullable": false, "Default": "500", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Integer representing a cost approximation of executing this search query." }, { "Name": "execution_logs", "Index": 11, "TypeName": "json[]", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "failure_message", "Index": 5, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "finished_at", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('insights_query_runner_jobs_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "last_heartbeat_at", "Index": 14, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_failures", "Index": 10, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_resets", "Index": 9, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "persist_mode", "Index": 17, "TypeName": "persistmode", "IsNullable": false, "Default": "'record'::persistmode", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The persistence level for this query. This value will determine the lifecycle of the resulting value." }, { "Name": "priority", "Index": 15, "TypeName": "integer", "IsNullable": false, "Default": "1", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Integer representing a category of priority for this query. Priority in this context is ambiguously defined for consumers to decide an interpretation." }, { "Name": "process_after", "Index": 8, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "queued_at", "Index": 18, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "record_time", "Index": 12, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "search_query", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "series_id", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "started_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "state", "Index": 4, "TypeName": "text", "IsNullable": true, "Default": "'queued'::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "trace_id", "Index": 20, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "worker_hostname", "Index": 13, "TypeName": "text", "IsNullable": false, "Default": "''::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "insights_query_runner_jobs_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX insights_query_runner_jobs_pkey ON insights_query_runner_jobs USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "finished_at_insights_query_runner_jobs_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX finished_at_insights_query_runner_jobs_idx ON insights_query_runner_jobs USING btree (finished_at)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "insights_query_runner_jobs_cost_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX insights_query_runner_jobs_cost_idx ON insights_query_runner_jobs USING btree (cost)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "insights_query_runner_jobs_priority_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX insights_query_runner_jobs_priority_idx ON insights_query_runner_jobs USING btree (priority)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "insights_query_runner_jobs_processable_priority_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX insights_query_runner_jobs_processable_priority_id ON insights_query_runner_jobs USING btree (priority, id) WHERE state = 'queued'::text OR state = 'errored'::text", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "insights_query_runner_jobs_series_id_state", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX insights_query_runner_jobs_series_id_state ON insights_query_runner_jobs USING btree (series_id, state)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "insights_query_runner_jobs_state_btree", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX insights_query_runner_jobs_state_btree ON insights_query_runner_jobs USING btree (state)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "process_after_insights_query_runner_jobs_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX process_after_insights_query_runner_jobs_idx ON insights_query_runner_jobs USING btree (process_after)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": null, "Triggers": [] }, { "Name": "insights_query_runner_jobs_dependencies", "Comment": "Stores data points for a code insight that do not need to be queried directly, but depend on the result of a query at a different point", "Columns": [ { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('insights_query_runner_jobs_dependencies_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "job_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Foreign key to the job that owns this record." }, { "Name": "recording_time", "Index": 3, "TypeName": "timestamp without time zone", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The time for which this dependency should be recorded at using the parents value." } ], "Indexes": [ { "Name": "insights_query_runner_jobs_dependencies_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX insights_query_runner_jobs_dependencies_pkey ON insights_query_runner_jobs_dependencies USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "insights_query_runner_jobs_dependencies_job_id_fk_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX insights_query_runner_jobs_dependencies_job_id_fk_idx ON insights_query_runner_jobs_dependencies USING btree (job_id)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "insights_query_runner_jobs_dependencies_fk_job_id", "ConstraintType": "f", "RefTableName": "insights_query_runner_jobs", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (job_id) REFERENCES insights_query_runner_jobs(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "insights_settings_migration_jobs", "Comment": "", "Columns": [ { "Name": "completed_at", "Index": 11, "TypeName": "timestamp without time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "global", "Index": 4, "TypeName": "boolean", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('insights_settings_migration_jobs_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "migrated_dashboards", "Index": 9, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "migrated_insights", "Index": 7, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "org_id", "Index": 3, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "runs", "Index": 10, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "settings_id", "Index": 5, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "total_dashboards", "Index": 8, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "total_insights", "Index": 6, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "user_id", "Index": 2, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [], "Constraints": null, "Triggers": [] }, { "Name": "lsif_configuration_policies", "Comment": "", "Columns": [ { "Name": "embeddings_enabled", "Index": 16, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('lsif_configuration_policies_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "index_commit_max_age_hours", "Index": 10, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The max age of commits indexed by this configuration policy. If null, the age is unbounded." }, { "Name": "index_intermediate_commits", "Index": 11, "TypeName": "boolean", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "If the matching Git object is a branch, setting this value to true will also index all commits on the matching branches. Setting this value to false will only consider the tip of the branch." }, { "Name": "indexing_enabled", "Index": 9, "TypeName": "boolean", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Whether or not this configuration policy affects auto-indexing schedules." }, { "Name": "last_resolved_at", "Index": 14, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "name", "Index": 3, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "pattern", "Index": 5, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "A pattern used to match` names of the associated Git object type." }, { "Name": "protected", "Index": 12, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Whether or not this configuration policy is protected from modification of its data retention behavior (except for duration)." }, { "Name": "repository_id", "Index": 2, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The identifier of the repository to which this configuration policy applies. If absent, this policy is applied globally." }, { "Name": "repository_patterns", "Index": 13, "TypeName": "text[]", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The name pattern matching repositories to which this configuration policy applies. If absent, all repositories are matched." }, { "Name": "retain_intermediate_commits", "Index": 8, "TypeName": "boolean", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "If the matching Git object is a branch, setting this value to true will also retain all data used to resolve queries for any commit on the matching branches. Setting this value to false will only consider the tip of the branch." }, { "Name": "retention_duration_hours", "Index": 7, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The max age of data retained by this configuration policy. If null, the age is unbounded." }, { "Name": "retention_enabled", "Index": 6, "TypeName": "boolean", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Whether or not this configuration policy affects data retention rules." }, { "Name": "type", "Index": 4, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The type of Git object (e.g., COMMIT, BRANCH, TAG)." } ], "Indexes": [ { "Name": "lsif_configuration_policies_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX lsif_configuration_policies_pkey ON lsif_configuration_policies USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "lsif_configuration_policies_repository_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX lsif_configuration_policies_repository_id ON lsif_configuration_policies USING btree (repository_id)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": null, "Triggers": [ { "Name": "trigger_configuration_policies_delete", "Definition": "CREATE TRIGGER trigger_configuration_policies_delete AFTER DELETE ON lsif_configuration_policies REFERENCING OLD TABLE AS old FOR EACH STATEMENT EXECUTE FUNCTION func_configuration_policies_delete()" }, { "Name": "trigger_configuration_policies_insert", "Definition": "CREATE TRIGGER trigger_configuration_policies_insert AFTER INSERT ON lsif_configuration_policies FOR EACH ROW EXECUTE FUNCTION func_configuration_policies_insert()" }, { "Name": "trigger_configuration_policies_update", "Definition": "CREATE TRIGGER trigger_configuration_policies_update BEFORE UPDATE OF name, pattern, retention_enabled, retention_duration_hours, type, retain_intermediate_commits ON lsif_configuration_policies FOR EACH ROW EXECUTE FUNCTION func_configuration_policies_update()" } ] }, { "Name": "lsif_configuration_policies_repository_pattern_lookup", "Comment": "A lookup table to get all the repository patterns by repository id that apply to a configuration policy.", "Columns": [ { "Name": "policy_id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The policy identifier associated with the repository." }, { "Name": "repo_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The repository identifier associated with the policy." } ], "Indexes": [ { "Name": "lsif_configuration_policies_repository_pattern_lookup_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX lsif_configuration_policies_repository_pattern_lookup_pkey ON lsif_configuration_policies_repository_pattern_lookup USING btree (policy_id, repo_id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (policy_id, repo_id)" } ], "Constraints": null, "Triggers": [] }, { "Name": "lsif_dependency_indexing_jobs", "Comment": "", "Columns": [ { "Name": "cancel", "Index": 16, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "execution_logs", "Index": 10, "TypeName": "json[]", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "external_service_kind", "Index": 14, "TypeName": "text", "IsNullable": false, "Default": "''::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Filter the external services for this kind to wait to have synced. If empty, external_service_sync is ignored and no external services are polled for their last sync time." }, { "Name": "external_service_sync", "Index": 15, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The sync time after which external services of the given kind will have synced/created any repositories referenced by the LSIF upload that are resolvable." }, { "Name": "failure_message", "Index": 3, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "finished_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('lsif_dependency_indexing_jobs_id_seq1'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "last_heartbeat_at", "Index": 11, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_failures", "Index": 9, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_resets", "Index": 8, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "process_after", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "queued_at", "Index": 4, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "started_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "state", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "'queued'::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "upload_id", "Index": 13, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "worker_hostname", "Index": 12, "TypeName": "text", "IsNullable": false, "Default": "''::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "lsif_dependency_indexing_jobs_pkey1", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX lsif_dependency_indexing_jobs_pkey1 ON lsif_dependency_indexing_jobs USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "lsif_dependency_indexing_jobs_state", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX lsif_dependency_indexing_jobs_state ON lsif_dependency_indexing_jobs USING btree (state)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "lsif_dependency_indexing_jobs_upload_id_fkey1", "ConstraintType": "f", "RefTableName": "lsif_uploads", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (upload_id) REFERENCES lsif_uploads(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "lsif_dependency_repos", "Comment": "", "Columns": [ { "Name": "blocked", "Index": 5, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('lsif_dependency_repos_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "last_checked_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "name", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "scheme", "Index": 4, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "lsif_dependency_repos_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX lsif_dependency_repos_pkey ON lsif_dependency_repos USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "lsif_dependency_repos_unique_scheme_name", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX lsif_dependency_repos_unique_scheme_name ON lsif_dependency_repos USING btree (scheme, name)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "lsif_dependency_repos_blocked", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX lsif_dependency_repos_blocked ON lsif_dependency_repos USING btree (blocked)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "lsif_dependency_repos_last_checked_at", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX lsif_dependency_repos_last_checked_at ON lsif_dependency_repos USING btree (last_checked_at NULLS FIRST)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "lsif_dependency_repos_name_gin", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX lsif_dependency_repos_name_gin ON lsif_dependency_repos USING gin (name gin_trgm_ops)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "lsif_dependency_repos_name_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX lsif_dependency_repos_name_id ON lsif_dependency_repos USING btree (name, id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "lsif_dependency_repos_scheme_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX lsif_dependency_repos_scheme_id ON lsif_dependency_repos USING btree (scheme, id)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": null, "Triggers": [] }, { "Name": "lsif_dependency_syncing_jobs", "Comment": "Tracks jobs that scan imports of indexes to schedule auto-index jobs.", "Columns": [ { "Name": "cancel", "Index": 14, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "execution_logs", "Index": 10, "TypeName": "json[]", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "failure_message", "Index": 3, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "finished_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('lsif_dependency_indexing_jobs_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "last_heartbeat_at", "Index": 13, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_failures", "Index": 9, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_resets", "Index": 8, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "process_after", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "queued_at", "Index": 4, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "started_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "state", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "'queued'::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "upload_id", "Index": 11, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The identifier of the triggering upload record." }, { "Name": "worker_hostname", "Index": 12, "TypeName": "text", "IsNullable": false, "Default": "''::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "lsif_dependency_indexing_jobs_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX lsif_dependency_indexing_jobs_pkey ON lsif_dependency_syncing_jobs USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "lsif_dependency_indexing_jobs_upload_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX lsif_dependency_indexing_jobs_upload_id ON lsif_dependency_syncing_jobs USING btree (upload_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "lsif_dependency_syncing_jobs_state", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX lsif_dependency_syncing_jobs_state ON lsif_dependency_syncing_jobs USING btree (state)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "lsif_dependency_indexing_jobs_upload_id_fkey", "ConstraintType": "f", "RefTableName": "lsif_uploads", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (upload_id) REFERENCES lsif_uploads(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "lsif_dirty_repositories", "Comment": "Stores whether or not the nearest upload data for a repository is out of date (when update_token \u003e dirty_token).", "Columns": [ { "Name": "dirty_token", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Set to the value of update_token visible to the transaction that updates the commit graph. Updates of dirty_token during this time will cause a second update." }, { "Name": "repository_id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "set_dirty_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "update_token", "Index": 3, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "This value is incremented on each request to update the commit graph for the repository." }, { "Name": "updated_at", "Index": 4, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The time the update_token value was last updated." } ], "Indexes": [ { "Name": "lsif_dirty_repositories_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX lsif_dirty_repositories_pkey ON lsif_dirty_repositories USING btree (repository_id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (repository_id)" } ], "Constraints": null, "Triggers": [] }, { "Name": "lsif_index_configuration", "Comment": "Stores the configuration used for code intel index jobs for a repository.", "Columns": [ { "Name": "autoindex_enabled", "Index": 4, "TypeName": "boolean", "IsNullable": false, "Default": "true", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Whether or not auto-indexing should be attempted on this repo. Index jobs may be inferred from the repository contents if data is empty." }, { "Name": "data", "Index": 3, "TypeName": "bytea", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The raw user-supplied [configuration](https://sourcegraph.com/github.com/sourcegraph/sourcegraph@3.23/-/blob/enterprise/internal/codeintel/autoindex/config/types.go#L3:6) (encoded in JSONC)." }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('lsif_index_configuration_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "repository_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "lsif_index_configuration_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX lsif_index_configuration_pkey ON lsif_index_configuration USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "lsif_index_configuration_repository_id_key", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX lsif_index_configuration_repository_id_key ON lsif_index_configuration USING btree (repository_id)", "ConstraintType": "u", "ConstraintDefinition": "UNIQUE (repository_id)" } ], "Constraints": [ { "Name": "lsif_index_configuration_repository_id_fkey", "ConstraintType": "f", "RefTableName": "repo", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (repository_id) REFERENCES repo(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "lsif_indexes", "Comment": "Stores metadata about a code intel index job.", "Columns": [ { "Name": "cancel", "Index": 23, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "commit", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "A 40-char revhash. Note that this commit may not be resolvable in the future." }, { "Name": "commit_last_checked_at", "Index": 20, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "docker_steps", "Index": 12, "TypeName": "jsonb[]", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "An array of pre-index [steps](https://sourcegraph.com/github.com/sourcegraph/sourcegraph@3.23/-/blob/enterprise/internal/codeintel/stores/dbstore/docker_step.go#L9:6) to run." }, { "Name": "enqueuer_user_id", "Index": 26, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "execution_logs", "Index": 18, "TypeName": "json[]", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "An array of [log entries](https://sourcegraph.com/github.com/sourcegraph/sourcegraph@3.23/-/blob/internal/workerutil/store.go#L48:6) (encoded as JSON) from the most recent execution." }, { "Name": "failure_message", "Index": 5, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "finished_at", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('lsif_indexes_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "indexer", "Index": 14, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The docker image used to run the index command (e.g. sourcegraph/lsif-go)." }, { "Name": "indexer_args", "Index": 15, "TypeName": "text[]", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The command run inside the indexer image to produce the index file (e.g. ['lsif-node', '-p', '.'])" }, { "Name": "last_heartbeat_at", "Index": 22, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "local_steps", "Index": 19, "TypeName": "text[]", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "A list of commands to run inside the indexer image prior to running the indexer command." }, { "Name": "log_contents", "Index": 17, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "**Column deprecated in favor of execution_logs.**" }, { "Name": "num_failures", "Index": 11, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_resets", "Index": 10, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "outfile", "Index": 16, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The path to the index file produced by the index command relative to the working directory." }, { "Name": "process_after", "Index": 9, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "queued_at", "Index": 3, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "repository_id", "Index": 8, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "requested_envvars", "Index": 25, "TypeName": "text[]", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "root", "Index": 13, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The working directory of the indexer image relative to the repository root." }, { "Name": "should_reindex", "Index": 24, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "started_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "state", "Index": 4, "TypeName": "text", "IsNullable": false, "Default": "'queued'::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "worker_hostname", "Index": 21, "TypeName": "text", "IsNullable": false, "Default": "''::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "lsif_indexes_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX lsif_indexes_pkey ON lsif_indexes USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "lsif_indexes_commit_last_checked_at", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX lsif_indexes_commit_last_checked_at ON lsif_indexes USING btree (commit_last_checked_at) WHERE state \u003c\u003e 'deleted'::text", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "lsif_indexes_dequeue_order_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX lsif_indexes_dequeue_order_idx ON lsif_indexes USING btree ((enqueuer_user_id \u003e 0) DESC, queued_at DESC, id) WHERE state = 'queued'::text OR state = 'errored'::text", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "lsif_indexes_queued_at_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX lsif_indexes_queued_at_id ON lsif_indexes USING btree (queued_at DESC, id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "lsif_indexes_repository_id_commit", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX lsif_indexes_repository_id_commit ON lsif_indexes USING btree (repository_id, commit)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "lsif_indexes_state", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX lsif_indexes_state ON lsif_indexes USING btree (state)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "lsif_uploads_commit_valid_chars", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (commit ~ '^[a-z0-9]{40}$'::text)" } ], "Triggers": [] }, { "Name": "lsif_last_index_scan", "Comment": "Tracks the last time repository was checked for auto-indexing job scheduling.", "Columns": [ { "Name": "last_index_scan_at", "Index": 2, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The last time uploads of this repository were considered for auto-indexing job scheduling." }, { "Name": "repository_id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "lsif_last_index_scan_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX lsif_last_index_scan_pkey ON lsif_last_index_scan USING btree (repository_id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (repository_id)" } ], "Constraints": null, "Triggers": [] }, { "Name": "lsif_last_retention_scan", "Comment": "Tracks the last time uploads a repository were checked against data retention policies.", "Columns": [ { "Name": "last_retention_scan_at", "Index": 2, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The last time uploads of this repository were checked against data retention policies." }, { "Name": "repository_id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "lsif_last_retention_scan_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX lsif_last_retention_scan_pkey ON lsif_last_retention_scan USING btree (repository_id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (repository_id)" } ], "Constraints": null, "Triggers": [] }, { "Name": "lsif_nearest_uploads", "Comment": "Associates commits with the complete set of uploads visible from that commit. Every commit with upload data is present in this table.", "Columns": [ { "Name": "commit_bytea", "Index": 2, "TypeName": "bytea", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "A 40-char revhash. Note that this commit may not be resolvable in the future." }, { "Name": "repository_id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "uploads", "Index": 3, "TypeName": "jsonb", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Encodes an {upload_id =\u003e distance} map that includes an entry for every upload visible from the commit. There is always at least one entry with a distance of zero." } ], "Indexes": [ { "Name": "lsif_nearest_uploads_repository_id_commit_bytea", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX lsif_nearest_uploads_repository_id_commit_bytea ON lsif_nearest_uploads USING btree (repository_id, commit_bytea)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "lsif_nearest_uploads_uploads", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX lsif_nearest_uploads_uploads ON lsif_nearest_uploads USING gin (uploads)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": null, "Triggers": [] }, { "Name": "lsif_nearest_uploads_links", "Comment": "Associates commits with the closest ancestor commit with usable upload data. Together, this table and lsif_nearest_uploads cover all commits with resolvable code intelligence.", "Columns": [ { "Name": "ancestor_commit_bytea", "Index": 3, "TypeName": "bytea", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The 40-char revhash of the ancestor. Note that this commit may not be resolvable in the future." }, { "Name": "commit_bytea", "Index": 2, "TypeName": "bytea", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "A 40-char revhash. Note that this commit may not be resolvable in the future." }, { "Name": "distance", "Index": 4, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The distance bewteen the commits. Parent = 1, Grandparent = 2, etc." }, { "Name": "repository_id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "lsif_nearest_uploads_links_repository_id_ancestor_commit_bytea", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX lsif_nearest_uploads_links_repository_id_ancestor_commit_bytea ON lsif_nearest_uploads_links USING btree (repository_id, ancestor_commit_bytea)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "lsif_nearest_uploads_links_repository_id_commit_bytea", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX lsif_nearest_uploads_links_repository_id_commit_bytea ON lsif_nearest_uploads_links USING btree (repository_id, commit_bytea)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": null, "Triggers": [] }, { "Name": "lsif_packages", "Comment": "Associates an upload with the set of packages they provide within a given packages management scheme.", "Columns": [ { "Name": "dump_id", "Index": 5, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The identifier of the upload that provides the package." }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('lsif_packages_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "manager", "Index": 6, "TypeName": "text", "IsNullable": false, "Default": "''::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The package manager name." }, { "Name": "name", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The package name." }, { "Name": "scheme", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The (export) moniker scheme." }, { "Name": "version", "Index": 4, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The package version." } ], "Indexes": [ { "Name": "lsif_packages_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX lsif_packages_pkey ON lsif_packages USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "lsif_packages_dump_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX lsif_packages_dump_id ON lsif_packages USING btree (dump_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "lsif_packages_scheme_name_version_dump_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX lsif_packages_scheme_name_version_dump_id ON lsif_packages USING btree (scheme, name, version, dump_id)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "lsif_packages_dump_id_fkey", "ConstraintType": "f", "RefTableName": "lsif_uploads", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (dump_id) REFERENCES lsif_uploads(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "lsif_references", "Comment": "Associates an upload with the set of packages they require within a given packages management scheme.", "Columns": [ { "Name": "dump_id", "Index": 6, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The identifier of the upload that references the package." }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('lsif_references_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "manager", "Index": 7, "TypeName": "text", "IsNullable": false, "Default": "''::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The package manager name." }, { "Name": "name", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The package name." }, { "Name": "scheme", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The (import) moniker scheme." }, { "Name": "version", "Index": 4, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The package version." } ], "Indexes": [ { "Name": "lsif_references_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX lsif_references_pkey ON lsif_references USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "lsif_references_dump_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX lsif_references_dump_id ON lsif_references USING btree (dump_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "lsif_references_scheme_name_version_dump_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX lsif_references_scheme_name_version_dump_id ON lsif_references USING btree (scheme, name, version, dump_id)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "lsif_references_dump_id_fkey", "ConstraintType": "f", "RefTableName": "lsif_uploads", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (dump_id) REFERENCES lsif_uploads(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "lsif_retention_configuration", "Comment": "Stores the retention policy of code intellience data for a repository.", "Columns": [ { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('lsif_retention_configuration_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "max_age_for_non_stale_branches_seconds", "Index": 3, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The number of seconds since the last modification of a branch until it is considered stale." }, { "Name": "max_age_for_non_stale_tags_seconds", "Index": 4, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The nujmber of seconds since the commit date of a tagged commit until it is considered stale." }, { "Name": "repository_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "lsif_retention_configuration_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX lsif_retention_configuration_pkey ON lsif_retention_configuration USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "lsif_retention_configuration_repository_id_key", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX lsif_retention_configuration_repository_id_key ON lsif_retention_configuration USING btree (repository_id)", "ConstraintType": "u", "ConstraintDefinition": "UNIQUE (repository_id)" } ], "Constraints": [ { "Name": "lsif_retention_configuration_repository_id_fkey", "ConstraintType": "f", "RefTableName": "repo", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (repository_id) REFERENCES repo(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "lsif_uploads", "Comment": "Stores metadata about an LSIF index uploaded by a user.", "Columns": [ { "Name": "associated_index_id", "Index": 17, "TypeName": "bigint", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "cancel", "Index": 29, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "commit", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "A 40-char revhash. Note that this commit may not be resolvable in the future." }, { "Name": "commit_last_checked_at", "Index": 19, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "committed_at", "Index": 18, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "content_type", "Index": 34, "TypeName": "text", "IsNullable": false, "Default": "'application/x-ndjson+lsif'::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The content type of the upload record. For now, the default value is `application/x-ndjson+lsif` to backfill existing records. This will change as we remove LSIF support." }, { "Name": "execution_logs", "Index": 22, "TypeName": "json[]", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "expired", "Index": 24, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Whether or not this upload data is no longer protected by any data retention policy." }, { "Name": "failure_message", "Index": 6, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "finished_at", "Index": 8, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('lsif_dumps_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Used as a logical foreign key with the (disjoint) codeintel database." }, { "Name": "indexer", "Index": 10, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The name of the indexer that produced the index file. If not supplied by the user it will be pulled from the index metadata." }, { "Name": "indexer_version", "Index": 27, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The version of the indexer that produced the index file. If not supplied by the user it will be pulled from the index metadata." }, { "Name": "last_heartbeat_at", "Index": 21, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "last_reconcile_at", "Index": 33, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "last_referenced_scan_at", "Index": 31, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The last time this upload was known to be referenced by another (possibly expired) index." }, { "Name": "last_retention_scan_at", "Index": 25, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The last time this upload was checked against data retention policies." }, { "Name": "last_traversal_scan_at", "Index": 32, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The last time this upload was known to be reachable by a non-expired index." }, { "Name": "num_failures", "Index": 16, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_parts", "Index": 11, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The number of parts src-cli split the upload file into." }, { "Name": "num_references", "Index": 23, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Deprecated in favor of reference_count." }, { "Name": "num_resets", "Index": 14, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "process_after", "Index": 13, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "queued_at", "Index": 28, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "reference_count", "Index": 26, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The number of references to this upload data from other upload records (via lsif_references)." }, { "Name": "repository_id", "Index": 9, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "root", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "''::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The path for which the index can resolve code intelligence relative to the repository root." }, { "Name": "should_reindex", "Index": 35, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "started_at", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "state", "Index": 5, "TypeName": "text", "IsNullable": false, "Default": "'queued'::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "uncompressed_size", "Index": 30, "TypeName": "bigint", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "upload_size", "Index": 15, "TypeName": "bigint", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The size of the index file (in bytes)." }, { "Name": "uploaded_at", "Index": 4, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "uploaded_parts", "Index": 12, "TypeName": "integer[]", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The index of parts that have been successfully uploaded." }, { "Name": "worker_hostname", "Index": 20, "TypeName": "text", "IsNullable": false, "Default": "''::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "lsif_uploads_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX lsif_uploads_pkey ON lsif_uploads USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "lsif_uploads_repository_id_commit_root_indexer", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX lsif_uploads_repository_id_commit_root_indexer ON lsif_uploads USING btree (repository_id, commit, root, indexer) WHERE state = 'completed'::text", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "lsif_uploads_associated_index_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX lsif_uploads_associated_index_id ON lsif_uploads USING btree (associated_index_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "lsif_uploads_commit_last_checked_at", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX lsif_uploads_commit_last_checked_at ON lsif_uploads USING btree (commit_last_checked_at) WHERE state \u003c\u003e 'deleted'::text", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "lsif_uploads_committed_at", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX lsif_uploads_committed_at ON lsif_uploads USING btree (committed_at) WHERE state = 'completed'::text", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "lsif_uploads_last_reconcile_at", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX lsif_uploads_last_reconcile_at ON lsif_uploads USING btree (last_reconcile_at, id) WHERE state = 'completed'::text", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "lsif_uploads_repository_id_commit", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX lsif_uploads_repository_id_commit ON lsif_uploads USING btree (repository_id, commit)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "lsif_uploads_state", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX lsif_uploads_state ON lsif_uploads USING btree (state)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "lsif_uploads_uploaded_at_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX lsif_uploads_uploaded_at_id ON lsif_uploads USING btree (uploaded_at DESC, id) WHERE state \u003c\u003e 'deleted'::text", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "lsif_uploads_commit_valid_chars", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (commit ~ '^[a-z0-9]{40}$'::text)" } ], "Triggers": [ { "Name": "trigger_lsif_uploads_delete", "Definition": "CREATE TRIGGER trigger_lsif_uploads_delete AFTER DELETE ON lsif_uploads REFERENCING OLD TABLE AS old FOR EACH STATEMENT EXECUTE FUNCTION func_lsif_uploads_delete()" }, { "Name": "trigger_lsif_uploads_insert", "Definition": "CREATE TRIGGER trigger_lsif_uploads_insert AFTER INSERT ON lsif_uploads FOR EACH ROW EXECUTE FUNCTION func_lsif_uploads_insert()" }, { "Name": "trigger_lsif_uploads_update", "Definition": "CREATE TRIGGER trigger_lsif_uploads_update BEFORE UPDATE OF state, num_resets, num_failures, worker_hostname, expired, committed_at ON lsif_uploads FOR EACH ROW EXECUTE FUNCTION func_lsif_uploads_update()" } ] }, { "Name": "lsif_uploads_audit_logs", "Comment": "", "Columns": [ { "Name": "associated_index_id", "Index": 11, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "commit", "Index": 4, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "content_type", "Index": 17, "TypeName": "text", "IsNullable": false, "Default": "'application/x-ndjson+lsif'::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "indexer", "Index": 8, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "indexer_version", "Index": 9, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "log_timestamp", "Index": 1, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Timestamp for this log entry." }, { "Name": "operation", "Index": 16, "TypeName": "audit_log_operation", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "reason", "Index": 14, "TypeName": "text", "IsNullable": true, "Default": "''::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The reason/source for this entry." }, { "Name": "record_deleted_at", "Index": 2, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Set once the upload this entry is associated with is deleted. Once NOW() - record_deleted_at is above a certain threshold, this log entry will be deleted." }, { "Name": "repository_id", "Index": 6, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "root", "Index": 5, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "sequence", "Index": 15, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('lsif_uploads_audit_logs_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "transition_columns", "Index": 13, "TypeName": "USER-DEFINED[]", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Array of changes that occurred to the upload for this entry, in the form of {\"column\"=\u003e\"\u003ccolumn name\u003e\", \"old\"=\u003e\"\u003cprevious value\u003e\", \"new\"=\u003e\"\u003cnew value\u003e\"}." }, { "Name": "upload_id", "Index": 3, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "upload_size", "Index": 10, "TypeName": "bigint", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "uploaded_at", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "lsif_uploads_audit_logs_timestamp", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX lsif_uploads_audit_logs_timestamp ON lsif_uploads_audit_logs USING brin (log_timestamp)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "lsif_uploads_audit_logs_upload_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX lsif_uploads_audit_logs_upload_id ON lsif_uploads_audit_logs USING btree (upload_id)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": null, "Triggers": [] }, { "Name": "lsif_uploads_reference_counts", "Comment": "A less hot-path reference count for upload records.", "Columns": [ { "Name": "reference_count", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The number of references to the associated upload from other records (via lsif_references)." }, { "Name": "upload_id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The identifier of the referenced upload." } ], "Indexes": [ { "Name": "lsif_uploads_reference_counts_upload_id_key", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX lsif_uploads_reference_counts_upload_id_key ON lsif_uploads_reference_counts USING btree (upload_id)", "ConstraintType": "u", "ConstraintDefinition": "UNIQUE (upload_id)" } ], "Constraints": [ { "Name": "lsif_uploads_reference_counts_upload_id_fk", "ConstraintType": "f", "RefTableName": "lsif_uploads", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (upload_id) REFERENCES lsif_uploads(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "lsif_uploads_visible_at_tip", "Comment": "Associates a repository with the set of LSIF upload identifiers that can serve intelligence for the tip of the default branch.", "Columns": [ { "Name": "branch_or_tag_name", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "''::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The name of the branch or tag." }, { "Name": "is_default_branch", "Index": 4, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Whether the specified branch is the default of the repository. Always false for tags." }, { "Name": "repository_id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "upload_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The identifier of the upload visible from the tip of the specified branch or tag." } ], "Indexes": [ { "Name": "lsif_uploads_visible_at_tip_is_default_branch", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX lsif_uploads_visible_at_tip_is_default_branch ON lsif_uploads_visible_at_tip USING btree (upload_id) WHERE is_default_branch", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "lsif_uploads_visible_at_tip_repository_id_upload_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX lsif_uploads_visible_at_tip_repository_id_upload_id ON lsif_uploads_visible_at_tip USING btree (repository_id, upload_id)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": null, "Triggers": [] }, { "Name": "lsif_uploads_vulnerability_scan", "Comment": "", "Columns": [ { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('lsif_uploads_vulnerability_scan_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "last_scanned_at", "Index": 3, "TypeName": "timestamp without time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "upload_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "lsif_uploads_vulnerability_scan_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX lsif_uploads_vulnerability_scan_pkey ON lsif_uploads_vulnerability_scan USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "lsif_uploads_vulnerability_scan_upload_id", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX lsif_uploads_vulnerability_scan_upload_id ON lsif_uploads_vulnerability_scan USING btree (upload_id)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "fk_upload_id", "ConstraintType": "f", "RefTableName": "lsif_uploads", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (upload_id) REFERENCES lsif_uploads(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "migration_logs", "Comment": "", "Columns": [ { "Name": "backfilled", "Index": 10, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "error_message", "Index": 9, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "finished_at", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('migration_logs_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "migration_logs_schema_version", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "schema", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "started_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "success", "Index": 8, "TypeName": "boolean", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "up", "Index": 5, "TypeName": "boolean", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "version", "Index": 4, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "migration_logs_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX migration_logs_pkey ON migration_logs USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" } ], "Constraints": null, "Triggers": [] }, { "Name": "names", "Comment": "", "Columns": [ { "Name": "name", "Index": 1, "TypeName": "citext", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "org_id", "Index": 3, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "team_id", "Index": 4, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "user_id", "Index": 2, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "names_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX names_pkey ON names USING btree (name)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (name)" } ], "Constraints": [ { "Name": "names_check", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (user_id IS NOT NULL OR org_id IS NOT NULL OR team_id IS NOT NULL)" }, { "Name": "names_org_id_fkey", "ConstraintType": "f", "RefTableName": "orgs", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (org_id) REFERENCES orgs(id) ON UPDATE CASCADE ON DELETE CASCADE" }, { "Name": "names_team_id_fkey", "ConstraintType": "f", "RefTableName": "teams", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (team_id) REFERENCES teams(id) ON UPDATE CASCADE ON DELETE CASCADE" }, { "Name": "names_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (user_id) REFERENCES users(id) ON UPDATE CASCADE ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "namespace_permissions", "Comment": "", "Columns": [ { "Name": "created_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('namespace_permissions_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "namespace", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "resource_id", "Index": 3, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "user_id", "Index": 5, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "namespace_permissions_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX namespace_permissions_pkey ON namespace_permissions USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "unique_resource_permission", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX unique_resource_permission ON namespace_permissions USING btree (namespace, resource_id, user_id)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "namespace_not_blank", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (namespace \u003c\u003e ''::text)" }, { "Name": "namespace_permissions_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE DEFERRABLE" } ], "Triggers": [] }, { "Name": "notebook_stars", "Comment": "", "Columns": [ { "Name": "created_at", "Index": 3, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "notebook_id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "user_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "notebook_stars_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX notebook_stars_pkey ON notebook_stars USING btree (notebook_id, user_id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (notebook_id, user_id)" }, { "Name": "notebook_stars_user_id_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX notebook_stars_user_id_idx ON notebook_stars USING btree (user_id)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "notebook_stars_notebook_id_fkey", "ConstraintType": "f", "RefTableName": "notebooks", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (notebook_id) REFERENCES notebooks(id) ON DELETE CASCADE DEFERRABLE" }, { "Name": "notebook_stars_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE DEFERRABLE" } ], "Triggers": [] }, { "Name": "notebooks", "Comment": "", "Columns": [ { "Name": "blocks", "Index": 3, "TypeName": "jsonb", "IsNullable": false, "Default": "'[]'::jsonb", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "blocks_tsvector", "Index": 8, "TypeName": "tsvector", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "ALWAYS", "GenerationExpression": "jsonb_to_tsvector('english'::regconfig, blocks, '[\"string\"]'::jsonb)", "Comment": "" }, { "Name": "created_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "creator_user_id", "Index": 5, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('notebooks_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "namespace_org_id", "Index": 10, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "namespace_user_id", "Index": 9, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "public", "Index": 4, "TypeName": "boolean", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "title", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updater_user_id", "Index": 11, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "notebooks_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX notebooks_pkey ON notebooks USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "notebooks_blocks_tsvector_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX notebooks_blocks_tsvector_idx ON notebooks USING gin (blocks_tsvector)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "notebooks_namespace_org_id_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX notebooks_namespace_org_id_idx ON notebooks USING btree (namespace_org_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "notebooks_namespace_user_id_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX notebooks_namespace_user_id_idx ON notebooks USING btree (namespace_user_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "notebooks_title_trgm_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX notebooks_title_trgm_idx ON notebooks USING gin (title gin_trgm_ops)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "blocks_is_array", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (jsonb_typeof(blocks) = 'array'::text)" }, { "Name": "notebooks_creator_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (creator_user_id) REFERENCES users(id) ON DELETE SET NULL DEFERRABLE" }, { "Name": "notebooks_has_max_1_namespace", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (namespace_user_id IS NULL AND namespace_org_id IS NULL OR (namespace_user_id IS NULL) \u003c\u003e (namespace_org_id IS NULL))" }, { "Name": "notebooks_namespace_org_id_fkey", "ConstraintType": "f", "RefTableName": "orgs", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (namespace_org_id) REFERENCES orgs(id) ON DELETE SET NULL DEFERRABLE" }, { "Name": "notebooks_namespace_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (namespace_user_id) REFERENCES users(id) ON DELETE SET NULL DEFERRABLE" }, { "Name": "notebooks_updater_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (updater_user_id) REFERENCES users(id) ON DELETE SET NULL DEFERRABLE" } ], "Triggers": [] }, { "Name": "org_invitations", "Comment": "", "Columns": [ { "Name": "created_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "deleted_at", "Index": 10, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "expires_at", "Index": 12, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('org_invitations_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "notified_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "org_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "recipient_email", "Index": 11, "TypeName": "citext", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "recipient_user_id", "Index": 4, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "responded_at", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "response_type", "Index": 8, "TypeName": "boolean", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "revoked_at", "Index": 9, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "sender_user_id", "Index": 3, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "org_invitations_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX org_invitations_pkey ON org_invitations USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "org_invitations_org_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX org_invitations_org_id ON org_invitations USING btree (org_id) WHERE deleted_at IS NULL", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "org_invitations_recipient_user_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX org_invitations_recipient_user_id ON org_invitations USING btree (recipient_user_id) WHERE deleted_at IS NULL", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "check_atomic_response", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK ((responded_at IS NULL) = (response_type IS NULL))" }, { "Name": "check_single_use", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (responded_at IS NULL AND response_type IS NULL OR revoked_at IS NULL)" }, { "Name": "either_user_id_or_email_defined", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK ((recipient_user_id IS NULL) \u003c\u003e (recipient_email IS NULL))" }, { "Name": "org_invitations_org_id_fkey", "ConstraintType": "f", "RefTableName": "orgs", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (org_id) REFERENCES orgs(id)" }, { "Name": "org_invitations_recipient_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (recipient_user_id) REFERENCES users(id)" }, { "Name": "org_invitations_sender_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (sender_user_id) REFERENCES users(id)" } ], "Triggers": [] }, { "Name": "org_members", "Comment": "", "Columns": [ { "Name": "created_at", "Index": 3, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('org_members_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "org_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 4, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "user_id", "Index": 5, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "org_members_org_id_user_id_key", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX org_members_org_id_user_id_key ON org_members USING btree (org_id, user_id)", "ConstraintType": "u", "ConstraintDefinition": "UNIQUE (org_id, user_id)" }, { "Name": "org_members_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX org_members_pkey ON org_members USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" } ], "Constraints": [ { "Name": "org_members_references_orgs", "ConstraintType": "f", "RefTableName": "orgs", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (org_id) REFERENCES orgs(id) ON DELETE RESTRICT" }, { "Name": "org_members_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE RESTRICT" } ], "Triggers": [] }, { "Name": "org_stats", "Comment": "Business statistics for organizations", "Columns": [ { "Name": "code_host_repo_count", "Index": 2, "TypeName": "integer", "IsNullable": true, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Count of repositories accessible on all code hosts for this organization." }, { "Name": "org_id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Org ID that the stats relate to." }, { "Name": "updated_at", "Index": 3, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "org_stats_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX org_stats_pkey ON org_stats USING btree (org_id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (org_id)" } ], "Constraints": [ { "Name": "org_stats_org_id_fkey", "ConstraintType": "f", "RefTableName": "orgs", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (org_id) REFERENCES orgs(id) ON DELETE CASCADE DEFERRABLE" } ], "Triggers": [] }, { "Name": "orgs", "Comment": "", "Columns": [ { "Name": "created_at", "Index": 3, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "deleted_at", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "display_name", "Index": 5, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('orgs_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "name", "Index": 2, "TypeName": "citext", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "slack_webhook_url", "Index": 6, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 4, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "orgs_name", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX orgs_name ON orgs USING btree (name) WHERE deleted_at IS NULL", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "orgs_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX orgs_pkey ON orgs USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" } ], "Constraints": [ { "Name": "orgs_display_name_max_length", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (char_length(display_name) \u003c= 255)" }, { "Name": "orgs_name_max_length", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (char_length(name::text) \u003c= 255)" }, { "Name": "orgs_name_valid_chars", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (name ~ '^[a-zA-Z0-9](?:[a-zA-Z0-9]|[-.](?=[a-zA-Z0-9]))*-?$'::citext)" } ], "Triggers": [] }, { "Name": "orgs_open_beta_stats", "Comment": "", "Columns": [ { "Name": "created_at", "Index": 4, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "data", "Index": 5, "TypeName": "jsonb", "IsNullable": false, "Default": "'{}'::jsonb", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "uuid", "IsNullable": false, "Default": "gen_random_uuid()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "org_id", "Index": 3, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "user_id", "Index": 2, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "orgs_open_beta_stats_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX orgs_open_beta_stats_pkey ON orgs_open_beta_stats USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" } ], "Constraints": null, "Triggers": [] }, { "Name": "out_of_band_migrations", "Comment": "Stores metadata and progress about an out-of-band migration routine.", "Columns": [ { "Name": "apply_reverse", "Index": 9, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Whether this migration should run in the opposite direction (to support an upcoming downgrade)." }, { "Name": "component", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The name of the component undergoing a migration." }, { "Name": "created", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The date and time the migration was inserted into the database (via an upgrade)." }, { "Name": "deprecated_version_major", "Index": 13, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The lowest Sourcegraph version (major component) that assumes the migration has completed." }, { "Name": "deprecated_version_minor", "Index": 14, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The lowest Sourcegraph version (minor component) that assumes the migration has completed." }, { "Name": "description", "Index": 4, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "A brief description about the migration." }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('out_of_band_migrations_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "A globally unique primary key for this migration. The same key is used consistently across all Sourcegraph instances for the same migration." }, { "Name": "introduced_version_major", "Index": 11, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The Sourcegraph version (major component) in which this migration was first introduced." }, { "Name": "introduced_version_minor", "Index": 12, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The Sourcegraph version (minor component) in which this migration was first introduced." }, { "Name": "is_enterprise", "Index": 10, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "When true, these migrations are invisible to OSS mode." }, { "Name": "last_updated", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The date and time the migration was last updated." }, { "Name": "metadata", "Index": 15, "TypeName": "jsonb", "IsNullable": false, "Default": "'{}'::jsonb", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "non_destructive", "Index": 8, "TypeName": "boolean", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Whether or not this migration alters data so it can no longer be read by the previous Sourcegraph instance." }, { "Name": "progress", "Index": 5, "TypeName": "double precision", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The percentage progress in the up direction (0=0%, 1=100%)." }, { "Name": "team", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The name of the engineering team responsible for the migration." } ], "Indexes": [ { "Name": "out_of_band_migrations_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX out_of_band_migrations_pkey ON out_of_band_migrations USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" } ], "Constraints": [ { "Name": "out_of_band_migrations_component_nonempty", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (component \u003c\u003e ''::text)" }, { "Name": "out_of_band_migrations_description_nonempty", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (description \u003c\u003e ''::text)" }, { "Name": "out_of_band_migrations_progress_range", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (progress \u003e= 0::double precision AND progress \u003c= 1::double precision)" }, { "Name": "out_of_band_migrations_team_nonempty", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (team \u003c\u003e ''::text)" } ], "Triggers": [] }, { "Name": "out_of_band_migrations_errors", "Comment": "Stores errors that occurred while performing an out-of-band migration.", "Columns": [ { "Name": "created", "Index": 4, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The date and time the error occurred." }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('out_of_band_migrations_errors_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "A unique identifer." }, { "Name": "message", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The error message." }, { "Name": "migration_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The identifier of the migration." } ], "Indexes": [ { "Name": "out_of_band_migrations_errors_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX out_of_band_migrations_errors_pkey ON out_of_band_migrations_errors USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" } ], "Constraints": [ { "Name": "out_of_band_migrations_errors_message_nonempty", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (message \u003c\u003e ''::text)" }, { "Name": "out_of_band_migrations_errors_migration_id_fkey", "ConstraintType": "f", "RefTableName": "out_of_band_migrations", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (migration_id) REFERENCES out_of_band_migrations(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "outbound_webhook_event_types", "Comment": "", "Columns": [ { "Name": "event_type", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('outbound_webhook_event_types_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "outbound_webhook_id", "Index": 2, "TypeName": "bigint", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "scope", "Index": 4, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "outbound_webhook_event_types_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX outbound_webhook_event_types_pkey ON outbound_webhook_event_types USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "outbound_webhook_event_types_event_type_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX outbound_webhook_event_types_event_type_idx ON outbound_webhook_event_types USING btree (event_type, scope)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "outbound_webhook_event_types_outbound_webhook_id_fkey", "ConstraintType": "f", "RefTableName": "outbound_webhooks", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (outbound_webhook_id) REFERENCES outbound_webhooks(id) ON UPDATE CASCADE ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "outbound_webhook_jobs", "Comment": "", "Columns": [ { "Name": "cancel", "Index": 17, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "encryption_key_id", "Index": 4, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "event_type", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "execution_logs", "Index": 15, "TypeName": "json[]", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "failure_message", "Index": 7, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "finished_at", "Index": 10, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('outbound_webhook_jobs_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "last_heartbeat_at", "Index": 14, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_failures", "Index": 13, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_resets", "Index": 12, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "payload", "Index": 5, "TypeName": "bytea", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "process_after", "Index": 11, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "queued_at", "Index": 8, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "scope", "Index": 3, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "started_at", "Index": 9, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "state", "Index": 6, "TypeName": "text", "IsNullable": false, "Default": "'queued'::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "worker_hostname", "Index": 16, "TypeName": "text", "IsNullable": false, "Default": "''::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "outbound_webhook_jobs_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX outbound_webhook_jobs_pkey ON outbound_webhook_jobs USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "outbound_webhook_jobs_state_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX outbound_webhook_jobs_state_idx ON outbound_webhook_jobs USING btree (state)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "outbound_webhook_payload_process_after_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX outbound_webhook_payload_process_after_idx ON outbound_webhook_jobs USING btree (process_after)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": null, "Triggers": [] }, { "Name": "outbound_webhook_logs", "Comment": "", "Columns": [ { "Name": "encryption_key_id", "Index": 6, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "error", "Index": 9, "TypeName": "bytea", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('outbound_webhook_logs_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "job_id", "Index": 2, "TypeName": "bigint", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "outbound_webhook_id", "Index": 3, "TypeName": "bigint", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "request", "Index": 7, "TypeName": "bytea", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "response", "Index": 8, "TypeName": "bytea", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "sent_at", "Index": 4, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "status_code", "Index": 5, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "outbound_webhook_logs_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX outbound_webhook_logs_pkey ON outbound_webhook_logs USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "outbound_webhook_logs_outbound_webhook_id_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX outbound_webhook_logs_outbound_webhook_id_idx ON outbound_webhook_logs USING btree (outbound_webhook_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "outbound_webhooks_logs_status_code_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX outbound_webhooks_logs_status_code_idx ON outbound_webhook_logs USING btree (status_code)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "outbound_webhook_logs_job_id_fkey", "ConstraintType": "f", "RefTableName": "outbound_webhook_jobs", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (job_id) REFERENCES outbound_webhook_jobs(id) ON UPDATE CASCADE ON DELETE CASCADE" }, { "Name": "outbound_webhook_logs_outbound_webhook_id_fkey", "ConstraintType": "f", "RefTableName": "outbound_webhooks", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (outbound_webhook_id) REFERENCES outbound_webhooks(id) ON UPDATE CASCADE ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "outbound_webhooks", "Comment": "", "Columns": [ { "Name": "created_at", "Index": 3, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_by", "Index": 2, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "encryption_key_id", "Index": 6, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('outbound_webhooks_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "secret", "Index": 8, "TypeName": "bytea", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_by", "Index": 4, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "url", "Index": 7, "TypeName": "bytea", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "outbound_webhooks_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX outbound_webhooks_pkey ON outbound_webhooks USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" } ], "Constraints": [ { "Name": "outbound_webhooks_created_by_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (created_by) REFERENCES users(id) ON DELETE SET NULL" }, { "Name": "outbound_webhooks_updated_by_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (updated_by) REFERENCES users(id) ON DELETE SET NULL" } ], "Triggers": [] }, { "Name": "own_aggregate_recent_contribution", "Comment": "", "Columns": [ { "Name": "changed_file_path_id", "Index": 3, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "commit_author_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "contributions_count", "Index": 4, "TypeName": "integer", "IsNullable": true, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('own_aggregate_recent_contribution_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "own_aggregate_recent_contribution_file_author", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX own_aggregate_recent_contribution_file_author ON own_aggregate_recent_contribution USING btree (changed_file_path_id, commit_author_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "own_aggregate_recent_contribution_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX own_aggregate_recent_contribution_pkey ON own_aggregate_recent_contribution USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" } ], "Constraints": [ { "Name": "own_aggregate_recent_contribution_changed_file_path_id_fkey", "ConstraintType": "f", "RefTableName": "repo_paths", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (changed_file_path_id) REFERENCES repo_paths(id)" }, { "Name": "own_aggregate_recent_contribution_commit_author_id_fkey", "ConstraintType": "f", "RefTableName": "commit_authors", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (commit_author_id) REFERENCES commit_authors(id)" } ], "Triggers": [] }, { "Name": "own_aggregate_recent_view", "Comment": "One entry contains a number of views of a single file by a given viewer.", "Columns": [ { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('own_aggregate_recent_view_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "viewed_file_path_id", "Index": 3, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "viewer_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "views_count", "Index": 4, "TypeName": "integer", "IsNullable": true, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "own_aggregate_recent_view_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX own_aggregate_recent_view_pkey ON own_aggregate_recent_view USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "own_aggregate_recent_view_viewer", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX own_aggregate_recent_view_viewer ON own_aggregate_recent_view USING btree (viewed_file_path_id, viewer_id)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "own_aggregate_recent_view_viewed_file_path_id_fkey", "ConstraintType": "f", "RefTableName": "repo_paths", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (viewed_file_path_id) REFERENCES repo_paths(id)" }, { "Name": "own_aggregate_recent_view_viewer_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (viewer_id) REFERENCES users(id) ON DELETE CASCADE DEFERRABLE" } ], "Triggers": [] }, { "Name": "own_background_jobs", "Comment": "", "Columns": [ { "Name": "cancel", "Index": 13, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "execution_logs", "Index": 11, "TypeName": "json[]", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "failure_message", "Index": 3, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "finished_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('own_background_jobs_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "job_type", "Index": 15, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "last_heartbeat_at", "Index": 10, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_failures", "Index": 9, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_resets", "Index": 8, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "process_after", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "queued_at", "Index": 4, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "repo_id", "Index": 14, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "started_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "state", "Index": 2, "TypeName": "text", "IsNullable": true, "Default": "'queued'::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "worker_hostname", "Index": 12, "TypeName": "text", "IsNullable": false, "Default": "''::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "own_background_jobs_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX own_background_jobs_pkey ON own_background_jobs USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "own_background_jobs_repo_id_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX own_background_jobs_repo_id_idx ON own_background_jobs USING btree (repo_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "own_background_jobs_state_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX own_background_jobs_state_idx ON own_background_jobs USING btree (state)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": null, "Triggers": [] }, { "Name": "own_signal_configurations", "Comment": "", "Columns": [ { "Name": "description", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "''::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "enabled", "Index": 5, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "excluded_repo_patterns", "Index": 4, "TypeName": "text[]", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('own_signal_configurations_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "name", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "own_signal_configurations_name_uidx", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX own_signal_configurations_name_uidx ON own_signal_configurations USING btree (name)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "own_signal_configurations_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX own_signal_configurations_pkey ON own_signal_configurations USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" } ], "Constraints": null, "Triggers": [] }, { "Name": "own_signal_recent_contribution", "Comment": "One entry per file changed in every commit that classifies as a contribution signal.", "Columns": [ { "Name": "changed_file_path_id", "Index": 3, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "commit_author_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "commit_id", "Index": 5, "TypeName": "bytea", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "commit_timestamp", "Index": 4, "TypeName": "timestamp without time zone", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('own_signal_recent_contribution_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "own_signal_recent_contribution_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX own_signal_recent_contribution_pkey ON own_signal_recent_contribution USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" } ], "Constraints": [ { "Name": "own_signal_recent_contribution_changed_file_path_id_fkey", "ConstraintType": "f", "RefTableName": "repo_paths", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (changed_file_path_id) REFERENCES repo_paths(id)" }, { "Name": "own_signal_recent_contribution_commit_author_id_fkey", "ConstraintType": "f", "RefTableName": "commit_authors", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (commit_author_id) REFERENCES commit_authors(id)" } ], "Triggers": [ { "Name": "update_own_aggregate_recent_contribution", "Definition": "CREATE TRIGGER update_own_aggregate_recent_contribution AFTER INSERT ON own_signal_recent_contribution FOR EACH ROW EXECUTE FUNCTION update_own_aggregate_recent_contribution()" } ] }, { "Name": "ownership_path_stats", "Comment": "Data on how many files in given tree are owned by anyone.\n\nWe choose to have a table for `ownership_path_stats` - more general than for CODEOWNERS,\nwith a specific tree_codeowned_files_count CODEOWNERS column. The reason for that\nis that we aim at expanding path stats by including total owned files (via CODEOWNERS\nor assigned ownership), and perhaps files count by assigned ownership only.", "Columns": [ { "Name": "file_path_id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "last_updated_at", "Index": 3, "TypeName": "timestamp without time zone", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "When the last background job updating counts run." }, { "Name": "tree_any_ownership_files_count", "Index": 5, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "tree_assigned_ownership_files_count", "Index": 4, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "tree_codeowned_files_count", "Index": 2, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "ownership_path_stats_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX ownership_path_stats_pkey ON ownership_path_stats USING btree (file_path_id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (file_path_id)" } ], "Constraints": [ { "Name": "ownership_path_stats_file_path_id_fkey", "ConstraintType": "f", "RefTableName": "repo_paths", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (file_path_id) REFERENCES repo_paths(id)" } ], "Triggers": [] }, { "Name": "package_repo_filters", "Comment": "", "Columns": [ { "Name": "behaviour", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "deleted_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('package_repo_filters_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "matcher", "Index": 4, "TypeName": "jsonb", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "scheme", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "statement_timestamp()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "package_repo_filters_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX package_repo_filters_pkey ON package_repo_filters USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "package_repo_filters_unique_matcher_per_scheme", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX package_repo_filters_unique_matcher_per_scheme ON package_repo_filters USING btree (scheme, matcher)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "package_repo_filters_behaviour_is_allow_or_block", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (behaviour = ANY ('{BLOCK,ALLOW}'::text[]))" }, { "Name": "package_repo_filters_is_pkgrepo_scheme", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (scheme = ANY ('{semanticdb,npm,go,python,rust-analyzer,scip-ruby}'::text[]))" }, { "Name": "package_repo_filters_valid_oneof_glob", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (matcher ? 'VersionGlob'::text AND (matcher -\u003e\u003e 'VersionGlob'::text) \u003c\u003e ''::text AND (matcher -\u003e\u003e 'PackageName'::text) \u003c\u003e ''::text AND NOT matcher ? 'PackageGlob'::text OR matcher ? 'PackageGlob'::text AND (matcher -\u003e\u003e 'PackageGlob'::text) \u003c\u003e ''::text AND NOT matcher ? 'VersionGlob'::text)" } ], "Triggers": [ { "Name": "trigger_package_repo_filters_updated_at", "Definition": "CREATE TRIGGER trigger_package_repo_filters_updated_at BEFORE UPDATE ON package_repo_filters FOR EACH ROW WHEN (old.* IS DISTINCT FROM new.*) EXECUTE FUNCTION func_package_repo_filters_updated_at()" } ] }, { "Name": "package_repo_versions", "Comment": "", "Columns": [ { "Name": "blocked", "Index": 4, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('package_repo_versions_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "last_checked_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "package_id", "Index": 2, "TypeName": "bigint", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "version", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "package_repo_versions_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX package_repo_versions_pkey ON package_repo_versions USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "package_repo_versions_unique_version_per_package", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX package_repo_versions_unique_version_per_package ON package_repo_versions USING btree (package_id, version)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "package_repo_versions_blocked", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX package_repo_versions_blocked ON package_repo_versions USING btree (blocked)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "package_repo_versions_last_checked_at", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX package_repo_versions_last_checked_at ON package_repo_versions USING btree (last_checked_at NULLS FIRST)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "package_id_fk", "ConstraintType": "f", "RefTableName": "lsif_dependency_repos", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (package_id) REFERENCES lsif_dependency_repos(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "permission_sync_jobs", "Comment": "", "Columns": [ { "Name": "cancel", "Index": 14, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "cancellation_reason", "Index": 20, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Specifies why permissions sync job was cancelled." }, { "Name": "code_host_states", "Index": 25, "TypeName": "json[]", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "execution_logs", "Index": 12, "TypeName": "json[]", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "failure_message", "Index": 4, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "finished_at", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('permission_sync_jobs_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "invalidate_caches", "Index": 19, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "is_partial_success", "Index": 26, "TypeName": "boolean", "IsNullable": true, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "last_heartbeat_at", "Index": 11, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "no_perms", "Index": 21, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_failures", "Index": 10, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_resets", "Index": 9, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "permissions_added", "Index": 22, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "permissions_found", "Index": 24, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "permissions_removed", "Index": 23, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "priority", "Index": 18, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Specifies numeric priority for the permissions sync job." }, { "Name": "process_after", "Index": 8, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "queued_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "reason", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Specifies why permissions sync job was triggered." }, { "Name": "repository_id", "Index": 15, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "started_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "state", "Index": 2, "TypeName": "text", "IsNullable": true, "Default": "'queued'::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "triggered_by_user_id", "Index": 17, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Specifies an ID of a user who triggered a sync." }, { "Name": "user_id", "Index": 16, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "worker_hostname", "Index": 13, "TypeName": "text", "IsNullable": false, "Default": "''::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "permission_sync_jobs_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX permission_sync_jobs_pkey ON permission_sync_jobs USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "permission_sync_jobs_unique", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX permission_sync_jobs_unique ON permission_sync_jobs USING btree (priority, user_id, repository_id, cancel, process_after) WHERE state = 'queued'::text", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "permission_sync_jobs_process_after", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX permission_sync_jobs_process_after ON permission_sync_jobs USING btree (process_after)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "permission_sync_jobs_repository_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX permission_sync_jobs_repository_id ON permission_sync_jobs USING btree (repository_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "permission_sync_jobs_state", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX permission_sync_jobs_state ON permission_sync_jobs USING btree (state)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "permission_sync_jobs_user_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX permission_sync_jobs_user_id ON permission_sync_jobs USING btree (user_id)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "permission_sync_jobs_for_repo_or_user", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK ((user_id IS NULL) \u003c\u003e (repository_id IS NULL))" }, { "Name": "permission_sync_jobs_repository_id_fkey", "ConstraintType": "f", "RefTableName": "repo", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (repository_id) REFERENCES repo(id) ON DELETE CASCADE" }, { "Name": "permission_sync_jobs_triggered_by_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (triggered_by_user_id) REFERENCES users(id) ON DELETE SET NULL DEFERRABLE" }, { "Name": "permission_sync_jobs_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "permissions", "Comment": "", "Columns": [ { "Name": "action", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_at", "Index": 4, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('permissions_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "namespace", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "permissions_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX permissions_pkey ON permissions USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "permissions_unique_namespace_action", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX permissions_unique_namespace_action ON permissions USING btree (namespace, action)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "action_not_blank", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (action \u003c\u003e ''::text)" }, { "Name": "namespace_not_blank", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (namespace \u003c\u003e ''::text)" } ], "Triggers": [] }, { "Name": "phabricator_repos", "Comment": "", "Columns": [ { "Name": "callsign", "Index": 2, "TypeName": "citext", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_at", "Index": 4, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "deleted_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('phabricator_repos_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "repo_name", "Index": 3, "TypeName": "citext", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "url", "Index": 7, "TypeName": "text", "IsNullable": false, "Default": "''::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "phabricator_repos_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX phabricator_repos_pkey ON phabricator_repos USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "phabricator_repos_repo_name_key", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX phabricator_repos_repo_name_key ON phabricator_repos USING btree (repo_name)", "ConstraintType": "u", "ConstraintDefinition": "UNIQUE (repo_name)" } ], "Constraints": null, "Triggers": [] }, { "Name": "product_licenses", "Comment": "", "Columns": [ { "Name": "access_token_enabled", "Index": 9, "TypeName": "boolean", "IsNullable": false, "Default": "true", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Whether this license key can be used as an access token to authenticate API requests" }, { "Name": "created_at", "Index": 4, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "uuid", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "license_check_token", "Index": 11, "TypeName": "bytea", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "license_expires_at", "Index": 8, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "license_key", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "license_tags", "Index": 6, "TypeName": "text[]", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "license_user_count", "Index": 7, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "license_version", "Index": 5, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "product_subscription_id", "Index": 2, "TypeName": "uuid", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "revoke_reason", "Index": 15, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "revoked_at", "Index": 12, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "salesforce_opp_id", "Index": 14, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "salesforce_sub_id", "Index": 13, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "site_id", "Index": 10, "TypeName": "uuid", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "product_licenses_license_check_token_idx", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX product_licenses_license_check_token_idx ON product_licenses USING btree (license_check_token)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "product_licenses_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX product_licenses_pkey ON product_licenses USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" } ], "Constraints": [ { "Name": "product_licenses_product_subscription_id_fkey", "ConstraintType": "f", "RefTableName": "product_subscriptions", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (product_subscription_id) REFERENCES product_subscriptions(id)" } ], "Triggers": [] }, { "Name": "product_subscriptions", "Comment": "", "Columns": [ { "Name": "account_number", "Index": 7, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "archived_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "billing_subscription_id", "Index": 3, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "cody_gateway_chat_rate_interval_seconds", "Index": 10, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "cody_gateway_chat_rate_limit", "Index": 9, "TypeName": "bigint", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "cody_gateway_chat_rate_limit_allowed_models", "Index": 14, "TypeName": "text[]", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "cody_gateway_code_rate_interval_seconds", "Index": 16, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "cody_gateway_code_rate_limit", "Index": 15, "TypeName": "bigint", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "cody_gateway_code_rate_limit_allowed_models", "Index": 17, "TypeName": "text[]", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "cody_gateway_embeddings_api_allowed_models", "Index": 13, "TypeName": "text[]", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Custom override for the set of models allowed for embedding" }, { "Name": "cody_gateway_embeddings_api_rate_interval_seconds", "Index": 12, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Custom time interval over which the embeddings rate limit is applied" }, { "Name": "cody_gateway_embeddings_api_rate_limit", "Index": 11, "TypeName": "bigint", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Custom requests per time interval allowed for embeddings" }, { "Name": "cody_gateway_enabled", "Index": 8, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_at", "Index": 4, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "uuid", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "user_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "product_subscriptions_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX product_subscriptions_pkey ON product_subscriptions USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" } ], "Constraints": [ { "Name": "product_subscriptions_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (user_id) REFERENCES users(id)" } ], "Triggers": [] }, { "Name": "query_runner_state", "Comment": "", "Columns": [ { "Name": "exec_duration_ns", "Index": 4, "TypeName": "bigint", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "last_executed", "Index": 2, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "latest_result", "Index": 3, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "query", "Index": 1, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [], "Constraints": null, "Triggers": [] }, { "Name": "redis_key_value", "Comment": "", "Columns": [ { "Name": "key", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "namespace", "Index": 1, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "value", "Index": 3, "TypeName": "bytea", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "redis_key_value_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX redis_key_value_pkey ON redis_key_value USING btree (namespace, key) INCLUDE (value)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (namespace, key) INCLUDE (value)" } ], "Constraints": null, "Triggers": [] }, { "Name": "registry_extension_releases", "Comment": "", "Columns": [ { "Name": "bundle", "Index": 7, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_at", "Index": 8, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "creator_user_id", "Index": 3, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "deleted_at", "Index": 9, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('registry_extension_releases_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "manifest", "Index": 6, "TypeName": "jsonb", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "registry_extension_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "release_tag", "Index": 5, "TypeName": "citext", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "release_version", "Index": 4, "TypeName": "citext", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "source_map", "Index": 10, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "registry_extension_releases_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX registry_extension_releases_pkey ON registry_extension_releases USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "registry_extension_releases_version", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX registry_extension_releases_version ON registry_extension_releases USING btree (registry_extension_id, release_version) WHERE release_version IS NOT NULL", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "registry_extension_releases_registry_extension_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX registry_extension_releases_registry_extension_id ON registry_extension_releases USING btree (registry_extension_id, release_tag, created_at DESC) WHERE deleted_at IS NULL", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "registry_extension_releases_registry_extension_id_created_at", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX registry_extension_releases_registry_extension_id_created_at ON registry_extension_releases USING btree (registry_extension_id, created_at) WHERE deleted_at IS NULL", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "registry_extension_releases_creator_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (creator_user_id) REFERENCES users(id)" }, { "Name": "registry_extension_releases_registry_extension_id_fkey", "ConstraintType": "f", "RefTableName": "registry_extensions", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (registry_extension_id) REFERENCES registry_extensions(id) ON UPDATE CASCADE ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "registry_extensions", "Comment": "", "Columns": [ { "Name": "created_at", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "deleted_at", "Index": 9, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('registry_extensions_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "manifest", "Index": 6, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "name", "Index": 5, "TypeName": "citext", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "publisher_org_id", "Index": 4, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "publisher_user_id", "Index": 3, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 8, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "uuid", "Index": 2, "TypeName": "uuid", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "registry_extensions_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX registry_extensions_pkey ON registry_extensions USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "registry_extensions_publisher_name", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX registry_extensions_publisher_name ON registry_extensions USING btree (COALESCE(publisher_user_id, 0), COALESCE(publisher_org_id, 0), name) WHERE deleted_at IS NULL", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "registry_extensions_uuid", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX registry_extensions_uuid ON registry_extensions USING btree (uuid)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "registry_extensions_name_length", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (char_length(name::text) \u003e 0 AND char_length(name::text) \u003c= 128)" }, { "Name": "registry_extensions_name_valid_chars", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (name ~ '^[a-zA-Z0-9](?:[a-zA-Z0-9]|[_.-](?=[a-zA-Z0-9]))*$'::citext)" }, { "Name": "registry_extensions_publisher_org_id_fkey", "ConstraintType": "f", "RefTableName": "orgs", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (publisher_org_id) REFERENCES orgs(id)" }, { "Name": "registry_extensions_publisher_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (publisher_user_id) REFERENCES users(id)" }, { "Name": "registry_extensions_single_publisher", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK ((publisher_user_id IS NULL) \u003c\u003e (publisher_org_id IS NULL))" } ], "Triggers": [] }, { "Name": "repo", "Comment": "", "Columns": [ { "Name": "archived", "Index": 10, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "blocked", "Index": 16, "TypeName": "jsonb", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "deleted_at", "Index": 12, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "description", "Index": 3, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "external_id", "Index": 7, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "external_service_id", "Index": 9, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "external_service_type", "Index": 8, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "fork", "Index": 4, "TypeName": "boolean", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('repo_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "metadata", "Index": 13, "TypeName": "jsonb", "IsNullable": false, "Default": "'{}'::jsonb", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "name", "Index": 2, "TypeName": "citext", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "private", "Index": 14, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "stars", "Index": 15, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "uri", "Index": 11, "TypeName": "citext", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "repo_external_unique_idx", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX repo_external_unique_idx ON repo USING btree (external_service_type, external_service_id, external_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "repo_name_unique", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": true, "IndexDefinition": "CREATE UNIQUE INDEX repo_name_unique ON repo USING btree (name)", "ConstraintType": "u", "ConstraintDefinition": "UNIQUE (name) DEFERRABLE" }, { "Name": "repo_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX repo_pkey ON repo USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "idx_repo_github_topics", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX idx_repo_github_topics ON repo USING gin (((metadata -\u003e 'RepositoryTopics'::text) -\u003e 'Nodes'::text)) WHERE external_service_type = 'github'::text", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "repo_archived", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX repo_archived ON repo USING btree (archived)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "repo_blocked_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX repo_blocked_idx ON repo USING btree ((blocked IS NOT NULL))", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "repo_created_at", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX repo_created_at ON repo USING btree (created_at)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "repo_description_trgm_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX repo_description_trgm_idx ON repo USING gin (lower(description) gin_trgm_ops)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "repo_dotcom_indexable_repos_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX repo_dotcom_indexable_repos_idx ON repo USING btree (stars DESC NULLS LAST) INCLUDE (id, name) WHERE deleted_at IS NULL AND blocked IS NULL AND (stars \u003e= 5 AND NOT COALESCE(fork, false) AND NOT archived OR lower(name::text) ~ '^(src\\.fedoraproject\\.org|maven|npm|jdk)'::text)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "repo_fork", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX repo_fork ON repo USING btree (fork)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "repo_hashed_name_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX repo_hashed_name_idx ON repo USING btree (sha256(lower(name::text)::bytea)) WHERE deleted_at IS NULL", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "repo_is_not_blocked_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX repo_is_not_blocked_idx ON repo USING btree ((blocked IS NULL))", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "repo_metadata_gin_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX repo_metadata_gin_idx ON repo USING gin (metadata)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "repo_name_case_sensitive_trgm_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX repo_name_case_sensitive_trgm_idx ON repo USING gin ((name::text) gin_trgm_ops)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "repo_name_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX repo_name_idx ON repo USING btree (lower(name::text) COLLATE \"C\")", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "repo_name_trgm", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX repo_name_trgm ON repo USING gin (lower(name::text) gin_trgm_ops)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "repo_non_deleted_id_name_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX repo_non_deleted_id_name_idx ON repo USING btree (id, name) WHERE deleted_at IS NULL", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "repo_private", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX repo_private ON repo USING btree (private)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "repo_stars_desc_id_desc_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX repo_stars_desc_id_desc_idx ON repo USING btree (stars DESC NULLS LAST, id DESC) WHERE deleted_at IS NULL AND blocked IS NULL", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "repo_stars_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX repo_stars_idx ON repo USING btree (stars DESC NULLS LAST)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "repo_uri_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX repo_uri_idx ON repo USING btree (uri)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "check_name_nonempty", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (name \u003c\u003e ''::citext)" }, { "Name": "repo_metadata_check", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (jsonb_typeof(metadata) = 'object'::text)" } ], "Triggers": [ { "Name": "trig_create_zoekt_repo_on_repo_insert", "Definition": "CREATE TRIGGER trig_create_zoekt_repo_on_repo_insert AFTER INSERT ON repo FOR EACH ROW EXECUTE FUNCTION func_insert_zoekt_repo()" }, { "Name": "trig_delete_repo_ref_on_external_service_repos", "Definition": "CREATE TRIGGER trig_delete_repo_ref_on_external_service_repos AFTER UPDATE OF deleted_at ON repo FOR EACH ROW EXECUTE FUNCTION delete_repo_ref_on_external_service_repos()" }, { "Name": "trig_delete_user_repo_permissions_on_repo_soft_delete", "Definition": "CREATE TRIGGER trig_delete_user_repo_permissions_on_repo_soft_delete AFTER UPDATE ON repo FOR EACH ROW EXECUTE FUNCTION delete_user_repo_permissions_on_repo_soft_delete()" }, { "Name": "trig_recalc_repo_statistics_on_repo_delete", "Definition": "CREATE TRIGGER trig_recalc_repo_statistics_on_repo_delete AFTER DELETE ON repo REFERENCING OLD TABLE AS oldtab FOR EACH STATEMENT EXECUTE FUNCTION recalc_repo_statistics_on_repo_delete()" }, { "Name": "trig_recalc_repo_statistics_on_repo_insert", "Definition": "CREATE TRIGGER trig_recalc_repo_statistics_on_repo_insert AFTER INSERT ON repo REFERENCING NEW TABLE AS newtab FOR EACH STATEMENT EXECUTE FUNCTION recalc_repo_statistics_on_repo_insert()" }, { "Name": "trig_recalc_repo_statistics_on_repo_update", "Definition": "CREATE TRIGGER trig_recalc_repo_statistics_on_repo_update AFTER UPDATE ON repo REFERENCING OLD TABLE AS oldtab NEW TABLE AS newtab FOR EACH STATEMENT EXECUTE FUNCTION recalc_repo_statistics_on_repo_update()" }, { "Name": "trigger_gitserver_repo_insert", "Definition": "CREATE TRIGGER trigger_gitserver_repo_insert AFTER INSERT ON repo FOR EACH ROW EXECUTE FUNCTION func_insert_gitserver_repo()" } ] }, { "Name": "repo_commits_changelists", "Comment": "", "Columns": [ { "Name": "commit_sha", "Index": 3, "TypeName": "bytea", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('repo_commits_changelists_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "perforce_changelist_id", "Index": 4, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "repo_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "repo_commits_changelists_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX repo_commits_changelists_pkey ON repo_commits_changelists USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "repo_id_perforce_changelist_id_unique", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX repo_id_perforce_changelist_id_unique ON repo_commits_changelists USING btree (repo_id, perforce_changelist_id)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "repo_commits_changelists_repo_id_fkey", "ConstraintType": "f", "RefTableName": "repo", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (repo_id) REFERENCES repo(id) ON DELETE CASCADE DEFERRABLE" } ], "Triggers": [] }, { "Name": "repo_embedding_job_stats", "Comment": "", "Columns": [ { "Name": "code_bytes_embedded", "Index": 7, "TypeName": "bigint", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "code_chunks_embedded", "Index": 5, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "code_chunks_excluded", "Index": 13, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "code_files_embedded", "Index": 4, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "code_files_skipped", "Index": 6, "TypeName": "jsonb", "IsNullable": false, "Default": "'{}'::jsonb", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "code_files_total", "Index": 3, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "is_incremental", "Index": 2, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "job_id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "text_bytes_embedded", "Index": 12, "TypeName": "bigint", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "text_chunks_embedded", "Index": 10, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "text_chunks_excluded", "Index": 14, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "text_files_embedded", "Index": 9, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "text_files_skipped", "Index": 11, "TypeName": "jsonb", "IsNullable": false, "Default": "'{}'::jsonb", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "text_files_total", "Index": 8, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "repo_embedding_job_stats_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX repo_embedding_job_stats_pkey ON repo_embedding_job_stats USING btree (job_id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (job_id)" } ], "Constraints": [ { "Name": "repo_embedding_job_stats_job_id_fkey", "ConstraintType": "f", "RefTableName": "repo_embedding_jobs", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (job_id) REFERENCES repo_embedding_jobs(id) ON DELETE CASCADE DEFERRABLE" } ], "Triggers": [] }, { "Name": "repo_embedding_jobs", "Comment": "", "Columns": [ { "Name": "cancel", "Index": 13, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "execution_logs", "Index": 11, "TypeName": "json[]", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "failure_message", "Index": 3, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "finished_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('repo_embedding_jobs_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "last_heartbeat_at", "Index": 10, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_failures", "Index": 9, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "num_resets", "Index": 8, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "process_after", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "queued_at", "Index": 4, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "repo_id", "Index": 14, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "revision", "Index": 15, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "started_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "state", "Index": 2, "TypeName": "text", "IsNullable": true, "Default": "'queued'::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "worker_hostname", "Index": 12, "TypeName": "text", "IsNullable": false, "Default": "''::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "repo_embedding_jobs_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX repo_embedding_jobs_pkey ON repo_embedding_jobs USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" } ], "Constraints": null, "Triggers": [] }, { "Name": "repo_kvps", "Comment": "", "Columns": [ { "Name": "key", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "repo_id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "value", "Index": 3, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "repo_kvps_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX repo_kvps_pkey ON repo_kvps USING btree (repo_id, key) INCLUDE (value)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (repo_id, key) INCLUDE (value)" } ], "Constraints": [ { "Name": "repo_kvps_repo_id_fkey", "ConstraintType": "f", "RefTableName": "repo", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (repo_id) REFERENCES repo(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "repo_paths", "Comment": "", "Columns": [ { "Name": "absolute_path", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Absolute path does not start or end with forward slash. Example: \"a/b/c\". Root directory is empty path \"\"." }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('repo_paths_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "parent_id", "Index": 4, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "repo_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "tree_files_count", "Index": 5, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Total count of files in the file tree rooted at the path. 1 for files." }, { "Name": "tree_files_counts_updated_at", "Index": 6, "TypeName": "timestamp without time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Timestamp of the job that updated the file counts" } ], "Indexes": [ { "Name": "repo_paths_index_absolute_path", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX repo_paths_index_absolute_path ON repo_paths USING btree (repo_id, absolute_path)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "repo_paths_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX repo_paths_pkey ON repo_paths USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" } ], "Constraints": [ { "Name": "repo_paths_parent_id_fkey", "ConstraintType": "f", "RefTableName": "repo_paths", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (parent_id) REFERENCES repo_paths(id)" }, { "Name": "repo_paths_repo_id_fkey", "ConstraintType": "f", "RefTableName": "repo", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (repo_id) REFERENCES repo(id) ON DELETE CASCADE DEFERRABLE" } ], "Triggers": [] }, { "Name": "repo_pending_permissions", "Comment": "", "Columns": [ { "Name": "permission", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "repo_id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 3, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "user_ids_ints", "Index": 4, "TypeName": "bigint[]", "IsNullable": false, "Default": "'{}'::integer[]", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "repo_pending_permissions_perm_unique", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX repo_pending_permissions_perm_unique ON repo_pending_permissions USING btree (repo_id, permission)", "ConstraintType": "u", "ConstraintDefinition": "UNIQUE (repo_id, permission)" } ], "Constraints": null, "Triggers": [] }, { "Name": "repo_permissions", "Comment": "", "Columns": [ { "Name": "permission", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "repo_id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "synced_at", "Index": 4, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "unrestricted", "Index": 6, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 3, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "user_ids_ints", "Index": 5, "TypeName": "integer[]", "IsNullable": false, "Default": "'{}'::integer[]", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "repo_permissions_perm_unique", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX repo_permissions_perm_unique ON repo_permissions USING btree (repo_id, permission)", "ConstraintType": "u", "ConstraintDefinition": "UNIQUE (repo_id, permission)" }, { "Name": "repo_permissions_unrestricted_true_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX repo_permissions_unrestricted_true_idx ON repo_permissions USING btree (unrestricted) WHERE unrestricted", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": null, "Triggers": [] }, { "Name": "repo_statistics", "Comment": "", "Columns": [ { "Name": "cloned", "Index": 5, "TypeName": "bigint", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Number of repositories that are NOT soft-deleted and not blocked and cloned by gitserver" }, { "Name": "cloning", "Index": 4, "TypeName": "bigint", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Number of repositories that are NOT soft-deleted and not blocked and currently being cloned by gitserver" }, { "Name": "corrupted", "Index": 7, "TypeName": "bigint", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Number of repositories that are NOT soft-deleted and not blocked and have corrupted_at set in gitserver_repos table" }, { "Name": "failed_fetch", "Index": 6, "TypeName": "bigint", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Number of repositories that are NOT soft-deleted and not blocked and have last_error set in gitserver_repos table" }, { "Name": "not_cloned", "Index": 3, "TypeName": "bigint", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Number of repositories that are NOT soft-deleted and not blocked and not cloned by gitserver" }, { "Name": "soft_deleted", "Index": 2, "TypeName": "bigint", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Number of repositories that are soft-deleted and not blocked" }, { "Name": "total", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Number of repositories that are not soft-deleted and not blocked" } ], "Indexes": [], "Constraints": null, "Triggers": [] }, { "Name": "role_permissions", "Comment": "", "Columns": [ { "Name": "created_at", "Index": 3, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "permission_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "role_id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "role_permissions_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX role_permissions_pkey ON role_permissions USING btree (permission_id, role_id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (permission_id, role_id)" } ], "Constraints": [ { "Name": "role_permissions_permission_id_fkey", "ConstraintType": "f", "RefTableName": "permissions", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (permission_id) REFERENCES permissions(id) ON DELETE CASCADE DEFERRABLE" }, { "Name": "role_permissions_role_id_fkey", "ConstraintType": "f", "RefTableName": "roles", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (role_id) REFERENCES roles(id) ON DELETE CASCADE DEFERRABLE" } ], "Triggers": [] }, { "Name": "roles", "Comment": "", "Columns": [ { "Name": "created_at", "Index": 3, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('roles_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "name", "Index": 6, "TypeName": "citext", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "system", "Index": 5, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "This is used to indicate whether a role is read-only or can be modified." } ], "Indexes": [ { "Name": "roles_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX roles_pkey ON roles USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "unique_role_name", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX unique_role_name ON roles USING btree (name)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": null, "Triggers": [] }, { "Name": "saved_searches", "Comment": "", "Columns": [ { "Name": "created_at", "Index": 4, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "description", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('saved_searches_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "notify_owner", "Index": 6, "TypeName": "boolean", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "notify_slack", "Index": 7, "TypeName": "boolean", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "org_id", "Index": 9, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "query", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "slack_webhook_url", "Index": 10, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "user_id", "Index": 8, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "saved_searches_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX saved_searches_pkey ON saved_searches USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" } ], "Constraints": [ { "Name": "saved_searches_notifications_disabled", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (notify_owner = false AND notify_slack = false)" }, { "Name": "saved_searches_org_id_fkey", "ConstraintType": "f", "RefTableName": "orgs", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (org_id) REFERENCES orgs(id)" }, { "Name": "saved_searches_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (user_id) REFERENCES users(id)" }, { "Name": "user_or_org_id_not_null", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (user_id IS NOT NULL AND org_id IS NULL OR org_id IS NOT NULL AND user_id IS NULL)" } ], "Triggers": [] }, { "Name": "search_context_default", "Comment": "When a user sets a search context as default, a row is inserted into this table. A user can only have one default search context. If the user has not set their default search context, it will fall back to `global`.", "Columns": [ { "Name": "search_context_id", "Index": 2, "TypeName": "bigint", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "user_id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "search_context_default_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX search_context_default_pkey ON search_context_default USING btree (user_id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (user_id)" } ], "Constraints": [ { "Name": "search_context_default_search_context_id_fkey", "ConstraintType": "f", "RefTableName": "search_contexts", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (search_context_id) REFERENCES search_contexts(id) ON DELETE CASCADE DEFERRABLE" }, { "Name": "search_context_default_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE DEFERRABLE" } ], "Triggers": [] }, { "Name": "search_context_repos", "Comment": "", "Columns": [ { "Name": "repo_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "revision", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "search_context_id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "search_context_repos_unique", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX search_context_repos_unique ON search_context_repos USING btree (repo_id, search_context_id, revision)", "ConstraintType": "u", "ConstraintDefinition": "UNIQUE (repo_id, search_context_id, revision)" } ], "Constraints": [ { "Name": "search_context_repos_repo_id_fk", "ConstraintType": "f", "RefTableName": "repo", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (repo_id) REFERENCES repo(id) ON DELETE CASCADE" }, { "Name": "search_context_repos_search_context_id_fk", "ConstraintType": "f", "RefTableName": "search_contexts", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (search_context_id) REFERENCES search_contexts(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "search_context_stars", "Comment": "When a user stars a search context, a row is inserted into this table. If the user unstars the search context, the row is deleted. The global context is not in the database, and therefore cannot be starred.", "Columns": [ { "Name": "created_at", "Index": 3, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "search_context_id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "user_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "search_context_stars_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX search_context_stars_pkey ON search_context_stars USING btree (search_context_id, user_id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (search_context_id, user_id)" } ], "Constraints": [ { "Name": "search_context_stars_search_context_id_fkey", "ConstraintType": "f", "RefTableName": "search_contexts", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (search_context_id) REFERENCES search_contexts(id) ON DELETE CASCADE DEFERRABLE" }, { "Name": "search_context_stars_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE DEFERRABLE" } ], "Triggers": [] }, { "Name": "search_contexts", "Comment": "", "Columns": [ { "Name": "created_at", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "deleted_at", "Index": 9, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "This column is unused as of Sourcegraph 3.34. Do not refer to it anymore. It will be dropped in a future version." }, { "Name": "description", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('search_contexts_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "name", "Index": 2, "TypeName": "citext", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "namespace_org_id", "Index": 6, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "namespace_user_id", "Index": 5, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "public", "Index": 4, "TypeName": "boolean", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "query", "Index": 10, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 8, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "search_contexts_name_namespace_org_id_unique", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX search_contexts_name_namespace_org_id_unique ON search_contexts USING btree (name, namespace_org_id) WHERE namespace_org_id IS NOT NULL", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "search_contexts_name_namespace_user_id_unique", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX search_contexts_name_namespace_user_id_unique ON search_contexts USING btree (name, namespace_user_id) WHERE namespace_user_id IS NOT NULL", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "search_contexts_name_without_namespace_unique", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX search_contexts_name_without_namespace_unique ON search_contexts USING btree (name) WHERE namespace_user_id IS NULL AND namespace_org_id IS NULL", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "search_contexts_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX search_contexts_pkey ON search_contexts USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "search_contexts_query_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX search_contexts_query_idx ON search_contexts USING btree (query)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "search_contexts_has_one_or_no_namespace", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (namespace_user_id IS NULL OR namespace_org_id IS NULL)" }, { "Name": "search_contexts_namespace_org_id_fk", "ConstraintType": "f", "RefTableName": "orgs", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (namespace_org_id) REFERENCES orgs(id) ON DELETE CASCADE" }, { "Name": "search_contexts_namespace_user_id_fk", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (namespace_user_id) REFERENCES users(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "security_event_logs", "Comment": "Contains security-relevant events with a long time horizon for storage.", "Columns": [ { "Name": "anonymous_user_id", "Index": 5, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The UUID of the actor associated with the event." }, { "Name": "argument", "Index": 7, "TypeName": "jsonb", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "An arbitrary JSON blob containing event data." }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('security_event_logs_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "name", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The event name as a CAPITALIZED_SNAKE_CASE string." }, { "Name": "source", "Index": 6, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The site section (WEB, BACKEND, etc.) that generated the event." }, { "Name": "timestamp", "Index": 9, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "url", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The URL within the Sourcegraph app which generated the event." }, { "Name": "user_id", "Index": 4, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The ID of the actor associated with the event." }, { "Name": "version", "Index": 8, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The version of Sourcegraph which generated the event." } ], "Indexes": [ { "Name": "security_event_logs_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX security_event_logs_pkey ON security_event_logs USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "security_event_logs_timestamp", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX security_event_logs_timestamp ON security_event_logs USING btree (\"timestamp\")", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "security_event_logs_check_has_user", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (user_id = 0 AND anonymous_user_id \u003c\u003e ''::text OR user_id \u003c\u003e 0 AND anonymous_user_id = ''::text OR user_id \u003c\u003e 0 AND anonymous_user_id \u003c\u003e ''::text)" }, { "Name": "security_event_logs_check_name_not_empty", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (name \u003c\u003e ''::text)" }, { "Name": "security_event_logs_check_source_not_empty", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (source \u003c\u003e ''::text)" }, { "Name": "security_event_logs_check_version_not_empty", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (version \u003c\u003e ''::text)" } ], "Triggers": [] }, { "Name": "settings", "Comment": "", "Columns": [ { "Name": "author_user_id", "Index": 6, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "contents", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "'{}'::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_at", "Index": 4, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('settings_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "org_id", "Index": 2, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "user_id", "Index": 5, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "settings_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX settings_pkey ON settings USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "settings_global_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX settings_global_id ON settings USING btree (id DESC) WHERE user_id IS NULL AND org_id IS NULL", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "settings_org_id_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX settings_org_id_idx ON settings USING btree (org_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "settings_user_id_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX settings_user_id_idx ON settings USING btree (user_id)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "settings_author_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (author_user_id) REFERENCES users(id) ON DELETE RESTRICT" }, { "Name": "settings_no_empty_contents", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (contents \u003c\u003e ''::text)" }, { "Name": "settings_references_orgs", "ConstraintType": "f", "RefTableName": "orgs", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (org_id) REFERENCES orgs(id) ON DELETE RESTRICT" }, { "Name": "settings_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE RESTRICT" } ], "Triggers": [] }, { "Name": "sub_repo_permissions", "Comment": "Responsible for storing permissions at a finer granularity than repo", "Columns": [ { "Name": "paths", "Index": 7, "TypeName": "text[]", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Paths that begin with a minus sign (-) are exclusion paths." }, { "Name": "repo_id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "user_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "version", "Index": 3, "TypeName": "integer", "IsNullable": false, "Default": "1", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "sub_repo_permissions_repo_id_user_id_version_uindex", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX sub_repo_permissions_repo_id_user_id_version_uindex ON sub_repo_permissions USING btree (repo_id, user_id, version)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "sub_repo_perms_user_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX sub_repo_perms_user_id ON sub_repo_permissions USING btree (user_id)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "sub_repo_permissions_repo_id_fk", "ConstraintType": "f", "RefTableName": "repo", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (repo_id) REFERENCES repo(id) ON DELETE CASCADE" }, { "Name": "sub_repo_permissions_users_id_fk", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "survey_responses", "Comment": "", "Columns": [ { "Name": "better", "Index": 6, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_at", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "email", "Index": 3, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('survey_responses_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "other_use_case", "Index": 9, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "reason", "Index": 5, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "score", "Index": 4, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "use_cases", "Index": 8, "TypeName": "text[]", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "user_id", "Index": 2, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "survey_responses_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX survey_responses_pkey ON survey_responses USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" } ], "Constraints": [ { "Name": "survey_responses_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (user_id) REFERENCES users(id)" } ], "Triggers": [] }, { "Name": "team_members", "Comment": "", "Columns": [ { "Name": "created_at", "Index": 3, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "team_id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 4, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "user_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "team_members_team_id_user_id_key", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX team_members_team_id_user_id_key ON team_members USING btree (team_id, user_id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (team_id, user_id)" } ], "Constraints": [ { "Name": "team_members_team_id_fkey", "ConstraintType": "f", "RefTableName": "teams", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (team_id) REFERENCES teams(id) ON DELETE CASCADE" }, { "Name": "team_members_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "teams", "Comment": "", "Columns": [ { "Name": "created_at", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "creator_id", "Index": 6, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "display_name", "Index": 3, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('teams_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "name", "Index": 2, "TypeName": "citext", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "parent_team_id", "Index": 5, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "readonly", "Index": 4, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 8, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "teams_name", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX teams_name ON teams USING btree (name)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "teams_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX teams_pkey ON teams USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" } ], "Constraints": [ { "Name": "teams_creator_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (creator_id) REFERENCES users(id) ON DELETE SET NULL" }, { "Name": "teams_display_name_max_length", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (char_length(display_name) \u003c= 255)" }, { "Name": "teams_name_max_length", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (char_length(name::text) \u003c= 255)" }, { "Name": "teams_name_valid_chars", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (name ~ '^[a-zA-Z0-9](?:[a-zA-Z0-9]|[-.](?=[a-zA-Z0-9]))*-?$'::citext)" }, { "Name": "teams_parent_team_id_fkey", "ConstraintType": "f", "RefTableName": "teams", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (parent_team_id) REFERENCES teams(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "telemetry_events_export_queue", "Comment": "", "Columns": [ { "Name": "exported_at", "Index": 4, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "payload_pb", "Index": 3, "TypeName": "bytea", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "timestamp", "Index": 2, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "telemetry_events_export_queue_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX telemetry_events_export_queue_pkey ON telemetry_events_export_queue USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" } ], "Constraints": null, "Triggers": [] }, { "Name": "temporary_settings", "Comment": "Stores per-user temporary settings used in the UI, for example, which modals have been dimissed or what theme is preferred.", "Columns": [ { "Name": "contents", "Index": 3, "TypeName": "jsonb", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "JSON-encoded temporary settings." }, { "Name": "created_at", "Index": 4, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('temporary_settings_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "user_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "The ID of the user the settings will be saved for." } ], "Indexes": [ { "Name": "temporary_settings_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX temporary_settings_pkey ON temporary_settings USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "temporary_settings_user_id_key", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX temporary_settings_user_id_key ON temporary_settings USING btree (user_id)", "ConstraintType": "u", "ConstraintDefinition": "UNIQUE (user_id)" } ], "Constraints": [ { "Name": "temporary_settings_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "user_credentials", "Comment": "", "Columns": [ { "Name": "created_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "credential", "Index": 8, "TypeName": "bytea", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "domain", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "encryption_key_id", "Index": 10, "TypeName": "text", "IsNullable": false, "Default": "''::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "external_service_id", "Index": 5, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "external_service_type", "Index": 4, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('user_credentials_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "ssh_migration_applied", "Index": 9, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "user_id", "Index": 3, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "user_credentials_domain_user_id_external_service_type_exter_key", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX user_credentials_domain_user_id_external_service_type_exter_key ON user_credentials USING btree (domain, user_id, external_service_type, external_service_id)", "ConstraintType": "u", "ConstraintDefinition": "UNIQUE (domain, user_id, external_service_type, external_service_id)" }, { "Name": "user_credentials_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX user_credentials_pkey ON user_credentials USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "user_credentials_credential_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX user_credentials_credential_idx ON user_credentials USING btree ((encryption_key_id = ANY (ARRAY[''::text, 'previously-migrated'::text])))", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "user_credentials_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE DEFERRABLE" } ], "Triggers": [] }, { "Name": "user_emails", "Comment": "", "Columns": [ { "Name": "created_at", "Index": 3, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "email", "Index": 2, "TypeName": "citext", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "is_primary", "Index": 7, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "last_verification_sent_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "user_id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "verification_code", "Index": 4, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "verified_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "user_emails_no_duplicates_per_user", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX user_emails_no_duplicates_per_user ON user_emails USING btree (user_id, email)", "ConstraintType": "u", "ConstraintDefinition": "UNIQUE (user_id, email)" }, { "Name": "user_emails_user_id_is_primary_idx", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX user_emails_user_id_is_primary_idx ON user_emails USING btree (user_id, is_primary) WHERE is_primary = true", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "user_emails_unique_verified_email", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": true, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX user_emails_unique_verified_email ON user_emails USING btree (email) WHERE verified_at IS NOT NULL", "ConstraintType": "x", "ConstraintDefinition": "EXCLUDE USING btree (email WITH =) WHERE (verified_at IS NOT NULL)" } ], "Constraints": [ { "Name": "user_emails_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (user_id) REFERENCES users(id)" } ], "Triggers": [] }, { "Name": "user_external_accounts", "Comment": "", "Columns": [ { "Name": "account_data", "Index": 7, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "account_id", "Index": 5, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "auth_data", "Index": 6, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "client_id", "Index": 11, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_at", "Index": 8, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "deleted_at", "Index": 10, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "encryption_key_id", "Index": 14, "TypeName": "text", "IsNullable": false, "Default": "''::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "expired_at", "Index": 12, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('user_external_accounts_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "last_valid_at", "Index": 13, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "service_id", "Index": 4, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "service_type", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 9, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "user_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "user_external_accounts_account", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX user_external_accounts_account ON user_external_accounts USING btree (service_type, service_id, client_id, account_id) WHERE deleted_at IS NULL", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "user_external_accounts_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX user_external_accounts_pkey ON user_external_accounts USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "user_external_accounts_user_id_scim_service_type", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX user_external_accounts_user_id_scim_service_type ON user_external_accounts USING btree (user_id, service_type) WHERE service_type = 'scim'::text", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "user_external_accounts_user_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX user_external_accounts_user_id ON user_external_accounts USING btree (user_id) WHERE deleted_at IS NULL", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "user_external_accounts_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (user_id) REFERENCES users(id)" } ], "Triggers": [ { "Name": "trig_delete_user_repo_permissions_on_external_account_soft_dele", "Definition": "CREATE TRIGGER trig_delete_user_repo_permissions_on_external_account_soft_dele AFTER UPDATE ON user_external_accounts FOR EACH ROW EXECUTE FUNCTION delete_user_repo_permissions_on_external_account_soft_delete()" } ] }, { "Name": "user_onboarding_tour", "Comment": "", "Columns": [ { "Name": "created_at", "Index": 3, "TypeName": "timestamp without time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('user_onboarding_tour_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "raw_json", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_by", "Index": 4, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "user_onboarding_tour_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX user_onboarding_tour_pkey ON user_onboarding_tour USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" } ], "Constraints": [ { "Name": "user_onboarding_tour_users_fk", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (updated_by) REFERENCES users(id)" } ], "Triggers": [] }, { "Name": "user_pending_permissions", "Comment": "", "Columns": [ { "Name": "bind_id", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('user_pending_permissions_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "object_ids_ints", "Index": 8, "TypeName": "integer[]", "IsNullable": false, "Default": "'{}'::integer[]", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "object_type", "Index": 4, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "permission", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "service_id", "Index": 7, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "service_type", "Index": 6, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "user_pending_permissions_service_perm_object_unique", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX user_pending_permissions_service_perm_object_unique ON user_pending_permissions USING btree (service_type, service_id, permission, object_type, bind_id)", "ConstraintType": "u", "ConstraintDefinition": "UNIQUE (service_type, service_id, permission, object_type, bind_id)" } ], "Constraints": null, "Triggers": [] }, { "Name": "user_permissions", "Comment": "", "Columns": [ { "Name": "migrated", "Index": 7, "TypeName": "boolean", "IsNullable": true, "Default": "true", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "object_ids_ints", "Index": 6, "TypeName": "integer[]", "IsNullable": false, "Default": "'{}'::integer[]", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "object_type", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "permission", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "synced_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 4, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "user_id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "user_permissions_perm_object_unique", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX user_permissions_perm_object_unique ON user_permissions USING btree (user_id, permission, object_type)", "ConstraintType": "u", "ConstraintDefinition": "UNIQUE (user_id, permission, object_type)" } ], "Constraints": null, "Triggers": [] }, { "Name": "user_public_repos", "Comment": "", "Columns": [ { "Name": "repo_id", "Index": 3, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "repo_uri", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "user_id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "user_public_repos_user_id_repo_id_key", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX user_public_repos_user_id_repo_id_key ON user_public_repos USING btree (user_id, repo_id)", "ConstraintType": "u", "ConstraintDefinition": "UNIQUE (user_id, repo_id)" } ], "Constraints": [ { "Name": "user_public_repos_repo_id_fkey", "ConstraintType": "f", "RefTableName": "repo", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (repo_id) REFERENCES repo(id) ON DELETE CASCADE" }, { "Name": "user_public_repos_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "user_repo_permissions", "Comment": "", "Columns": [ { "Name": "created_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('user_repo_permissions_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "repo_id", "Index": 3, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "source", "Index": 7, "TypeName": "text", "IsNullable": false, "Default": "'sync'::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "user_external_account_id", "Index": 4, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "user_id", "Index": 2, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "user_repo_permissions_perms_unique_idx", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX user_repo_permissions_perms_unique_idx ON user_repo_permissions USING btree (user_id, user_external_account_id, repo_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "user_repo_permissions_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX user_repo_permissions_pkey ON user_repo_permissions USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "user_repo_permissions_repo_id_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX user_repo_permissions_repo_id_idx ON user_repo_permissions USING btree (repo_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "user_repo_permissions_source_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX user_repo_permissions_source_idx ON user_repo_permissions USING btree (source)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "user_repo_permissions_updated_at_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX user_repo_permissions_updated_at_idx ON user_repo_permissions USING btree (updated_at)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "user_repo_permissions_user_external_account_id_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX user_repo_permissions_user_external_account_id_idx ON user_repo_permissions USING btree (user_external_account_id)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "user_repo_permissions_repo_id_fkey", "ConstraintType": "f", "RefTableName": "repo", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (repo_id) REFERENCES repo(id) ON DELETE CASCADE" }, { "Name": "user_repo_permissions_user_external_account_id_fkey", "ConstraintType": "f", "RefTableName": "user_external_accounts", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (user_external_account_id) REFERENCES user_external_accounts(id) ON DELETE CASCADE" }, { "Name": "user_repo_permissions_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "user_roles", "Comment": "", "Columns": [ { "Name": "created_at", "Index": 3, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "role_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "user_id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "user_roles_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX user_roles_pkey ON user_roles USING btree (user_id, role_id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (user_id, role_id)" } ], "Constraints": [ { "Name": "user_roles_role_id_fkey", "ConstraintType": "f", "RefTableName": "roles", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (role_id) REFERENCES roles(id) ON DELETE CASCADE DEFERRABLE" }, { "Name": "user_roles_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": true, "ConstraintDefinition": "FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE DEFERRABLE" } ], "Triggers": [] }, { "Name": "users", "Comment": "", "Columns": [ { "Name": "avatar_url", "Index": 4, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "billing_customer_id", "Index": 16, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "code_completions_quota", "Index": 21, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "completed_post_signup", "Index": 22, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "completions_quota", "Index": 20, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "deleted_at", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "display_name", "Index": 3, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('users_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "invalidated_sessions_at", "Index": 17, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "invite_quota", "Index": 8, "TypeName": "integer", "IsNullable": false, "Default": "100", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "page_views", "Index": 13, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "passwd", "Index": 9, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "passwd_reset_code", "Index": 10, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "passwd_reset_time", "Index": 11, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "search_queries", "Index": 14, "TypeName": "integer", "IsNullable": false, "Default": "0", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "searchable", "Index": 19, "TypeName": "boolean", "IsNullable": false, "Default": "true", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "site_admin", "Index": 12, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "tags", "Index": 15, "TypeName": "text[]", "IsNullable": true, "Default": "'{}'::text[]", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "tos_accepted", "Index": 18, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "username", "Index": 2, "TypeName": "citext", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "users_billing_customer_id", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX users_billing_customer_id ON users USING btree (billing_customer_id) WHERE deleted_at IS NULL", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "users_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX users_pkey ON users USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "users_username", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX users_username ON users USING btree (username) WHERE deleted_at IS NULL", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "users_created_at_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX users_created_at_idx ON users USING btree (created_at)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "users_display_name_max_length", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (char_length(display_name) \u003c= 255)" }, { "Name": "users_username_max_length", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (char_length(username::text) \u003c= 255)" }, { "Name": "users_username_valid_chars", "ConstraintType": "c", "RefTableName": "", "IsDeferrable": false, "ConstraintDefinition": "CHECK (username ~ '^\\w(?:\\w|[-.](?=\\w))*-?$'::citext)" } ], "Triggers": [ { "Name": "trig_delete_user_repo_permissions_on_user_soft_delete", "Definition": "CREATE TRIGGER trig_delete_user_repo_permissions_on_user_soft_delete AFTER UPDATE ON users FOR EACH ROW EXECUTE FUNCTION delete_user_repo_permissions_on_user_soft_delete()" }, { "Name": "trig_invalidate_session_on_password_change", "Definition": "CREATE TRIGGER trig_invalidate_session_on_password_change BEFORE UPDATE OF passwd ON users FOR EACH ROW EXECUTE FUNCTION invalidate_session_for_userid_on_password_change()" }, { "Name": "trig_soft_delete_user_reference_on_external_service", "Definition": "CREATE TRIGGER trig_soft_delete_user_reference_on_external_service AFTER UPDATE OF deleted_at ON users FOR EACH ROW EXECUTE FUNCTION soft_delete_user_reference_on_external_service()" } ] }, { "Name": "versions", "Comment": "", "Columns": [ { "Name": "auto_upgrade", "Index": 5, "TypeName": "boolean", "IsNullable": false, "Default": "false", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "first_version", "Index": 4, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "service", "Index": 1, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 3, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "version", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "versions_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX versions_pkey ON versions USING btree (service)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (service)" } ], "Constraints": null, "Triggers": [ { "Name": "versions_insert", "Definition": "CREATE TRIGGER versions_insert BEFORE INSERT ON versions FOR EACH ROW EXECUTE FUNCTION versions_insert_row_trigger()" } ] }, { "Name": "vulnerabilities", "Comment": "", "Columns": [ { "Name": "aliases", "Index": 7, "TypeName": "text[]", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "cpes", "Index": 5, "TypeName": "text[]", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "cvss_score", "Index": 13, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "cvss_vector", "Index": 12, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "cwes", "Index": 6, "TypeName": "text[]", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "data_source", "Index": 9, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "details", "Index": 4, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('vulnerabilities_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "modified_at", "Index": 15, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "published_at", "Index": 14, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "related", "Index": 8, "TypeName": "text[]", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "severity", "Index": 11, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "source_id", "Index": 2, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "summary", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "urls", "Index": 10, "TypeName": "text[]", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "withdrawn_at", "Index": 16, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "vulnerabilities_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX vulnerabilities_pkey ON vulnerabilities USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "vulnerabilities_source_id", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX vulnerabilities_source_id ON vulnerabilities USING btree (source_id)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": null, "Triggers": [] }, { "Name": "vulnerability_affected_packages", "Comment": "", "Columns": [ { "Name": "fixed", "Index": 7, "TypeName": "boolean", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "fixed_in", "Index": 8, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('vulnerability_affected_packages_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "language", "Index": 4, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "namespace", "Index": 5, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "package_name", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "version_constraint", "Index": 6, "TypeName": "text[]", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "vulnerability_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "vulnerability_affected_packages_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX vulnerability_affected_packages_pkey ON vulnerability_affected_packages USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "vulnerability_affected_packages_vulnerability_id_package_name", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX vulnerability_affected_packages_vulnerability_id_package_name ON vulnerability_affected_packages USING btree (vulnerability_id, package_name)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "fk_vulnerabilities", "ConstraintType": "f", "RefTableName": "vulnerabilities", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (vulnerability_id) REFERENCES vulnerabilities(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "vulnerability_affected_symbols", "Comment": "", "Columns": [ { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('vulnerability_affected_symbols_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "path", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "symbols", "Index": 4, "TypeName": "text[]", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "vulnerability_affected_package_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "vulnerability_affected_symbols_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX vulnerability_affected_symbols_pkey ON vulnerability_affected_symbols USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "vulnerability_affected_symbols_vulnerability_affected_package_i", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX vulnerability_affected_symbols_vulnerability_affected_package_i ON vulnerability_affected_symbols USING btree (vulnerability_affected_package_id, path)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "fk_vulnerability_affected_packages", "ConstraintType": "f", "RefTableName": "vulnerability_affected_packages", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (vulnerability_affected_package_id) REFERENCES vulnerability_affected_packages(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "vulnerability_matches", "Comment": "", "Columns": [ { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('vulnerability_matches_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "upload_id", "Index": 2, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "vulnerability_affected_package_id", "Index": 3, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "vulnerability_matches_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX vulnerability_matches_pkey ON vulnerability_matches USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "vulnerability_matches_upload_id_vulnerability_affected_package_", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX vulnerability_matches_upload_id_vulnerability_affected_package_ ON vulnerability_matches USING btree (upload_id, vulnerability_affected_package_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "vulnerability_matches_vulnerability_affected_package_id", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX vulnerability_matches_vulnerability_affected_package_id ON vulnerability_matches USING btree (vulnerability_affected_package_id)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "fk_upload", "ConstraintType": "f", "RefTableName": "lsif_uploads", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (upload_id) REFERENCES lsif_uploads(id) ON DELETE CASCADE" }, { "Name": "fk_vulnerability_affected_packages", "ConstraintType": "f", "RefTableName": "vulnerability_affected_packages", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (vulnerability_affected_package_id) REFERENCES vulnerability_affected_packages(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "webhook_logs", "Comment": "", "Columns": [ { "Name": "encryption_key_id", "Index": 7, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "external_service_id", "Index": 3, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "bigint", "IsNullable": false, "Default": "nextval('webhook_logs_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "received_at", "Index": 2, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "request", "Index": 5, "TypeName": "bytea", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "response", "Index": 6, "TypeName": "bytea", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "status_code", "Index": 4, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "webhook_id", "Index": 8, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "webhook_logs_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX webhook_logs_pkey ON webhook_logs USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "webhook_logs_external_service_id_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX webhook_logs_external_service_id_idx ON webhook_logs USING btree (external_service_id)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "webhook_logs_received_at_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX webhook_logs_received_at_idx ON webhook_logs USING btree (received_at)", "ConstraintType": "", "ConstraintDefinition": "" }, { "Name": "webhook_logs_status_code_idx", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX webhook_logs_status_code_idx ON webhook_logs USING btree (status_code)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "webhook_logs_external_service_id_fkey", "ConstraintType": "f", "RefTableName": "external_services", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (external_service_id) REFERENCES external_services(id) ON UPDATE CASCADE ON DELETE CASCADE" }, { "Name": "webhook_logs_webhook_id_fkey", "ConstraintType": "f", "RefTableName": "webhooks", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (webhook_id) REFERENCES webhooks(id) ON DELETE CASCADE" } ], "Triggers": [] }, { "Name": "webhooks", "Comment": "Webhooks registered in Sourcegraph instance.", "Columns": [ { "Name": "code_host_kind", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Kind of an external service for which webhooks are registered." }, { "Name": "code_host_urn", "Index": 4, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "URN of a code host. This column maps to external_service_id column of repo table." }, { "Name": "created_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_by_user_id", "Index": 10, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "ID of a user, who created the webhook. If NULL, then the user does not exist (never existed or was deleted)." }, { "Name": "encryption_key_id", "Index": 8, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "nextval('webhooks_id_seq'::regclass)", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "name", "Index": 12, "TypeName": "text", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Descriptive name of a webhook." }, { "Name": "secret", "Index": 5, "TypeName": "text", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "Secret used to decrypt webhook payload (if supported by the code host)." }, { "Name": "updated_at", "Index": 7, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_by_user_id", "Index": 11, "TypeName": "integer", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "ID of a user, who updated the webhook. If NULL, then the user does not exist (never existed or was deleted)." }, { "Name": "uuid", "Index": 9, "TypeName": "uuid", "IsNullable": false, "Default": "gen_random_uuid()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "webhooks_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX webhooks_pkey ON webhooks USING btree (id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (id)" }, { "Name": "webhooks_uuid_key", "IsPrimaryKey": false, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX webhooks_uuid_key ON webhooks USING btree (uuid)", "ConstraintType": "u", "ConstraintDefinition": "UNIQUE (uuid)" } ], "Constraints": [ { "Name": "webhooks_created_by_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (created_by_user_id) REFERENCES users(id) ON DELETE SET NULL" }, { "Name": "webhooks_updated_by_user_id_fkey", "ConstraintType": "f", "RefTableName": "users", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (updated_by_user_id) REFERENCES users(id) ON DELETE SET NULL" } ], "Triggers": [] }, { "Name": "zoekt_repos", "Comment": "", "Columns": [ { "Name": "branches", "Index": 2, "TypeName": "jsonb", "IsNullable": false, "Default": "'[]'::jsonb", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "created_at", "Index": 5, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "index_status", "Index": 3, "TypeName": "text", "IsNullable": false, "Default": "'not_indexed'::text", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "last_indexed_at", "Index": 6, "TypeName": "timestamp with time zone", "IsNullable": true, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "repo_id", "Index": 1, "TypeName": "integer", "IsNullable": false, "Default": "", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" }, { "Name": "updated_at", "Index": 4, "TypeName": "timestamp with time zone", "IsNullable": false, "Default": "now()", "CharacterMaximumLength": 0, "IsIdentity": false, "IdentityGeneration": "", "IsGenerated": "NEVER", "GenerationExpression": "", "Comment": "" } ], "Indexes": [ { "Name": "zoekt_repos_pkey", "IsPrimaryKey": true, "IsUnique": true, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE UNIQUE INDEX zoekt_repos_pkey ON zoekt_repos USING btree (repo_id)", "ConstraintType": "p", "ConstraintDefinition": "PRIMARY KEY (repo_id)" }, { "Name": "zoekt_repos_index_status", "IsPrimaryKey": false, "IsUnique": false, "IsExclusion": false, "IsDeferrable": false, "IndexDefinition": "CREATE INDEX zoekt_repos_index_status ON zoekt_repos USING btree (index_status)", "ConstraintType": "", "ConstraintDefinition": "" } ], "Constraints": [ { "Name": "zoekt_repos_repo_id_fkey", "ConstraintType": "f", "RefTableName": "repo", "IsDeferrable": false, "ConstraintDefinition": "FOREIGN KEY (repo_id) REFERENCES repo(id) ON DELETE CASCADE" } ], "Triggers": [] } ], "Views": [ { "Name": "batch_spec_workspace_execution_jobs_with_rank", "Definition": " SELECT j.id,\n j.batch_spec_workspace_id,\n j.state,\n j.failure_message,\n j.started_at,\n j.finished_at,\n j.process_after,\n j.num_resets,\n j.num_failures,\n j.execution_logs,\n j.worker_hostname,\n j.last_heartbeat_at,\n j.created_at,\n j.updated_at,\n j.cancel,\n j.queued_at,\n j.user_id,\n j.version,\n q.place_in_global_queue,\n q.place_in_user_queue\n FROM (batch_spec_workspace_execution_jobs j\n LEFT JOIN batch_spec_workspace_execution_queue q ON ((j.id = q.id)));" }, { "Name": "batch_spec_workspace_execution_queue", "Definition": " WITH queue_candidates AS (\n SELECT exec.id,\n rank() OVER (PARTITION BY queue.user_id ORDER BY exec.created_at, exec.id) AS place_in_user_queue\n FROM (batch_spec_workspace_execution_jobs exec\n JOIN batch_spec_workspace_execution_last_dequeues queue ON ((queue.user_id = exec.user_id)))\n WHERE (exec.state = 'queued'::text)\n ORDER BY (rank() OVER (PARTITION BY queue.user_id ORDER BY exec.created_at, exec.id)), queue.latest_dequeue NULLS FIRST\n )\n SELECT queue_candidates.id,\n row_number() OVER () AS place_in_global_queue,\n queue_candidates.place_in_user_queue\n FROM queue_candidates;" }, { "Name": "branch_changeset_specs_and_changesets", "Definition": " SELECT changeset_specs.id AS changeset_spec_id,\n COALESCE(changesets.id, (0)::bigint) AS changeset_id,\n changeset_specs.repo_id,\n changeset_specs.batch_spec_id,\n changesets.owned_by_batch_change_id AS owner_batch_change_id,\n repo.name AS repo_name,\n changeset_specs.title AS changeset_name,\n changesets.external_state,\n changesets.publication_state,\n changesets.reconciler_state,\n changesets.computed_state\n FROM ((changeset_specs\n LEFT JOIN changesets ON (((changesets.repo_id = changeset_specs.repo_id) AND (changesets.current_spec_id IS NOT NULL) AND (EXISTS ( SELECT 1\n FROM changeset_specs changeset_specs_1\n WHERE ((changeset_specs_1.id = changesets.current_spec_id) AND (changeset_specs_1.head_ref = changeset_specs.head_ref)))))))\n JOIN repo ON ((changeset_specs.repo_id = repo.id)))\n WHERE ((changeset_specs.external_id IS NULL) AND (repo.deleted_at IS NULL));" }, { "Name": "codeintel_configuration_policies", "Definition": " SELECT lsif_configuration_policies.id,\n lsif_configuration_policies.repository_id,\n lsif_configuration_policies.name,\n lsif_configuration_policies.type,\n lsif_configuration_policies.pattern,\n lsif_configuration_policies.retention_enabled,\n lsif_configuration_policies.retention_duration_hours,\n lsif_configuration_policies.retain_intermediate_commits,\n lsif_configuration_policies.indexing_enabled,\n lsif_configuration_policies.index_commit_max_age_hours,\n lsif_configuration_policies.index_intermediate_commits,\n lsif_configuration_policies.protected,\n lsif_configuration_policies.repository_patterns,\n lsif_configuration_policies.last_resolved_at,\n lsif_configuration_policies.embeddings_enabled\n FROM lsif_configuration_policies;" }, { "Name": "codeintel_configuration_policies_repository_pattern_lookup", "Definition": " SELECT lsif_configuration_policies_repository_pattern_lookup.policy_id,\n lsif_configuration_policies_repository_pattern_lookup.repo_id\n FROM lsif_configuration_policies_repository_pattern_lookup;" }, { "Name": "external_service_sync_jobs_with_next_sync_at", "Definition": " SELECT j.id,\n j.state,\n j.failure_message,\n j.queued_at,\n j.started_at,\n j.finished_at,\n j.process_after,\n j.num_resets,\n j.num_failures,\n j.execution_logs,\n j.external_service_id,\n e.next_sync_at\n FROM (external_services e\n JOIN external_service_sync_jobs j ON ((e.id = j.external_service_id)));" }, { "Name": "gitserver_relocator_jobs_with_repo_name", "Definition": " SELECT glj.id,\n glj.state,\n glj.queued_at,\n glj.failure_message,\n glj.started_at,\n glj.finished_at,\n glj.process_after,\n glj.num_resets,\n glj.num_failures,\n glj.last_heartbeat_at,\n glj.execution_logs,\n glj.worker_hostname,\n glj.repo_id,\n glj.source_hostname,\n glj.dest_hostname,\n glj.delete_source,\n r.name AS repo_name\n FROM (gitserver_relocator_jobs glj\n JOIN repo r ON ((r.id = glj.repo_id)));" }, { "Name": "lsif_dumps", "Definition": " SELECT u.id,\n u.commit,\n u.root,\n u.queued_at,\n u.uploaded_at,\n u.state,\n u.failure_message,\n u.started_at,\n u.finished_at,\n u.repository_id,\n u.indexer,\n u.indexer_version,\n u.num_parts,\n u.uploaded_parts,\n u.process_after,\n u.num_resets,\n u.upload_size,\n u.num_failures,\n u.associated_index_id,\n u.expired,\n u.last_retention_scan_at,\n u.finished_at AS processed_at\n FROM lsif_uploads u\n WHERE ((u.state = 'completed'::text) OR (u.state = 'deleting'::text));" }, { "Name": "lsif_dumps_with_repository_name", "Definition": " SELECT u.id,\n u.commit,\n u.root,\n u.queued_at,\n u.uploaded_at,\n u.state,\n u.failure_message,\n u.started_at,\n u.finished_at,\n u.repository_id,\n u.indexer,\n u.indexer_version,\n u.num_parts,\n u.uploaded_parts,\n u.process_after,\n u.num_resets,\n u.upload_size,\n u.num_failures,\n u.associated_index_id,\n u.expired,\n u.last_retention_scan_at,\n u.processed_at,\n r.name AS repository_name\n FROM (lsif_dumps u\n JOIN repo r ON ((r.id = u.repository_id)))\n WHERE (r.deleted_at IS NULL);" }, { "Name": "lsif_indexes_with_repository_name", "Definition": " SELECT u.id,\n u.commit,\n u.queued_at,\n u.state,\n u.failure_message,\n u.started_at,\n u.finished_at,\n u.repository_id,\n u.process_after,\n u.num_resets,\n u.num_failures,\n u.docker_steps,\n u.root,\n u.indexer,\n u.indexer_args,\n u.outfile,\n u.log_contents,\n u.execution_logs,\n u.local_steps,\n u.should_reindex,\n u.requested_envvars,\n r.name AS repository_name,\n u.enqueuer_user_id\n FROM (lsif_indexes u\n JOIN repo r ON ((r.id = u.repository_id)))\n WHERE (r.deleted_at IS NULL);" }, { "Name": "lsif_uploads_with_repository_name", "Definition": " SELECT u.id,\n u.commit,\n u.root,\n u.queued_at,\n u.uploaded_at,\n u.state,\n u.failure_message,\n u.started_at,\n u.finished_at,\n u.repository_id,\n u.indexer,\n u.indexer_version,\n u.num_parts,\n u.uploaded_parts,\n u.process_after,\n u.num_resets,\n u.upload_size,\n u.num_failures,\n u.associated_index_id,\n u.content_type,\n u.should_reindex,\n u.expired,\n u.last_retention_scan_at,\n r.name AS repository_name,\n u.uncompressed_size\n FROM (lsif_uploads u\n JOIN repo r ON ((r.id = u.repository_id)))\n WHERE (r.deleted_at IS NULL);" }, { "Name": "outbound_webhooks_with_event_types", "Definition": " SELECT outbound_webhooks.id,\n outbound_webhooks.created_by,\n outbound_webhooks.created_at,\n outbound_webhooks.updated_by,\n outbound_webhooks.updated_at,\n outbound_webhooks.encryption_key_id,\n outbound_webhooks.url,\n outbound_webhooks.secret,\n array_to_json(ARRAY( SELECT json_build_object('id', outbound_webhook_event_types.id, 'outbound_webhook_id', outbound_webhook_event_types.outbound_webhook_id, 'event_type', outbound_webhook_event_types.event_type, 'scope', outbound_webhook_event_types.scope) AS json_build_object\n FROM outbound_webhook_event_types\n WHERE (outbound_webhook_event_types.outbound_webhook_id = outbound_webhooks.id))) AS event_types\n FROM outbound_webhooks;" }, { "Name": "own_background_jobs_config_aware", "Definition": " SELECT obj.id,\n obj.state,\n obj.failure_message,\n obj.queued_at,\n obj.started_at,\n obj.finished_at,\n obj.process_after,\n obj.num_resets,\n obj.num_failures,\n obj.last_heartbeat_at,\n obj.execution_logs,\n obj.worker_hostname,\n obj.cancel,\n obj.repo_id,\n obj.job_type,\n osc.name AS config_name\n FROM (own_background_jobs obj\n JOIN own_signal_configurations osc ON ((obj.job_type = osc.id)))\n WHERE (osc.enabled IS TRUE);" }, { "Name": "reconciler_changesets", "Definition": " SELECT c.id,\n c.batch_change_ids,\n c.repo_id,\n c.queued_at,\n c.created_at,\n c.updated_at,\n c.metadata,\n c.external_id,\n c.external_service_type,\n c.external_deleted_at,\n c.external_branch,\n c.external_updated_at,\n c.external_state,\n c.external_review_state,\n c.external_check_state,\n c.commit_verification,\n c.diff_stat_added,\n c.diff_stat_deleted,\n c.sync_state,\n c.current_spec_id,\n c.previous_spec_id,\n c.publication_state,\n c.owned_by_batch_change_id,\n c.reconciler_state,\n c.computed_state,\n c.failure_message,\n c.started_at,\n c.finished_at,\n c.process_after,\n c.num_resets,\n c.closing,\n c.num_failures,\n c.log_contents,\n c.execution_logs,\n c.syncer_error,\n c.external_title,\n c.worker_hostname,\n c.ui_publication_state,\n c.last_heartbeat_at,\n c.external_fork_name,\n c.external_fork_namespace,\n c.detached_at,\n c.previous_failure_message\n FROM (changesets c\n JOIN repo r ON ((r.id = c.repo_id)))\n WHERE ((r.deleted_at IS NULL) AND (EXISTS ( SELECT 1\n FROM ((batch_changes\n LEFT JOIN users namespace_user ON ((batch_changes.namespace_user_id = namespace_user.id)))\n LEFT JOIN orgs namespace_org ON ((batch_changes.namespace_org_id = namespace_org.id)))\n WHERE ((c.batch_change_ids ? (batch_changes.id)::text) AND (namespace_user.deleted_at IS NULL) AND (namespace_org.deleted_at IS NULL)))));" }, { "Name": "site_config", "Definition": " SELECT global_state.site_id,\n global_state.initialized\n FROM global_state;" }, { "Name": "tracking_changeset_specs_and_changesets", "Definition": " SELECT changeset_specs.id AS changeset_spec_id,\n COALESCE(changesets.id, (0)::bigint) AS changeset_id,\n changeset_specs.repo_id,\n changeset_specs.batch_spec_id,\n repo.name AS repo_name,\n COALESCE((changesets.metadata -\u003e\u003e 'Title'::text), (changesets.metadata -\u003e\u003e 'title'::text)) AS changeset_name,\n changesets.external_state,\n changesets.publication_state,\n changesets.reconciler_state,\n changesets.computed_state\n FROM ((changeset_specs\n LEFT JOIN changesets ON (((changesets.repo_id = changeset_specs.repo_id) AND (changesets.external_id = changeset_specs.external_id))))\n JOIN repo ON ((changeset_specs.repo_id = repo.id)))\n WHERE ((changeset_specs.external_id IS NOT NULL) AND (repo.deleted_at IS NULL));" } ] }