From 785a2ca2436b305c0a59d597a261c137baf83395 Mon Sep 17 00:00:00 2001 From: Joe Chen Date: Mon, 2 Oct 2023 15:37:31 -0400 Subject: [PATCH] release-branch: v5.2.0 bake constants and static content (#57264) --- .../list/BatchChangesChangelogAlert.tsx | 2 +- cmd/migrator/BUILD.bazel | 3 + cmd/migrator/generate.sh | 2 +- .../shared/data/cmd/generator/consts.go | 4 +- .../shared/data/stitched-migration-graph.json | 284 ++++++++++++++++++ internal/database/migration/stitch/reader.go | 1 + internal/src-cli/consts.go | 2 +- 7 files changed, 293 insertions(+), 5 deletions(-) diff --git a/client/web/src/enterprise/batches/list/BatchChangesChangelogAlert.tsx b/client/web/src/enterprise/batches/list/BatchChangesChangelogAlert.tsx index 5f60a68a145a5..93d4e5893218c 100644 --- a/client/web/src/enterprise/batches/list/BatchChangesChangelogAlert.tsx +++ b/client/web/src/enterprise/batches/list/BatchChangesChangelogAlert.tsx @@ -13,7 +13,7 @@ import styles from './BatchChangesListIntro.module.scss' * Ie. After 5.0 is cut, this should be bumped to 5.1, and so on. This ensures we * always render the right changelog. */ -const CURRENT_VERSION = '5.1' +const CURRENT_VERSION = '5.2' /** * SHOW_CHANGELOG has to be set to true when a changelog entry is added for a release. * After every release, this will be set back to `false`. Chromatic will also verify diff --git a/cmd/migrator/BUILD.bazel b/cmd/migrator/BUILD.bazel index 545a956356919..9fc1674f9eb7c 100644 --- a/cmd/migrator/BUILD.bazel +++ b/cmd/migrator/BUILD.bazel @@ -301,6 +301,9 @@ genrule( "schema-descriptions/v5.1.8-internal_database_schema.codeinsights.json", "schema-descriptions/v5.1.8-internal_database_schema.codeintel.json", "schema-descriptions/v5.1.8-internal_database_schema.json", + "schema-descriptions/v5.1.9-internal_database_schema.codeinsights.json", + "schema-descriptions/v5.1.9-internal_database_schema.codeintel.json", + "schema-descriptions/v5.1.9-internal_database_schema.json", ], cmd = "$(location generate.sh) $(@D)", tags = ["requires-network"], diff --git a/cmd/migrator/generate.sh b/cmd/migrator/generate.sh index 1d08890a20e36..7414890951452 100755 --- a/cmd/migrator/generate.sh +++ b/cmd/migrator/generate.sh @@ -76,7 +76,7 @@ git_versions=( v4.4.0 v4.4.1 v4.4.2 v4.5.0 v4.5.1 v5.0.0 v5.0.1 v5.0.2 v5.0.3 v5.0.4 - v5.1.0 v5.1.1 v5.1.2 v5.1.3 v5.1.4 v5.1.5 v5.1.6 v5.1.7 v5.1.8) + v5.1.0 v5.1.1 v5.1.2 v5.1.3 v5.1.4 v5.1.5 v5.1.6 v5.1.7 v5.1.8 v5.1.9) for version in "${git_versions[@]}"; do download_github "${version}" diff --git a/internal/database/migration/shared/data/cmd/generator/consts.go b/internal/database/migration/shared/data/cmd/generator/consts.go index dcbf4dfb842f3..ddb81f2e73492 100644 --- a/internal/database/migration/shared/data/cmd/generator/consts.go +++ b/internal/database/migration/shared/data/cmd/generator/consts.go @@ -6,10 +6,10 @@ import ( "github.com/sourcegraph/sourcegraph/internal/oobmigration" ) -// NOTE: This should be kept up-to-date with cmd/migrator/build.sh so that we "bake in" +// NOTE: This should be kept up-to-date with cmd/migrator/generate.sh so that we "bake in" // fallback schemas everything we support migrating to. The release tool automates this upgrade, so don't touch this :) // This should be the last minor version since patch releases only happen in the release branch. -const maxVersionString = "5.1.0" +const maxVersionString = "5.2.0" // MaxVersion is the highest known released version at the time the migrator was built. var MaxVersion = func() oobmigration.Version { diff --git a/internal/database/migration/shared/data/stitched-migration-graph.json b/internal/database/migration/shared/data/stitched-migration-graph.json index 632b1d32d8583..f1c5a535704d8 100755 --- a/internal/database/migration/shared/data/stitched-migration-graph.json +++ b/internal/database/migration/shared/data/stitched-migration-graph.json @@ -912,6 +912,13 @@ 1679051112 ], "PreCreation": false + }, + "v5.2.0": { + "RootID": 1000000027, + "LeafIDs": [ + 1679051112 + ], + "PreCreation": false } } }, @@ -1867,6 +1874,13 @@ 1686315964 ], "PreCreation": false + }, + "v5.2.0": { + "RootID": 1000000033, + "LeafIDs": [ + 1686315964 + ], + "PreCreation": false } } }, @@ -10499,6 +10513,269 @@ ], "IsCreateIndexConcurrently": false, "IndexMetadata": null + }, + { + "ID": 1688649829, + "Name": "user_completed_post_signup", + "UpQuery": "ALTER TABLE users ADD COLUMN IF NOT EXISTS completed_post_signup BOOLEAN NOT NULL DEFAULT FALSE;\n\n-- We mark all users that have verified their email as having completed_post_signup\n-- the post-signup flow\nUPDATE users\nSET completed_post_signup = TRUE\nFROM user_emails\nWHERE\n user_emails.user_id = users.id\nAND\n user_emails.verified_at IS NOT NULL;", + "DownQuery": "ALTER TABLE users DROP COLUMN IF EXISTS completed_post_signup;", + "Privileged": false, + "NonIdempotent": false, + "Parents": [ + 1687792857 + ], + "IsCreateIndexConcurrently": false, + "IndexMetadata": null + }, + { + "ID": 1689176578, + "Name": "add new fields to event_logs table", + "UpQuery": "ALTER TABLE IF EXISTS event_logs\n ADD COLUMN IF NOT EXISTS billing_product_category text,\n ADD COLUMN IF NOT EXISTS billing_event_id text,\n ADD COLUMN IF NOT EXISTS client text;", + "DownQuery": "ALTER TABLE IF EXISTS event_logs\n DROP COLUMN IF EXISTS billing_product_category,\n DROP COLUMN IF EXISTS billing_event_id,\n DROP COLUMN IF EXISTS client;", + "Privileged": false, + "NonIdempotent": false, + "Parents": [ + 1688649829 + ], + "IsCreateIndexConcurrently": false, + "IndexMetadata": null + }, + { + "ID": 1689692530, + "Name": "add column pool_repo_id to gitserver_repos", + "UpQuery": "ALTER TABLE gitserver_repos\n\tADD COLUMN IF NOT EXISTS pool_repo_id INTEGER DEFAULT NULL REFERENCES repo (id);\n\nCOMMENT ON COLUMN gitserver_repos.pool_repo_id IS 'This is used to refer to the pool repository for deduplicated repos';", + "DownQuery": "ALTER TABLE gitserver_repos\n\tDROP COLUMN IF EXISTS pool_repo_id;", + "Privileged": false, + "NonIdempotent": false, + "Parents": [ + 1688649829 + ], + "IsCreateIndexConcurrently": false, + "IndexMetadata": null + }, + { + "ID": 1689886483, + "Name": "sg_telemetry_allowlist", + "UpQuery": "-- This migration was generated by the command `sg telemetry add`\nINSERT INTO event_logs_export_allowlist (event_name)\nVALUES (UNNEST('{SimpleSearchSubmitSearch,SimpleSearchSelectJob,SimpleSearchBackButtonClick,SimpleSearchToggle}'::TEXT[]))\nON CONFLICT DO NOTHING;", + "DownQuery": "-- This migration was generated by the command `sg telemetry add`\nDELETE FROM event_logs_export_allowlist WHERE event_name IN (SELECT * FROM UNNEST('{SimpleSearchSubmitSearch,SimpleSearchSelectJob,SimpleSearchBackButtonClick,SimpleSearchToggle}'::TEXT[]));", + "Privileged": false, + "NonIdempotent": false, + "Parents": [ + 1689692530 + ], + "IsCreateIndexConcurrently": false, + "IndexMetadata": null + }, + { + "ID": 1689942733, + "Name": "drop path_includes, path_excludes columns from sub_repo_permissions", + "UpQuery": "ALTER TABLE ONLY sub_repo_permissions\n DROP COLUMN IF EXISTS path_includes,\n DROP COLUMN IF EXISTS path_excludes;", + "DownQuery": "ALTER TABLE ONLY sub_repo_permissions\n ADD COLUMN IF NOT EXISTS path_includes text[],\n ADD COLUMN IF NOT EXISTS path_excludes text[];", + "Privileged": false, + "NonIdempotent": false, + "Parents": [ + 1689692530 + ], + "IsCreateIndexConcurrently": false, + "IndexMetadata": null + }, + { + "ID": 1690401277, + "Name": "exhaustive search jobs", + "UpQuery": "CREATE TABLE IF NOT EXISTS exhaustive_search_jobs\n(\n id SERIAL PRIMARY KEY,\n state text DEFAULT 'queued'::text,\n initiator_id integer NOT NULL,\n query text NOT NULL,\n failure_message text,\n started_at timestamp with time zone,\n finished_at timestamp with time zone,\n process_after timestamp with time zone,\n num_resets integer DEFAULT 0 NOT NULL,\n num_failures integer DEFAULT 0 NOT NULL,\n last_heartbeat_at timestamp with time zone,\n execution_logs json[],\n worker_hostname text not null default '',\n cancel boolean not null default false,\n created_at timestamp with time zone DEFAULT now() NOT NULL,\n updated_at timestamp with time zone DEFAULT now() NOT NULL,\n queued_at timestamp with time zone DEFAULT now()\n);\n\nALTER TABLE exhaustive_search_jobs\n DROP CONSTRAINT IF EXISTS exhaustive_search_jobs_initiator_id_fkey,\n ADD CONSTRAINT exhaustive_search_jobs_initiator_id_fkey\n FOREIGN KEY (initiator_id)\n REFERENCES users (id)\n ON DELETE CASCADE\n ON UPDATE CASCADE\n DEFERRABLE;\n\nALTER TABLE ONLY exhaustive_search_jobs\n DROP CONSTRAINT IF EXISTS exhaustive_search_jobs_query_initiator_id_key,\n ADD CONSTRAINT exhaustive_search_jobs_query_initiator_id_key UNIQUE (query, initiator_id);\n\nCREATE TABLE IF NOT EXISTS exhaustive_search_repo_jobs\n(\n id SERIAL PRIMARY KEY,\n state text DEFAULT 'queued'::text,\n repo_id integer NOT NULL REFERENCES repo (id) ON DELETE CASCADE,\n ref_spec text NOT NULL,\n search_job_id integer NOT NULL REFERENCES exhaustive_search_jobs (id) ON DELETE CASCADE,\n failure_message text,\n started_at timestamp with time zone,\n finished_at timestamp with time zone,\n process_after timestamp with time zone,\n num_resets integer DEFAULT 0 NOT NULL,\n num_failures integer DEFAULT 0 NOT NULL,\n last_heartbeat_at timestamp with time zone,\n execution_logs json[],\n worker_hostname text not null default '',\n cancel boolean not null default false,\n created_at timestamp with time zone DEFAULT now() NOT NULL,\n updated_at timestamp with time zone DEFAULT now() NOT NULL,\n queued_at timestamp with time zone DEFAULT now()\n);\n\nCREATE TABLE IF NOT EXISTS exhaustive_search_repo_revision_jobs\n(\n id SERIAL PRIMARY KEY,\n state text DEFAULT 'queued'::text,\n search_repo_job_id integer NOT NULL REFERENCES exhaustive_search_repo_jobs (id) ON DELETE CASCADE,\n revision text NOT NULL,\n failure_message text,\n started_at timestamp with time zone,\n finished_at timestamp with time zone,\n process_after timestamp with time zone,\n num_resets integer DEFAULT 0 NOT NULL,\n num_failures integer DEFAULT 0 NOT NULL,\n last_heartbeat_at timestamp with time zone,\n execution_logs json[],\n worker_hostname text not null default '',\n cancel boolean not null default false,\n created_at timestamp with time zone DEFAULT now() NOT NULL,\n updated_at timestamp with time zone DEFAULT now() NOT NULL,\n queued_at timestamp with time zone DEFAULT now()\n);", + "DownQuery": "DROP TABLE IF EXISTS exhaustive_search_repo_revision_jobs;\nDROP TABLE IF EXISTS exhaustive_search_repo_jobs;\nDROP TABLE IF EXISTS exhaustive_search_jobs;", + "Privileged": false, + "NonIdempotent": false, + "Parents": [ + 1689176578, + 1689886483, + 1689942733 + ], + "IsCreateIndexConcurrently": false, + "IndexMetadata": null + }, + { + "ID": 1690460411, + "Name": "Add code_hosts table", + "UpQuery": "CREATE TABLE IF NOT EXISTS code_hosts (\n id SERIAL PRIMARY KEY,\n kind text NOT NULL,\n url text NOT NULL UNIQUE,\n api_rate_limit_quota integer,\n api_rate_limit_interval_seconds integer,\n git_rate_limit_quota integer,\n git_rate_limit_interval_seconds integer,\n created_at timestamp with time zone NOT NULL DEFAULT now(),\n updated_at timestamp with time zone NOT NULL DEFAULT now()\n);\n\nALTER TABLE external_services\n ADD COLUMN IF NOT EXISTS code_host_id integer REFERENCES code_hosts(id) ON DELETE SET NULL ON UPDATE CASCADE DEFERRABLE INITIALLY DEFERRED;", + "DownQuery": "ALTER TABLE external_services\n DROP COLUMN IF EXISTS code_host_id;\n\nDROP TABLE IF EXISTS code_hosts;", + "Privileged": false, + "NonIdempotent": false, + "Parents": [ + 1689176578, + 1689886483, + 1689942733 + ], + "IsCreateIndexConcurrently": false, + "IndexMetadata": null + }, + { + "ID": 1692053282, + "Name": "content_library_onboarding_tour", + "UpQuery": "CREATE TABLE IF NOT EXISTS user_onboarding_tour\n(\n id SERIAL PRIMARY KEY NOT NULL,\n raw_json TEXT NOT NULL,\n created_at TIMESTAMP NOT NULL DEFAULT NOW(),\n updated_by INT,\n CONSTRAINT user_onboarding_tour_users_fk FOREIGN KEY(updated_by) REFERENCES users(id)\n)", + "DownQuery": "DROP TABLE IF EXISTS user_onboarding_tour;", + "Privileged": false, + "NonIdempotent": false, + "Parents": [ + 1690460411 + ], + "IsCreateIndexConcurrently": false, + "IndexMetadata": null + }, + { + "ID": 1690323910, + "Name": "add_chunks_excluded_embeddings_stats", + "UpQuery": "ALTER TABLE repo_embedding_job_stats\n ADD COLUMN IF NOT EXISTS code_chunks_excluded INTEGER NOT NULL DEFAULT 0,\n ADD COLUMN IF NOT EXISTS text_chunks_excluded INTEGER NOT NULL DEFAULT 0;", + "DownQuery": "ALTER TABLE repo_embedding_job_stats\n DROP COLUMN IF EXISTS code_chunks_excluded,\n DROP COLUMN IF EXISTS text_chunks_excluded;", + "Privileged": false, + "NonIdempotent": false, + "Parents": [ + 1687792857 + ], + "IsCreateIndexConcurrently": false, + "IndexMetadata": null + }, + { + "ID": 1691043630, + "Name": "event_logs_indexing", + "UpQuery": "-- REMOVED: index creation was not concurrent, so this was causing significant downtime.\n\n-- Original text below:\n----------------------------------------------------------------------------------------\n-- CREATE OR REPLACE FUNCTION iscodyactiveevent(name text) RETURNS boolean\n-- LANGUAGE plpgsql IMMUTABLE\n-- AS $$\n-- BEGIN\n-- RETURN\n-- (name LIKE '%%cody%%' OR name LIKE '%%Cody%%')\n-- AND name NOT IN (\n-- '%completion:started%',\n-- '%completion:suggested%',\n-- '%cta%',\n-- '%Cta%',\n-- 'CodyVSCodeExtension:CodySavedLogin:executed',\n-- 'web:codyChat:tryOnPublicCode',\n-- 'web:codyEditorWidget:viewed',\n-- 'web:codyChat:pageViewed',\n-- 'CodyConfigurationPageViewed',\n-- 'ClickedOnTryCodySearchCTA',\n-- 'TryCodyWebOnboardingDisplayed',\n-- 'AboutGetCodyPopover',\n-- 'TryCodyWeb',\n-- 'CodySurveyToastViewed',\n-- 'SiteAdminCodyPageViewed',\n-- 'CodyUninstalled',\n-- 'SpeakToACodyEngineerCTA'\n-- );\n-- END;\n-- $$;\n--\n-- CREATE OR REPLACE FUNCTION iscodyexplanationevent(name text) RETURNS boolean\n-- LANGUAGE plpgsql IMMUTABLE\n-- AS $$\n-- BEGIN\n-- RETURN name = ANY(ARRAY[\n-- 'CodyVSCodeExtension:recipe:explain-code-high-level:executed',\n-- 'CodyVSCodeExtension:recipe:explain-code-detailed:executed',\n-- 'CodyVSCodeExtension:recipe:find-code-smells:executed',\n-- 'CodyVSCodeExtension:recipe:git-history:executed',\n-- 'CodyVSCodeExtension:recipe:rate-code:executed'\n-- ]);\n-- END;\n-- $$;\n--\n-- CREATE OR REPLACE FUNCTION iscodygenerationevent(name text) RETURNS boolean\n-- LANGUAGE plpgsql IMMUTABLE\n-- AS $$\n-- BEGIN\n-- RETURN name = ANY(ARRAY[\n-- 'CodyVSCodeExtension:recipe:rewrite-to-functional:executed',\n-- 'CodyVSCodeExtension:recipe:improve-variable-names:executed',\n-- 'CodyVSCodeExtension:recipe:replace:executed',\n-- 'CodyVSCodeExtension:recipe:generate-docstring:executed',\n-- 'CodyVSCodeExtension:recipe:generate-unit-test:executed',\n-- 'CodyVSCodeExtension:recipe:rewrite-functional:executed',\n-- 'CodyVSCodeExtension:recipe:code-refactor:executed',\n-- 'CodyVSCodeExtension:recipe:fixup:executed',\n-- \t'CodyVSCodeExtension:recipe:translate-to-language:executed'\n-- ]);\n-- END;\n-- $$;\n--\n-- CREATE INDEX IF NOT EXISTS event_logs_name_is_cody_explanation_event ON event_logs USING btree (iscodyexplanationevent(name));\n--\n-- CREATE INDEX IF NOT EXISTS event_logs_name_is_cody_generation_event ON event_logs USING btree (iscodygenerationevent(name));\n--\n-- CREATE INDEX IF NOT EXISTS event_logs_name_is_cody_active_event ON event_logs USING btree (iscodyactiveevent(name));", + "DownQuery": "-- REMOVED: index creation was not concurrent, so this was causing significant downtime.\n\n-- Original text below:\n----------------------------------------------------------------------------------------\n-- DROP INDEX IF EXISTS event_logs_name_is_cody_explanation_event;\n--\n-- DROP INDEX IF EXISTS event_logs_name_is_cody_generation_event;\n--\n-- DROP INDEX IF EXISTS event_logs_name_is_cody_active_event;\n--\n-- DROP FUNCTION IF EXISTS isCodyGenerationEvent(name text);\n--\n-- DROP FUNCTION IF EXISTS isCodyExplanationEvent(name text);\n--\n-- DROP FUNCTION IF EXISTS isCodyActiveEvent(name text);", + "Privileged": false, + "NonIdempotent": false, + "Parents": [ + 1690323910 + ], + "IsCreateIndexConcurrently": false, + "IndexMetadata": null + }, + { + "ID": 1691485365, + "Name": "sg_telemetry_allowlist", + "UpQuery": "-- This migration was generated by the command `sg telemetry add`\nINSERT INTO event_logs_export_allowlist (event_name) VALUES (UNNEST('{web:codyChat:pageViewed,web:codyChat:submit,web:codyChat:edit,web:codyChat:initialized,web:codyChat:editorWidgetViewed,web:codyChat:historyCleared,web:codyChat:historyItemDeleted,web:codyChat:scopeRepoAdded,web:codyChat:scopeRepoRemoved,web:codyChat:scopeReset,web:codyChat:inferredRepoEnabled,web:codyChat:inferredRepoDisabled,web:codyChat:inferredFileEnabled,web:codyChat:inferredFileDisabled,ViewGetCody,web:codyEditorWidget:viewed,web:codySidebar:chatOpened,CodySignup,web:codyChat:downloadVSCodeCTA,web:codyChat:tryOnPublicCodeCTA,CodyClickViewEditorExtensions,VSCodeInstall,VSCodeMarketplace,TryCodyWeb,TryCodyWebOnboardingDisplayed,CodySignUpInitiated,SpeakToACodyEngineerCTA,SignupInitiated,JoinIDEWaitlist,DownloadIDE,DownloadApp}'::TEXT[])) ON CONFLICT DO NOTHING;", + "DownQuery": "-- This migration was generated by the command `sg telemetry add`\nDELETE FROM event_logs_export_allowlist WHERE event_name IN (SELECT * FROM UNNEST('{web:codyChat:pageViewed,web:codyChat:submit,web:codyChat:edit,web:codyChat:initialized,web:codyChat:editorWidgetViewed,web:codyChat:historyCleared,web:codyChat:historyItemDeleted,web:codyChat:scopeRepoAdded,web:codyChat:scopeRepoRemoved,web:codyChat:scopeReset,web:codyChat:inferredRepoEnabled,web:codyChat:inferredRepoDisabled,web:codyChat:inferredFileEnabled,web:codyChat:inferredFileDisabled,ViewGetCody,web:codyEditorWidget:viewed,web:codySidebar:chatOpened,CodySignup,web:codyChat:downloadVSCodeCTA,web:codyChat:tryOnPublicCodeCTA,CodyClickViewEditorExtensions,VSCodeInstall,VSCodeMarketplace,TryCodyWeb,TryCodyWebOnboardingDisplayed,CodySignUpInitiated,SpeakToACodyEngineerCTA,SignupInitiated,JoinIDEWaitlist,DownloadIDE,DownloadApp}'::TEXT[]));", + "Privileged": false, + "NonIdempotent": false, + "Parents": [ + 1690323910, + 1690460411 + ], + "IsCreateIndexConcurrently": false, + "IndexMetadata": null + }, + { + "ID": 1691595214, + "Name": "autoindexing_manual_priority", + "UpQuery": "ALTER TABLE lsif_indexes\nADD COLUMN IF NOT EXISTS enqueuer_user_id integer NOT NULL DEFAULT 0;\n\nDROP VIEW IF EXISTS lsif_indexes_with_repository_name;\n\nCREATE VIEW lsif_indexes_with_repository_name AS\n SELECT u.id,\n u.commit,\n u.queued_at,\n u.state,\n u.failure_message,\n u.started_at,\n u.finished_at,\n u.repository_id,\n u.process_after,\n u.num_resets,\n u.num_failures,\n u.docker_steps,\n u.root,\n u.indexer,\n u.indexer_args,\n u.outfile,\n u.log_contents,\n u.execution_logs,\n u.local_steps,\n u.should_reindex,\n u.requested_envvars,\n r.name AS repository_name,\n u.enqueuer_user_id\n FROM (lsif_indexes u\n JOIN repo r ON ((r.id = u.repository_id)))\n WHERE (r.deleted_at IS NULL);", + "DownQuery": "DROP VIEW IF EXISTS lsif_indexes_with_repository_name;\n\nCREATE VIEW lsif_indexes_with_repository_name AS\n SELECT u.id,\n u.commit,\n u.queued_at,\n u.state,\n u.failure_message,\n u.started_at,\n u.finished_at,\n u.repository_id,\n u.process_after,\n u.num_resets,\n u.num_failures,\n u.docker_steps,\n u.root,\n u.indexer,\n u.indexer_args,\n u.outfile,\n u.log_contents,\n u.execution_logs,\n u.local_steps,\n u.should_reindex,\n u.requested_envvars,\n r.name AS repository_name\n FROM (lsif_indexes u\n JOIN repo r ON ((r.id = u.repository_id)))\n WHERE (r.deleted_at IS NULL);\n\nALTER TABLE lsif_indexes\nDROP COLUMN IF EXISTS enqueuer_user_id;", + "Privileged": false, + "NonIdempotent": false, + "Parents": [ + 1690323910, + 1690460411 + ], + "IsCreateIndexConcurrently": false, + "IndexMetadata": null + }, + { + "ID": 1691759644, + "Name": "autoindexing_manual_priority_index", + "UpQuery": "CREATE INDEX CONCURRENTLY IF NOT EXISTS\nlsif_indexes_dequeue_order_idx ON lsif_indexes\nUSING btree ((enqueuer_user_id \u003e 0) DESC, queued_at DESC, id)\nWHERE (state = 'queued' OR state = 'errored');", + "DownQuery": "DROP INDEX IF EXISTS lsif_indexes_dequeue_order_idx;", + "Privileged": false, + "NonIdempotent": false, + "Parents": [ + 1691043630, + 1691595214 + ], + "IsCreateIndexConcurrently": true, + "IndexMetadata": { + "TableName": "lsif_indexes", + "IndexName": "lsif_indexes_dequeue_order_idx" + } + }, + { + "ID": 1692227847, + "Name": "make stats use a bigint", + "UpQuery": "ALTER TABLE repo_embedding_job_stats\n ALTER COLUMN code_bytes_embedded TYPE bigint,\n ALTER COLUMN text_bytes_embedded TYPE bigint;", + "DownQuery": "ALTER TABLE repo_embedding_job_stats\n ALTER COLUMN code_bytes_embedded TYPE integer,\n ALTER COLUMN text_bytes_embedded TYPE integer;", + "Privileged": false, + "NonIdempotent": false, + "Parents": [ + 1690323910, + 1690460411 + ], + "IsCreateIndexConcurrently": false, + "IndexMetadata": null + }, + { + "ID": 1692815296, + "Name": "Delete pool repo", + "UpQuery": "ALTER TABLE gitserver_repos\tDROP COLUMN IF EXISTS pool_repo_id;", + "DownQuery": "ALTER TABLE gitserver_repos\n\tADD COLUMN IF NOT EXISTS pool_repo_id INTEGER DEFAULT NULL REFERENCES repo (id);\n\nCOMMENT ON COLUMN gitserver_repos.pool_repo_id IS 'This is used to refer to the pool repository for deduplicated repos';", + "Privileged": false, + "NonIdempotent": false, + "Parents": [ + 1690401277, + 1691485365, + 1692053282, + 1692227847 + ], + "IsCreateIndexConcurrently": false, + "IndexMetadata": null + }, + { + "ID": 1693825517, + "Name": "exhaustive_search_jobs_remove_constraint", + "UpQuery": "ALTER TABLE ONLY exhaustive_search_jobs\n DROP CONSTRAINT IF EXISTS exhaustive_search_jobs_query_initiator_id_key;", + "DownQuery": "ALTER TABLE ONLY exhaustive_search_jobs\n DROP CONSTRAINT IF EXISTS exhaustive_search_jobs_query_initiator_id_key,\n ADD CONSTRAINT exhaustive_search_jobs_query_initiator_id_key UNIQUE (query, initiator_id);", + "Privileged": false, + "NonIdempotent": false, + "Parents": [ + 1691043630, + 1692815296 + ], + "IsCreateIndexConcurrently": false, + "IndexMetadata": null + }, + { + "ID": 1694806099, + "Name": "Add TelemetryEventsExportQueueStore", + "UpQuery": "CREATE TABLE IF NOT EXISTS telemetry_events_export_queue (\n id TEXT PRIMARY KEY,\n timestamp TIMESTAMPTZ NOT NULL,\n payload_pb BYTEA NOT NULL,\n exported_at TIMESTAMPTZ DEFAULT NULL\n);", + "DownQuery": "DROP TABLE IF EXISTS telemetry_events_export_queue;", + "Privileged": false, + "NonIdempotent": false, + "Parents": [ + 1691759644, + 1693825517 + ], + "IsCreateIndexConcurrently": false, + "IndexMetadata": null + }, + { + "ID": 1695747321, + "Name": "Remove drift", + "UpQuery": "DROP INDEX IF EXISTS event_logs_name_is_cody_active_event;\nDROP INDEX IF EXISTS event_logs_name_is_cody_explanation_event;\nDROP INDEX IF EXISTS event_logs_name_is_cody_generation_event;", + "DownQuery": "-- Empty", + "Privileged": false, + "NonIdempotent": false, + "Parents": [ + 1694806099 + ], + "IsCreateIndexConcurrently": false, + "IndexMetadata": null + }, + { + "ID": 1696003224, + "Name": "sg_telemetry_allowlist", + "UpQuery": "-- This migration was generated by the command `sg telemetry add`\nINSERT INTO event_logs_export_allowlist (event_name) VALUES (UNNEST('{TourShown,TourClosed,TourStepClicked,TourRestartClicked,TourCompleted,TourSetupShown,TourSetupCompleted,TourSetupSkipped}'::TEXT[])) ON CONFLICT DO NOTHING;", + "DownQuery": "-- This migration was generated by the command `sg telemetry add`\nDELETE FROM event_logs_export_allowlist WHERE event_name IN (SELECT * FROM UNNEST('{TourShown,TourClosed,TourStepClicked,TourRestartClicked,TourCompleted,TourSetupShown,TourSetupCompleted,TourSetupSkipped}'::TEXT[]));", + "Privileged": false, + "NonIdempotent": false, + "Parents": [ + 1695747321 + ], + "IsCreateIndexConcurrently": false, + "IndexMetadata": null } ], "BoundsByRev": { @@ -10739,6 +11016,13 @@ 1687792857 ], "PreCreation": false + }, + "v5.2.0": { + "RootID": 1648051770, + "LeafIDs": [ + 1696003224 + ], + "PreCreation": false } } } diff --git a/internal/database/migration/stitch/reader.go b/internal/database/migration/stitch/reader.go index ad568d7b4c0fa..f81826b2914a9 100644 --- a/internal/database/migration/stitch/reader.go +++ b/internal/database/migration/stitch/reader.go @@ -23,6 +23,7 @@ var ignoreMap = map[string]struct{}{ "migrations_test.go": {}, "README.md": {}, "squashed.sql": {}, + "BUILD.bazel": {}, } // readRawMigrations reads migrations from a locally available git revision for the given schema. diff --git a/internal/src-cli/consts.go b/internal/src-cli/consts.go index afc1288330170..5fe4fc24547b8 100644 --- a/internal/src-cli/consts.go +++ b/internal/src-cli/consts.go @@ -6,4 +6,4 @@ package srccli // as the suggested download with this instance. // // At the time of a Sourcegraph release, this is always the latest src-cli version. -const MinimumVersion = "5.1.2" +const MinimumVersion = "5.2.0"