From b7d1a8b15c123673fd2ceae651dff61da3bd75c8 Mon Sep 17 00:00:00 2001 From: morgangauth <113058716+morgangauth@users.noreply.github.com> Date: Wed, 5 Feb 2025 11:29:39 -0800 Subject: [PATCH 1/2] Update postgres_12_to_16_drift.mdx fix typo --- docs/admin/how-to/postgres_12_to_16_drift.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/admin/how-to/postgres_12_to_16_drift.mdx b/docs/admin/how-to/postgres_12_to_16_drift.mdx index 527c9e42f..e9f222b01 100644 --- a/docs/admin/how-to/postgres_12_to_16_drift.mdx +++ b/docs/admin/how-to/postgres_12_to_16_drift.mdx @@ -1,6 +1,6 @@ # PostgreSQL 12 to 16 Schema Drift -In Sourcegraph versions `5.10.x` and `5.11.x` we support both PostgreSQL 12 and 16. However, Sourcegraph's database management tool `migrator` expects the database schema of the various Sourcegraph databases to be in an exact expected state. The upgrade from PostgreSQL 12 to 16 is opinionated and automatically mutates the schema without running our application defined migrations. Starting in Sourcegraph `5.10.0` we expect databases to be in PosttgresSQL 16 and as such our tooling will identify schema drift in PostgreSQL 12 databases. This drift does not impact the functionality of the Sourcegraph instance but will stop migrator's multiversion `upgrade` command and `autoupgrade` from executing. +In Sourcegraph versions `5.10.x` and `5.11.x` we support both PostgreSQL 12 and 16. However, Sourcegraph's database management tool `migrator` expects the database schema of the various Sourcegraph databases to be in an exact expected state. The upgrade from PostgreSQL 12 to 16 is opinionated and automatically mutates the schema without running our application defined migrations. Starting in Sourcegraph `5.10.0` we expect databases to be in PostgresSQL 16 and as such our tooling will identify schema drift in PostgreSQL 12 databases. This drift does not impact the functionality of the Sourcegraph instance but will stop migrator's multiversion `upgrade` command and `autoupgrade` from executing. The drift takes the following general form, dropping table prefixes to columns in views, and changing `uuid` types to `gen_random_uuid()`: ```diff From 966f0d22b12469bdbe0d7f85d76ce0a41a9e045a Mon Sep 17 00:00:00 2001 From: morgangauth <113058716+morgangauth@users.noreply.github.com> Date: Wed, 5 Feb 2025 13:10:58 -0800 Subject: [PATCH 2/2] Update postgres_12_to_16_drift.mdx fix other typos --- docs/admin/how-to/postgres_12_to_16_drift.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/admin/how-to/postgres_12_to_16_drift.mdx b/docs/admin/how-to/postgres_12_to_16_drift.mdx index e9f222b01..6494cae85 100644 --- a/docs/admin/how-to/postgres_12_to_16_drift.mdx +++ b/docs/admin/how-to/postgres_12_to_16_drift.mdx @@ -177,11 +177,11 @@ Diff: ## Solutions for Handling Schema Drift -If you're confident that your instance is seeing database drift associated with the PG12 to PG16 upgrade, you can run a nultiversion upgrade via migrator `upgrade` or run `autoupgrade` using the following options. +If you're confident that your instance is seeing database drift associated with the PG12 to PG16 upgrade, you can run a multiversion upgrade via migrator `upgrade` or run `autoupgrade` using the following options. To run `autoupgrade` via the frontend, set the `SRC_AUTOUPGRADE_IGNORE_DRIFT=true` environment variable in the frontend container. -To run migrators `upgrade` command add the `--skip-drift-check` flag to migrator's entrycommand as below: +To run migrator's `upgrade` command add the `--skip-drift-check` flag to migrator's entrycommand as below: ```yaml command: ['upgrade', '-from', '5.5.0', '-to', '5.10.0', '--skip-drift-check=true']              ```