From 671c407fba6474917b8b3ecead40bba0b20297d6 Mon Sep 17 00:00:00 2001 From: natehessler Date: Mon, 3 Nov 2025 10:48:56 -0600 Subject: [PATCH 1/2] Refactor privileged migration documentation and flags https://ampcode.com/threads/T-f053c38d-7f04-4729-8414-4102f9d746f4 Co-authored-by: Amp --- docs/admin/how-to/privileged_migrations.mdx | 4 ++-- docs/admin/updates/migrator/migrator-operations.mdx | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/admin/how-to/privileged_migrations.mdx b/docs/admin/how-to/privileged_migrations.mdx index bc5dfba5f..a5abd7f26 100644 --- a/docs/admin/how-to/privileged_migrations.mdx +++ b/docs/admin/how-to/privileged_migrations.mdx @@ -2,7 +2,7 @@ Postgres database migrations can be _privileged_ or _unprivileged_. The vast majority of migrations are unprivileged, and should require relatively low capabilities within the connected database. Some migrations are privileged and contain queries that require additional capabilities within the database. Currently, this includes the installation and modification (attached comments) of Postgres extensions. -If your Sourcegraph instance does not connect to the database with a superuser, then privileged migrations will fail. There are currently two methods to apply privileged migrations by hand to allow the installation or update of your Sourcegraph instance to proceed. +If your Sourcegraph instance does not connect to the database with a superuser, then privileged migrations will fail. **If you need to apply privileged migrations, please contact support@sourcegraph.com before proceeding.** Note that these flags affect the `migrator` commands `up`, `upto`, `downto`, `upgrade`, and `downgrade`. @@ -17,4 +17,4 @@ The migration runner is currently being run with -unprivileged-only. The indicat This option is used to fail-fast upgrades that require manual user intervention. To allow the migrator to make additional progress, the privileged query/queries must be applied manually with a superuser (most commonly via a psql shell attached to the Postgres instance). -To be interactively instructed through the manual process, re-run the migrator with the [`--noop-privileged`](#option-2-noop-privileged) flag. Otherwise, you can manually [find and apply the target privileged migrations](/admin/how-to/dirty_database#2-run-the-sql-queries-to-finish-incomplete-migrations) and [manually add a migration log entry](/admin/how-to/dirty_database#3-add-a-migration-log-entry). +You can manually [find and apply the target privileged migrations](/admin/how-to/dirty_database#2-run-the-sql-queries-to-finish-incomplete-migrations) and [manually add a migration log entry](/admin/how-to/dirty_database#3-add-a-migration-log-entry). diff --git a/docs/admin/updates/migrator/migrator-operations.mdx b/docs/admin/updates/migrator/migrator-operations.mdx index 346e21aaa..9ba4aa5cc 100644 --- a/docs/admin/updates/migrator/migrator-operations.mdx +++ b/docs/admin/updates/migrator/migrator-operations.mdx @@ -75,7 +75,7 @@ upgrade \ [--dry-run=false] \ [--disable-animation=false] \ [--skip-version-check=false] [--skip-drift-check=false] \ - [--unprivileged-only=false] [--noop-privileged=false] [--privileged-hash=] \ + [--unprivileged-only=false] [--privileged-hash=] \ [--ignore-migrator-update=false] ``` @@ -133,7 +133,7 @@ downgrade \ [--dry-run=false] \ [--disable-animation=false] \ [--skip-version-check=false] [--skip-drift-check=false] \ - [--unprivileged-only=false] [--noop-privileged=false] [--privileged-hash=] \ + [--unprivileged-only=false] [--privileged-hash=] \ [--ignore-migrator-update=false] ``` @@ -148,7 +148,7 @@ downgrade \ - `--disable-animation`: Print plain log messages instead of an animated progress bar. - `--skip-version-check`: Skip comparing the current instance version against `--from`. - `--skip-drift-check`: Skip comparing the database schema shape against the schema defined by `--from`. -- `--unprivileged-only` and `--noop-privileged`: Controls behavior of schema migrations the presence of [privileged definitions](/admin/how-to/privileged_migrations). +- `--unprivileged-only`: Controls behavior of schema migrations the presence of [privileged definitions](/admin/how-to/privileged_migrations). - `--ignore-migrator-update`: Controls whether to hard- or soft-fail if a newer migrator version is available. It is recommended to use the latest migrator version. **Notes**: @@ -209,7 +209,7 @@ up \ [--skip-upgrade-validation=false] \ [--skip-oobmigration-validation=false] [--ignore-single-dirty-log=false] [--ignore-single-pending-log=false] \ - [--unprivileged-only=false] [--noop-privileged=false] [--privileged-hash=] + [--unprivileged-only=false] [--privileged-hash=] ``` **Optional arguments**: @@ -218,7 +218,7 @@ up \ - `--skip-upgrade-validation`: Skip asserting that the [standard upgrade policy](/admin/updates/#upgrade-types) is being followed. - `--skip-oobmigration-validation`: Skip reading the progress of out-of-band migrations to assert completion of newly deprecated migrations. - `--ignore-single-dirty-log` and `--ignore-single-pending-log`: Re-attempt to apply the **next** migration that was marked as errored or as incomplete (respectively). See [how to troubleshoot a dirty database](/admin/how-to/dirty_database#0-attempt-re-application). -- `--unprivileged-only` and `--noop-privileged`: Controls behavior of schema migrations the presence of [privileged definitions](/admin/how-to/privileged_migrations). +- `--unprivileged-only`: Controls behavior of schema migrations the presence of [privileged definitions](/admin/how-to/privileged_migrations). **Notes**: From 52042795b277483f457e7b20dbb96dc38fe779b4 Mon Sep 17 00:00:00 2001 From: natehessler Date: Mon, 3 Nov 2025 10:50:39 -0600 Subject: [PATCH 2/2] Refactor privileged migration documentation and flags https://ampcode.com/threads/T-f053c38d-7f04-4729-8414-4102f9d746f4 Co-authored-by: Amp