mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 14:51:44 +00:00
This adds an experimental code path that I will use to test a docker-only execution mode for server-side batch changes. This code path is never executed for customers until we make the switch when we deem it ready. This will allow me to dogfood this while it's not available to customer instances yet. Ultimately, the goal of this is to make executors simply be "the job runner platform through a generic interface". Today, this depends on src-cli to do a good bunch of the work. This is a blocker for going full docker-based with executors, which will ultimately be a requirement on the road to k8s-based executors. As this removes the dependency on src-cli, nothing but the job interface and API endpoints tie executor and Sourcegraph instance together. Ultimately, this will allow us to support larger version spans between the two (pending executors going GA and being feature-complete). Known issues/limitations: Steps skipped in between steps that run don't work yet Skipping steps dynamically is inefficient as we cannot tell the executor to skip a step IF X, so we replace the script by exit 0 It is unclear if all variants of file mounts still work. Basic cases do work. Files used to be read-only in src-cli, they aren't now, but content is still reset in between steps. The assumption that everything operates in /work is broken here, because we need to use what executors give us to persist out-of-repo state in between containers (like the step result from the previous step) It is unclear if workspace mounts work Cache keys are not correctly computed if using workspace mounts - the metadataretriever is nil We still use log outputs to transfer the AfterStepResults to the Sourcegraph instance, this should finally become an artifact instead. Then, we don't have to rely on the execution_log_entires anymore and can theoretically prune those after some time. This column is currently growing indefinitely. It depends on tee being available in the docker images to capture the cmd.stdout/cmd.stderr properly for template variable rendering Env-vars are not rendered in their evaluated form post-execution File permissions are unclear and might be similarly broken to how they are now - or even worse Disclaimer: It's not feature complete today! But it is also not hitting any default code paths either. As development on this goes on, we can eventually remove the feature flag and run the new job format on all instances. This PR handles fallback of rendering old records correctly in the UI already.
20744 lines
672 KiB
JSON
Executable File
20744 lines
672 KiB
JSON
Executable File
{
|
|
"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": "lsif_index_state",
|
|
"Labels": [
|
|
"queued",
|
|
"processing",
|
|
"completed",
|
|
"errored",
|
|
"failed"
|
|
]
|
|
},
|
|
{
|
|
"Name": "lsif_upload_state",
|
|
"Labels": [
|
|
"uploading",
|
|
"queued",
|
|
"processing",
|
|
"completed",
|
|
"errored",
|
|
"deleted",
|
|
"failed"
|
|
]
|
|
},
|
|
{
|
|
"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": "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 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 '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 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 'modify', diff\n );\n END IF;\n\n RETURN NEW;\n END;\n$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 --------------------\n -- THIS IS UNCHANGED\n --------------------\n INSERT INTO gitserver_repos_statistics AS grs (shard_id, total, not_cloned, cloning, cloned, failed_fetch)\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 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 ;\n\n --------------------\n -- THIS IS UNCHANGED\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 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 FROM moved\n WHERE moved.shard_id = grs.shard_id;\n\n -------------------------------------------------\n -- IMPORTANT: THIS IS CHANGED\n -------------------------------------------------\n WITH diff(not_cloned, cloning, cloned, failed_fetch) 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 )\n INSERT INTO repo_statistics (not_cloned, cloning, cloned, failed_fetch)\n SELECT not_cloned, cloning, cloned, failed_fetch\n FROM diff\n WHERE\n not_cloned != 0\n OR cloning != 0\n OR cloned != 0\n OR failed_fetch != 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) 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 )\n INSERT INTO\n repo_statistics (total, soft_deleted, not_cloned, cloning, cloned, failed_fetch)\n SELECT total, soft_deleted, not_cloned, cloning, cloned, failed_fetch\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 ;\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\n STRICT\nAS $function$\nBEGIN\n RETURN 'DELETED-' || extract(epoch from transaction_timestamp()) || '-' || name;\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": "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_tokens_id_seq",
|
|
"TypeName": "bigint",
|
|
"StartValue": 1,
|
|
"MinimumValue": 1,
|
|
"MaximumValue": 9223372036854775807,
|
|
"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": "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": "codeintel_autoindex_queue_id_seq",
|
|
"TypeName": "integer",
|
|
"StartValue": 1,
|
|
"MinimumValue": 1,
|
|
"MaximumValue": 2147483647,
|
|
"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_lockfile_references_id_seq",
|
|
"TypeName": "integer",
|
|
"StartValue": 1,
|
|
"MinimumValue": 1,
|
|
"MaximumValue": 2147483647,
|
|
"Increment": 1,
|
|
"CycleOption": "NO"
|
|
},
|
|
{
|
|
"Name": "codeintel_lockfiles_id_seq",
|
|
"TypeName": "integer",
|
|
"StartValue": 1,
|
|
"MinimumValue": 1,
|
|
"MaximumValue": 2147483647,
|
|
"Increment": 1,
|
|
"CycleOption": "NO"
|
|
},
|
|
{
|
|
"Name": "codeintel_path_rank_inputs_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": "configuration_policies_audit_logs_seq",
|
|
"TypeName": "bigint",
|
|
"StartValue": 1,
|
|
"MinimumValue": 1,
|
|
"MaximumValue": 9223372036854775807,
|
|
"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": "executor_heartbeats_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": "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": "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": "migration_logs_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": "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_id_seq",
|
|
"TypeName": "bigint",
|
|
"StartValue": 1,
|
|
"MinimumValue": 1,
|
|
"MaximumValue": 9223372036854775807,
|
|
"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": "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_pending_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": "webhook_build_jobs_id_seq",
|
|
"TypeName": "bigint",
|
|
"StartValue": 1,
|
|
"MinimumValue": 1,
|
|
"MaximumValue": 9223372036854775807,
|
|
"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_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": "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_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 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_rand_id",
|
|
"IsPrimaryKey": false,
|
|
"IsUnique": false,
|
|
"IsExclusion": false,
|
|
"IsDeferrable": false,
|
|
"IndexDefinition": "CREATE INDEX batch_specs_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": "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_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_rand_id",
|
|
"IsPrimaryKey": false,
|
|
"IsUnique": false,
|
|
"IsExclusion": false,
|
|
"IsDeferrable": false,
|
|
"IndexDefinition": "CREATE INDEX changeset_specs_rand_id ON changeset_specs USING btree (rand_id)",
|
|
"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": "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_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_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": ""
|
|
}
|
|
],
|
|
"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": "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_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_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_lockfile_references",
|
|
"Comment": "Tracks a lockfile dependency that might be resolvable to a specific repository-commit pair.",
|
|
"Columns": [
|
|
{
|
|
"Name": "commit_bytea",
|
|
"Index": 8,
|
|
"TypeName": "bytea",
|
|
"IsNullable": true,
|
|
"Default": "",
|
|
"CharacterMaximumLength": 0,
|
|
"IsIdentity": false,
|
|
"IdentityGeneration": "",
|
|
"IsGenerated": "NEVER",
|
|
"GenerationExpression": "",
|
|
"Comment": "The resolved 40-char revhash of the associated revspec, if it is resolvable on this instance."
|
|
},
|
|
{
|
|
"Name": "depends_on",
|
|
"Index": 10,
|
|
"TypeName": "integer[]",
|
|
"IsNullable": true,
|
|
"Default": "'{}'::integer[]",
|
|
"CharacterMaximumLength": 0,
|
|
"IsIdentity": false,
|
|
"IdentityGeneration": "",
|
|
"IsGenerated": "NEVER",
|
|
"GenerationExpression": "",
|
|
"Comment": "IDs of other `codeintel_lockfile_references` this package depends on in the context of this `codeintel_lockfile_references.resolution_id`."
|
|
},
|
|
{
|
|
"Name": "id",
|
|
"Index": 1,
|
|
"TypeName": "integer",
|
|
"IsNullable": false,
|
|
"Default": "nextval('codeintel_lockfile_references_id_seq'::regclass)",
|
|
"CharacterMaximumLength": 0,
|
|
"IsIdentity": false,
|
|
"IdentityGeneration": "",
|
|
"IsGenerated": "NEVER",
|
|
"GenerationExpression": "",
|
|
"Comment": ""
|
|
},
|
|
{
|
|
"Name": "last_check_at",
|
|
"Index": 9,
|
|
"TypeName": "timestamp with time zone",
|
|
"IsNullable": true,
|
|
"Default": "",
|
|
"CharacterMaximumLength": 0,
|
|
"IsIdentity": false,
|
|
"IdentityGeneration": "",
|
|
"IsGenerated": "NEVER",
|
|
"GenerationExpression": "",
|
|
"Comment": "Timestamp when background job last checked this row for repository resolution"
|
|
},
|
|
{
|
|
"Name": "package_name",
|
|
"Index": 5,
|
|
"TypeName": "text",
|
|
"IsNullable": false,
|
|
"Default": "",
|
|
"CharacterMaximumLength": 0,
|
|
"IsIdentity": false,
|
|
"IdentityGeneration": "",
|
|
"IsGenerated": "NEVER",
|
|
"GenerationExpression": "",
|
|
"Comment": "Encodes `reposource.PackageDependency.PackageSyntax`. The name of the dependency as used by the package manager, excluding version information."
|
|
},
|
|
{
|
|
"Name": "package_scheme",
|
|
"Index": 4,
|
|
"TypeName": "text",
|
|
"IsNullable": false,
|
|
"Default": "",
|
|
"CharacterMaximumLength": 0,
|
|
"IsIdentity": false,
|
|
"IdentityGeneration": "",
|
|
"IsGenerated": "NEVER",
|
|
"GenerationExpression": "",
|
|
"Comment": "Encodes `reposource.PackageDependency.Scheme`. The scheme of the dependency (e.g., semanticdb, npm)."
|
|
},
|
|
{
|
|
"Name": "package_version",
|
|
"Index": 6,
|
|
"TypeName": "text",
|
|
"IsNullable": false,
|
|
"Default": "",
|
|
"CharacterMaximumLength": 0,
|
|
"IsIdentity": false,
|
|
"IdentityGeneration": "",
|
|
"IsGenerated": "NEVER",
|
|
"GenerationExpression": "",
|
|
"Comment": "Encodes `reposource.PackageDependency.PackageVersion`. The version of the package."
|
|
},
|
|
{
|
|
"Name": "repository_id",
|
|
"Index": 7,
|
|
"TypeName": "integer",
|
|
"IsNullable": true,
|
|
"Default": "",
|
|
"CharacterMaximumLength": 0,
|
|
"IsIdentity": false,
|
|
"IdentityGeneration": "",
|
|
"IsGenerated": "NEVER",
|
|
"GenerationExpression": "",
|
|
"Comment": "The identifier of the repo that resolves the associated name, if it is resolvable on this instance."
|
|
},
|
|
{
|
|
"Name": "repository_name",
|
|
"Index": 2,
|
|
"TypeName": "text",
|
|
"IsNullable": false,
|
|
"Default": "",
|
|
"CharacterMaximumLength": 0,
|
|
"IsIdentity": false,
|
|
"IdentityGeneration": "",
|
|
"IsGenerated": "NEVER",
|
|
"GenerationExpression": "",
|
|
"Comment": "Encodes `reposource.PackageDependency.RepoName`. A name that is \"globally unique\" for a Sourcegraph instance. Used in `repo:...` queries."
|
|
},
|
|
{
|
|
"Name": "resolution_commit_bytea",
|
|
"Index": 13,
|
|
"TypeName": "bytea",
|
|
"IsNullable": true,
|
|
"Default": "",
|
|
"CharacterMaximumLength": 0,
|
|
"IsIdentity": false,
|
|
"IdentityGeneration": "",
|
|
"IsGenerated": "NEVER",
|
|
"GenerationExpression": "",
|
|
"Comment": "Commit at which lockfile was resolved. Corresponds to `codeintel_lockfiles.commit_bytea`."
|
|
},
|
|
{
|
|
"Name": "resolution_lockfile",
|
|
"Index": 11,
|
|
"TypeName": "text",
|
|
"IsNullable": true,
|
|
"Default": "",
|
|
"CharacterMaximumLength": 0,
|
|
"IsIdentity": false,
|
|
"IdentityGeneration": "",
|
|
"IsGenerated": "NEVER",
|
|
"GenerationExpression": "",
|
|
"Comment": "Relative path of lockfile in which this package was referenced. Corresponds to `codeintel_lockfiles.lockfile`."
|
|
},
|
|
{
|
|
"Name": "resolution_repository_id",
|
|
"Index": 12,
|
|
"TypeName": "integer",
|
|
"IsNullable": true,
|
|
"Default": "",
|
|
"CharacterMaximumLength": 0,
|
|
"IsIdentity": false,
|
|
"IdentityGeneration": "",
|
|
"IsGenerated": "NEVER",
|
|
"GenerationExpression": "",
|
|
"Comment": "ID of the repository in which lockfile was resolved. Corresponds to `codeintel_lockfiles.repository_id`."
|
|
},
|
|
{
|
|
"Name": "revspec",
|
|
"Index": 3,
|
|
"TypeName": "text",
|
|
"IsNullable": false,
|
|
"Default": "",
|
|
"CharacterMaximumLength": 0,
|
|
"IsIdentity": false,
|
|
"IdentityGeneration": "",
|
|
"IsGenerated": "NEVER",
|
|
"GenerationExpression": "",
|
|
"Comment": "Encodes `reposource.PackageDependency.GitTagFromVersion`. Returns the git tag associated with the given dependency version, used in `rev:` or `repo:foo@rev` queries."
|
|
}
|
|
],
|
|
"Indexes": [
|
|
{
|
|
"Name": "codeintel_lockfile_references_pkey",
|
|
"IsPrimaryKey": true,
|
|
"IsUnique": true,
|
|
"IsExclusion": false,
|
|
"IsDeferrable": false,
|
|
"IndexDefinition": "CREATE UNIQUE INDEX codeintel_lockfile_references_pkey ON codeintel_lockfile_references USING btree (id)",
|
|
"ConstraintType": "p",
|
|
"ConstraintDefinition": "PRIMARY KEY (id)"
|
|
},
|
|
{
|
|
"Name": "codeintel_lockfile_references_repository_name_revspec_package_r",
|
|
"IsPrimaryKey": false,
|
|
"IsUnique": true,
|
|
"IsExclusion": false,
|
|
"IsDeferrable": false,
|
|
"IndexDefinition": "CREATE UNIQUE INDEX codeintel_lockfile_references_repository_name_revspec_package_r ON codeintel_lockfile_references USING btree (repository_name, revspec, package_scheme, package_name, package_version, resolution_lockfile, resolution_repository_id, resolution_commit_bytea)",
|
|
"ConstraintType": "",
|
|
"ConstraintDefinition": ""
|
|
},
|
|
{
|
|
"Name": "codeintel_lockfile_references_last_check_at",
|
|
"IsPrimaryKey": false,
|
|
"IsUnique": false,
|
|
"IsExclusion": false,
|
|
"IsDeferrable": false,
|
|
"IndexDefinition": "CREATE INDEX codeintel_lockfile_references_last_check_at ON codeintel_lockfile_references USING btree (last_check_at)",
|
|
"ConstraintType": "",
|
|
"ConstraintDefinition": ""
|
|
},
|
|
{
|
|
"Name": "codeintel_lockfile_references_repository_id_commit_bytea",
|
|
"IsPrimaryKey": false,
|
|
"IsUnique": false,
|
|
"IsExclusion": false,
|
|
"IsDeferrable": false,
|
|
"IndexDefinition": "CREATE INDEX codeintel_lockfile_references_repository_id_commit_bytea ON codeintel_lockfile_references USING btree (repository_id, commit_bytea) WHERE repository_id IS NOT NULL AND commit_bytea IS NOT NULL",
|
|
"ConstraintType": "",
|
|
"ConstraintDefinition": ""
|
|
},
|
|
{
|
|
"Name": "codeintel_lockfiles_references_depends_on",
|
|
"IsPrimaryKey": false,
|
|
"IsUnique": false,
|
|
"IsExclusion": false,
|
|
"IsDeferrable": false,
|
|
"IndexDefinition": "CREATE INDEX codeintel_lockfiles_references_depends_on ON codeintel_lockfile_references USING gin (depends_on gin__int_ops)",
|
|
"ConstraintType": "",
|
|
"ConstraintDefinition": ""
|
|
}
|
|
],
|
|
"Constraints": null,
|
|
"Triggers": []
|
|
},
|
|
{
|
|
"Name": "codeintel_lockfiles",
|
|
"Comment": "Associates a repository-commit pair with the set of repository-level dependencies parsed from lockfiles.",
|
|
"Columns": [
|
|
{
|
|
"Name": "codeintel_lockfile_reference_ids",
|
|
"Index": 4,
|
|
"TypeName": "integer[]",
|
|
"IsNullable": false,
|
|
"Default": "",
|
|
"CharacterMaximumLength": 0,
|
|
"IsIdentity": false,
|
|
"IdentityGeneration": "",
|
|
"IsGenerated": "NEVER",
|
|
"GenerationExpression": "",
|
|
"Comment": "A key to a resolved repository name-revspec pair. Not all repository names and revspecs are resolvable."
|
|
},
|
|
{
|
|
"Name": "commit_bytea",
|
|
"Index": 3,
|
|
"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": "created_at",
|
|
"Index": 7,
|
|
"TypeName": "timestamp with time zone",
|
|
"IsNullable": false,
|
|
"Default": "now()",
|
|
"CharacterMaximumLength": 0,
|
|
"IsIdentity": false,
|
|
"IdentityGeneration": "",
|
|
"IsGenerated": "NEVER",
|
|
"GenerationExpression": "",
|
|
"Comment": "Time when lockfile was indexed"
|
|
},
|
|
{
|
|
"Name": "fidelity",
|
|
"Index": 6,
|
|
"TypeName": "text",
|
|
"IsNullable": false,
|
|
"Default": "'flat'::text",
|
|
"CharacterMaximumLength": 0,
|
|
"IsIdentity": false,
|
|
"IdentityGeneration": "",
|
|
"IsGenerated": "NEVER",
|
|
"GenerationExpression": "",
|
|
"Comment": "Fidelity of the dependency graph thats persisted, whether it is a flat list, a whole graph, circular graph, ..."
|
|
},
|
|
{
|
|
"Name": "id",
|
|
"Index": 1,
|
|
"TypeName": "integer",
|
|
"IsNullable": false,
|
|
"Default": "nextval('codeintel_lockfiles_id_seq'::regclass)",
|
|
"CharacterMaximumLength": 0,
|
|
"IsIdentity": false,
|
|
"IdentityGeneration": "",
|
|
"IsGenerated": "NEVER",
|
|
"GenerationExpression": "",
|
|
"Comment": ""
|
|
},
|
|
{
|
|
"Name": "lockfile",
|
|
"Index": 5,
|
|
"TypeName": "text",
|
|
"IsNullable": true,
|
|
"Default": "",
|
|
"CharacterMaximumLength": 0,
|
|
"IsIdentity": false,
|
|
"IdentityGeneration": "",
|
|
"IsGenerated": "NEVER",
|
|
"GenerationExpression": "",
|
|
"Comment": "Relative path of a lockfile in the given repository and the given commit."
|
|
},
|
|
{
|
|
"Name": "repository_id",
|
|
"Index": 2,
|
|
"TypeName": "integer",
|
|
"IsNullable": false,
|
|
"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": "Time when lockfile index was updated"
|
|
}
|
|
],
|
|
"Indexes": [
|
|
{
|
|
"Name": "codeintel_lockfiles_pkey",
|
|
"IsPrimaryKey": true,
|
|
"IsUnique": true,
|
|
"IsExclusion": false,
|
|
"IsDeferrable": false,
|
|
"IndexDefinition": "CREATE UNIQUE INDEX codeintel_lockfiles_pkey ON codeintel_lockfiles USING btree (id)",
|
|
"ConstraintType": "p",
|
|
"ConstraintDefinition": "PRIMARY KEY (id)"
|
|
},
|
|
{
|
|
"Name": "codeintel_lockfiles_repository_id_commit_bytea_lockfile",
|
|
"IsPrimaryKey": false,
|
|
"IsUnique": true,
|
|
"IsExclusion": false,
|
|
"IsDeferrable": false,
|
|
"IndexDefinition": "CREATE UNIQUE INDEX codeintel_lockfiles_repository_id_commit_bytea_lockfile ON codeintel_lockfiles USING btree (repository_id, commit_bytea, lockfile)",
|
|
"ConstraintType": "",
|
|
"ConstraintDefinition": ""
|
|
},
|
|
{
|
|
"Name": "codeintel_lockfiles_codeintel_lockfile_reference_ids",
|
|
"IsPrimaryKey": false,
|
|
"IsUnique": false,
|
|
"IsExclusion": false,
|
|
"IsDeferrable": false,
|
|
"IndexDefinition": "CREATE INDEX codeintel_lockfiles_codeintel_lockfile_reference_ids ON codeintel_lockfiles USING gin (codeintel_lockfile_reference_ids gin__int_ops)",
|
|
"ConstraintType": "",
|
|
"ConstraintDefinition": ""
|
|
}
|
|
],
|
|
"Constraints": null,
|
|
"Triggers": []
|
|
},
|
|
{
|
|
"Name": "codeintel_path_rank_inputs",
|
|
"Comment": "Sharded inputs from Spark jobs that will subsequently be written into `codeintel_path_ranks`.",
|
|
"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_path_rank_inputs_id_seq'::regclass)",
|
|
"CharacterMaximumLength": 0,
|
|
"IsIdentity": false,
|
|
"IdentityGeneration": "",
|
|
"IsGenerated": "NEVER",
|
|
"GenerationExpression": "",
|
|
"Comment": ""
|
|
},
|
|
{
|
|
"Name": "input_filename",
|
|
"Index": 3,
|
|
"TypeName": "text",
|
|
"IsNullable": false,
|
|
"Default": "",
|
|
"CharacterMaximumLength": 0,
|
|
"IsIdentity": false,
|
|
"IdentityGeneration": "",
|
|
"IsGenerated": "NEVER",
|
|
"GenerationExpression": "",
|
|
"Comment": ""
|
|
},
|
|
{
|
|
"Name": "payload",
|
|
"Index": 5,
|
|
"TypeName": "jsonb",
|
|
"IsNullable": false,
|
|
"Default": "",
|
|
"CharacterMaximumLength": 0,
|
|
"IsIdentity": false,
|
|
"IdentityGeneration": "",
|
|
"IsGenerated": "NEVER",
|
|
"GenerationExpression": "",
|
|
"Comment": ""
|
|
},
|
|
{
|
|
"Name": "precision",
|
|
"Index": 7,
|
|
"TypeName": "double precision",
|
|
"IsNullable": false,
|
|
"Default": "",
|
|
"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": ""
|
|
},
|
|
{
|
|
"Name": "repository_name",
|
|
"Index": 4,
|
|
"TypeName": "text",
|
|
"IsNullable": false,
|
|
"Default": "",
|
|
"CharacterMaximumLength": 0,
|
|
"IsIdentity": false,
|
|
"IdentityGeneration": "",
|
|
"IsGenerated": "NEVER",
|
|
"GenerationExpression": "",
|
|
"Comment": ""
|
|
}
|
|
],
|
|
"Indexes": [
|
|
{
|
|
"Name": "codeintel_path_rank_inputs_graph_key_input_filename_reposit_key",
|
|
"IsPrimaryKey": false,
|
|
"IsUnique": true,
|
|
"IsExclusion": false,
|
|
"IsDeferrable": false,
|
|
"IndexDefinition": "CREATE UNIQUE INDEX codeintel_path_rank_inputs_graph_key_input_filename_reposit_key ON codeintel_path_rank_inputs USING btree (graph_key, input_filename, repository_name)",
|
|
"ConstraintType": "u",
|
|
"ConstraintDefinition": "UNIQUE (graph_key, input_filename, repository_name)"
|
|
},
|
|
{
|
|
"Name": "codeintel_path_rank_inputs_pkey",
|
|
"IsPrimaryKey": true,
|
|
"IsUnique": true,
|
|
"IsExclusion": false,
|
|
"IsDeferrable": false,
|
|
"IndexDefinition": "CREATE UNIQUE INDEX codeintel_path_rank_inputs_pkey ON codeintel_path_rank_inputs USING btree (id)",
|
|
"ConstraintType": "p",
|
|
"ConstraintDefinition": "PRIMARY KEY (id)"
|
|
},
|
|
{
|
|
"Name": "codeintel_path_rank_inputs_graph_key_repository_name_id_process",
|
|
"IsPrimaryKey": false,
|
|
"IsUnique": false,
|
|
"IsExclusion": false,
|
|
"IsDeferrable": false,
|
|
"IndexDefinition": "CREATE INDEX codeintel_path_rank_inputs_graph_key_repository_name_id_process ON codeintel_path_rank_inputs USING btree (graph_key, repository_name, id) WHERE NOT processed",
|
|
"ConstraintType": "",
|
|
"ConstraintDefinition": ""
|
|
}
|
|
],
|
|
"Constraints": null,
|
|
"Triggers": []
|
|
},
|
|
{
|
|
"Name": "codeintel_path_ranks",
|
|
"Comment": "",
|
|
"Columns": [
|
|
{
|
|
"Name": "graph_key",
|
|
"Index": 5,
|
|
"TypeName": "text",
|
|
"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": "precision",
|
|
"Index": 3,
|
|
"TypeName": "double precision",
|
|
"IsNullable": false,
|
|
"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_repository_id_precision",
|
|
"IsPrimaryKey": false,
|
|
"IsUnique": true,
|
|
"IsExclusion": false,
|
|
"IsDeferrable": false,
|
|
"IndexDefinition": "CREATE UNIQUE INDEX codeintel_path_ranks_repository_id_precision ON codeintel_path_ranks USING btree (repository_id, \"precision\")",
|
|
"ConstraintType": "",
|
|
"ConstraintDefinition": ""
|
|
},
|
|
{
|
|
"Name": "codeintel_path_ranks_updated_at",
|
|
"IsPrimaryKey": false,
|
|
"IsUnique": false,
|
|
"IsExclusion": false,
|
|
"IsDeferrable": false,
|
|
"IndexDefinition": "CREATE INDEX codeintel_path_ranks_updated_at ON codeintel_path_ranks USING btree (updated_at) INCLUDE (repository_id)",
|
|
"ConstraintType": "",
|
|
"ConstraintDefinition": ""
|
|
}
|
|
],
|
|
"Constraints": null,
|
|
"Triggers": [
|
|
{
|
|
"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_exports",
|
|
"Comment": "",
|
|
"Columns": [
|
|
{
|
|
"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": "locked_at",
|
|
"Index": 3,
|
|
"TypeName": "timestamp with time zone",
|
|
"IsNullable": false,
|
|
"Default": "now()",
|
|
"CharacterMaximumLength": 0,
|
|
"IsIdentity": false,
|
|
"IdentityGeneration": "",
|
|
"IsGenerated": "NEVER",
|
|
"GenerationExpression": "",
|
|
"Comment": ""
|
|
},
|
|
{
|
|
"Name": "object_prefix",
|
|
"Index": 5,
|
|
"TypeName": "text",
|
|
"IsNullable": true,
|
|
"Default": "",
|
|
"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": ""
|
|
}
|
|
],
|
|
"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)"
|
|
}
|
|
],
|
|
"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": "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": "critical_and_site_config",
|
|
"Comment": "",
|
|
"Columns": [
|
|
{
|
|
"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": "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": "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",
|
|
"IsPrimaryKey": false,
|
|
"IsUnique": false,
|
|
"IsExclusion": false,
|
|
"IsDeferrable": false,
|
|
"IndexDefinition": "CREATE INDEX event_logs_name ON event_logs USING btree (name)",
|
|
"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",
|
|
"IsPrimaryKey": false,
|
|
"IsUnique": false,
|
|
"IsExclusion": false,
|
|
"IsDeferrable": false,
|
|
"IndexDefinition": "CREATE INDEX event_logs_user_id ON event_logs USING btree (user_id)",
|
|
"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": "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": false,
|
|
"Default": "",
|
|
"CharacterMaximumLength": 0,
|
|
"IsIdentity": false,
|
|
"IdentityGeneration": "",
|
|
"IsGenerated": "NEVER",
|
|
"GenerationExpression": "",
|
|
"Comment": "The queue name 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": 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": "user_id",
|
|
"Index": 3,
|
|
"TypeName": "integer",
|
|
"IsNullable": false,
|
|
"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"
|
|
}
|
|
],
|
|
"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": "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": "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_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": "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": "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": "repo_status",
|
|
"Index": 9,
|
|
"TypeName": "text",
|
|
"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_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_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": "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": "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 [enterprise/internal/insights/background/queryrunner/worker.go:Job](https://sourcegraph.com/search?q=repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+file:enterprise/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": "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": "last_lockfile_scan",
|
|
"Comment": "Tracks the last time repository was checked for lockfile indexing.",
|
|
"Columns": [
|
|
{
|
|
"Name": "last_lockfile_scan_at",
|
|
"Index": 2,
|
|
"TypeName": "timestamp with time zone",
|
|
"IsNullable": false,
|
|
"Default": "",
|
|
"CharacterMaximumLength": 0,
|
|
"IsIdentity": false,
|
|
"IdentityGeneration": "",
|
|
"IsGenerated": "NEVER",
|
|
"GenerationExpression": "",
|
|
"Comment": "The last time this repository was considered for lockfile indexing."
|
|
},
|
|
{
|
|
"Name": "repository_id",
|
|
"Index": 1,
|
|
"TypeName": "integer",
|
|
"IsNullable": false,
|
|
"Default": "",
|
|
"CharacterMaximumLength": 0,
|
|
"IsIdentity": false,
|
|
"IdentityGeneration": "",
|
|
"IsGenerated": "NEVER",
|
|
"GenerationExpression": "",
|
|
"Comment": ""
|
|
}
|
|
],
|
|
"Indexes": [
|
|
{
|
|
"Name": "last_lockfile_scan_pkey",
|
|
"IsPrimaryKey": true,
|
|
"IsUnique": true,
|
|
"IsExclusion": false,
|
|
"IsDeferrable": false,
|
|
"IndexDefinition": "CREATE UNIQUE INDEX last_lockfile_scan_pkey ON last_lockfile_scan USING btree (repository_id)",
|
|
"ConstraintType": "p",
|
|
"ConstraintDefinition": "PRIMARY KEY (repository_id)"
|
|
}
|
|
],
|
|
"Constraints": null,
|
|
"Triggers": []
|
|
},
|
|
{
|
|
"Name": "lsif_configuration_policies",
|
|
"Comment": "",
|
|
"Columns": [
|
|
{
|
|
"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": "lockfile_indexing_enabled",
|
|
"Index": 15,
|
|
"TypeName": "boolean",
|
|
"IsNullable": false,
|
|
"Default": "false",
|
|
"CharacterMaximumLength": 0,
|
|
"IsIdentity": false,
|
|
"IdentityGeneration": "",
|
|
"IsGenerated": "NEVER",
|
|
"GenerationExpression": "",
|
|
"Comment": "Whether to index the lockfiles in the repositories matched by this policy"
|
|
},
|
|
{
|
|
"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": "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": "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": ""
|
|
},
|
|
{
|
|
"Name": "version",
|
|
"Index": 3,
|
|
"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_triplet",
|
|
"IsPrimaryKey": false,
|
|
"IsUnique": true,
|
|
"IsExclusion": false,
|
|
"IsDeferrable": false,
|
|
"IndexDefinition": "CREATE UNIQUE INDEX lsif_dependency_repos_unique_triplet ON lsif_dependency_repos USING btree (scheme, name, version)",
|
|
"ConstraintType": "u",
|
|
"ConstraintDefinition": "UNIQUE (scheme, name, version)"
|
|
}
|
|
],
|
|
"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": "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": "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_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": "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": "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": "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": "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",
|
|
"IsPrimaryKey": false,
|
|
"IsUnique": false,
|
|
"IsExclusion": false,
|
|
"IsDeferrable": false,
|
|
"IndexDefinition": "CREATE INDEX lsif_uploads_uploaded_at ON lsif_uploads USING btree (uploaded_at)",
|
|
"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": "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": "integer",
|
|
"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": "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": "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)"
|
|
},
|
|
{
|
|
"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_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": "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": "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": "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_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": ""
|
|
}
|
|
],
|
|
"Indexes": [
|
|
{
|
|
"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": "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": "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": "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_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_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_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": "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": "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_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_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": "path_excludes",
|
|
"Index": 5,
|
|
"TypeName": "text[]",
|
|
"IsNullable": true,
|
|
"Default": "",
|
|
"CharacterMaximumLength": 0,
|
|
"IsIdentity": false,
|
|
"IdentityGeneration": "",
|
|
"IsGenerated": "NEVER",
|
|
"GenerationExpression": "",
|
|
"Comment": ""
|
|
},
|
|
{
|
|
"Name": "path_includes",
|
|
"Index": 4,
|
|
"TypeName": "text[]",
|
|
"IsNullable": true,
|
|
"Default": "",
|
|
"CharacterMaximumLength": 0,
|
|
"IsIdentity": false,
|
|
"IdentityGeneration": "",
|
|
"IsGenerated": "NEVER",
|
|
"GenerationExpression": "",
|
|
"Comment": ""
|
|
},
|
|
{
|
|
"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": "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",
|
|
"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": "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": "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": "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": "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_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": "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": "webhook_build_jobs",
|
|
"Comment": "",
|
|
"Columns": [
|
|
{
|
|
"Name": "execution_logs",
|
|
"Index": 13,
|
|
"TypeName": "json[]",
|
|
"IsNullable": true,
|
|
"Default": "",
|
|
"CharacterMaximumLength": 0,
|
|
"IsIdentity": false,
|
|
"IdentityGeneration": "",
|
|
"IsGenerated": "NEVER",
|
|
"GenerationExpression": "",
|
|
"Comment": ""
|
|
},
|
|
{
|
|
"Name": "extsvc_id",
|
|
"Index": 17,
|
|
"TypeName": "integer",
|
|
"IsNullable": true,
|
|
"Default": "",
|
|
"CharacterMaximumLength": 0,
|
|
"IsIdentity": false,
|
|
"IdentityGeneration": "",
|
|
"IsGenerated": "NEVER",
|
|
"GenerationExpression": "",
|
|
"Comment": ""
|
|
},
|
|
{
|
|
"Name": "extsvc_kind",
|
|
"Index": 3,
|
|
"TypeName": "text",
|
|
"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": 9,
|
|
"TypeName": "timestamp with time zone",
|
|
"IsNullable": true,
|
|
"Default": "",
|
|
"CharacterMaximumLength": 0,
|
|
"IsIdentity": false,
|
|
"IdentityGeneration": "",
|
|
"IsGenerated": "NEVER",
|
|
"GenerationExpression": "",
|
|
"Comment": ""
|
|
},
|
|
{
|
|
"Name": "id",
|
|
"Index": 5,
|
|
"TypeName": "integer",
|
|
"IsNullable": false,
|
|
"Default": "nextval('webhook_build_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": 12,
|
|
"TypeName": "integer",
|
|
"IsNullable": false,
|
|
"Default": "0",
|
|
"CharacterMaximumLength": 0,
|
|
"IsIdentity": false,
|
|
"IdentityGeneration": "",
|
|
"IsGenerated": "NEVER",
|
|
"GenerationExpression": "",
|
|
"Comment": ""
|
|
},
|
|
{
|
|
"Name": "num_resets",
|
|
"Index": 11,
|
|
"TypeName": "integer",
|
|
"IsNullable": false,
|
|
"Default": "0",
|
|
"CharacterMaximumLength": 0,
|
|
"IsIdentity": false,
|
|
"IdentityGeneration": "",
|
|
"IsGenerated": "NEVER",
|
|
"GenerationExpression": "",
|
|
"Comment": ""
|
|
},
|
|
{
|
|
"Name": "org",
|
|
"Index": 16,
|
|
"TypeName": "text",
|
|
"IsNullable": true,
|
|
"Default": "",
|
|
"CharacterMaximumLength": 0,
|
|
"IsIdentity": false,
|
|
"IdentityGeneration": "",
|
|
"IsGenerated": "NEVER",
|
|
"GenerationExpression": "",
|
|
"Comment": ""
|
|
},
|
|
{
|
|
"Name": "process_after",
|
|
"Index": 10,
|
|
"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": 1,
|
|
"TypeName": "integer",
|
|
"IsNullable": true,
|
|
"Default": "",
|
|
"CharacterMaximumLength": 0,
|
|
"IsIdentity": false,
|
|
"IdentityGeneration": "",
|
|
"IsGenerated": "NEVER",
|
|
"GenerationExpression": "",
|
|
"Comment": ""
|
|
},
|
|
{
|
|
"Name": "repo_name",
|
|
"Index": 2,
|
|
"TypeName": "text",
|
|
"IsNullable": true,
|
|
"Default": "",
|
|
"CharacterMaximumLength": 0,
|
|
"IsIdentity": false,
|
|
"IdentityGeneration": "",
|
|
"IsGenerated": "NEVER",
|
|
"GenerationExpression": "",
|
|
"Comment": ""
|
|
},
|
|
{
|
|
"Name": "started_at",
|
|
"Index": 8,
|
|
"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": 15,
|
|
"TypeName": "text",
|
|
"IsNullable": false,
|
|
"Default": "''::text",
|
|
"CharacterMaximumLength": 0,
|
|
"IsIdentity": false,
|
|
"IdentityGeneration": "",
|
|
"IsGenerated": "NEVER",
|
|
"GenerationExpression": "",
|
|
"Comment": ""
|
|
}
|
|
],
|
|
"Indexes": [
|
|
{
|
|
"Name": "webhook_build_jobs_queued_at_idx",
|
|
"IsPrimaryKey": false,
|
|
"IsUnique": false,
|
|
"IsExclusion": false,
|
|
"IsDeferrable": false,
|
|
"IndexDefinition": "CREATE INDEX webhook_build_jobs_queued_at_idx ON webhook_build_jobs USING btree (queued_at)",
|
|
"ConstraintType": "",
|
|
"ConstraintDefinition": ""
|
|
},
|
|
{
|
|
"Name": "webhook_build_jobs_state",
|
|
"IsPrimaryKey": false,
|
|
"IsUnique": false,
|
|
"IsExclusion": false,
|
|
"IsDeferrable": false,
|
|
"IndexDefinition": "CREATE INDEX webhook_build_jobs_state ON webhook_build_jobs USING btree (state)",
|
|
"ConstraintType": "",
|
|
"ConstraintDefinition": ""
|
|
}
|
|
],
|
|
"Constraints": null,
|
|
"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": "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": "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": "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 r.name AS repository_name\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.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": "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.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_namespace,\n c.detached_at\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));"
|
|
}
|
|
]
|
|
} |