Skip to content

Commit 69778e4

Browse files
committed
fix(cli): say keep a v17 database, so the refusal stays true on a database 18.0 created
The drop gate also fires on a fresh 18.0 database whose object newly declares systemFields.tenant false over its injected organization_id, so the refusal names a v17 database rather than this one. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SYEJqDL3NXxrJRBVqaMu9T
1 parent c6cea94 commit 69778e4

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎.changeset/24567-drop-gate-refusal-18-0.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ fix(cli): `os migrate apply --allow-destructive`'s organization-ownership refusa
66

77
Clause-②: no
88

9-
- **`os migrate apply --allow-destructive` on a v17-shaped database.** When the run would drop `organization_id` from a table the organization-ownership ceremony owns, and the ceremony has not verified on the database, the refusal now says that 18.0 supports fresh installs only and does not upgrade a v17 database: keep it on a 17.x release until the 18.x release that carries the upgrade path, whose ceremony drops these columns itself. This is what the v18 boot refusal says. Before, it told the operator to run `os migrate organization-ownership --out PLAN` and then `--apply --plan-file PLAN`, which 18.0 refuses on every database (`NOT_IMPLEMENTED`). The `--json` refusal's `detail` no longer names that command either: it reads "No run of the organization-ownership ceremony is recorded on this database.", or names the last unverified run with its date and blocking count.
9+
- **`os migrate apply --allow-destructive` on a v17-shaped database.** When the run would drop `organization_id` from a table the organization-ownership ceremony owns, and the ceremony has not verified on the database, the refusal now says that 18.0 supports fresh installs only and does not upgrade a v17 database: keep a v17 database on a 17.x release until the 18.x release that carries the upgrade path, whose ceremony drops these columns itself. The v18 boot refusal and `os migrate organization-ownership`'s own refusal say the same. Before, it told the operator to run `os migrate organization-ownership --out PLAN` and then `--apply --plan-file PLAN`, which 18.0 refuses on every database (`NOT_IMPLEMENTED`). The `--json` refusal's `detail` no longer names that command either: it reads "No run of the organization-ownership ceremony is recorded on this database.", or names the last unverified run with its date and blocking count.
1010
- **`os migrate organization-ownership --help`** shows what the command answers in 18.0: exit `1` with `NOT_IMPLEMENTED`, nothing read or written, and the same refusal as JSON. Before, it showed six plan and apply examples that 18.0 refuses.
11-
- **`os dev` on a v17-shaped development database.** When it does not upgrade the database in place (the ceremony's plan is refused, or the database is not a local SQLite file), it now ends with the same position: keep this development database on a 17.x release until the 18.x release that carries the upgrade path, and upgrade it there. Before, it told the developer to run `os migrate organization-ownership --dev` and then the same command with `--apply`.
11+
- **`os dev` on a v17-shaped development database.** When it does not upgrade the database in place (the ceremony's plan is refused, or the database is not a local SQLite file), it now ends with the same position: keep a v17 development database on a 17.x release until the 18.x release that carries the upgrade path, and upgrade it there. Before, it told the developer to run `os migrate organization-ownership --dev` and then the same command with `--apply`.
1212

1313
Nothing else changes. The refusals still hold back the whole run, and their message code (`refused_organization_ownership_unmigrated`), `tables`, `marker`, exit code `1` and every flag are as before.

‎packages/cli/src/commands/migrate/apply.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,8 +595,8 @@ export default class MigrateApply extends Command {
595595
`Refusing this --allow-destructive run: it would drop organization_id from ${organizationDrops.join(', ')}, a drop the organization-ownership ceremony `
596596
+ `owns, and the ceremony has not verified on this database. ${detail} Dropping the column first would turn `
597597
+ 'every legacy organization row into an environment row without the ceremony\'s promotion or report. 18.0 '
598-
+ 'supports fresh installs only and does not upgrade a v17 database: keep it on a 17.x release until the '
599-
+ '18.x release that carries the upgrade path, whose ceremony drops these columns itself, in its '
598+
+ 'supports fresh installs only and does not upgrade a v17 database: keep a v17 database on a 17.x release '
599+
+ 'until the 18.x release that carries the upgrade path, whose ceremony drops these columns itself, in its '
600600
+ 'column-drops step, before it records the run verified. Nothing in this run was applied.',
601601
);
602602
this.exit(1);

‎packages/cli/src/utils/dev-organization-ownership-upgrade.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export function upgradeDevelopmentDatabase(input: DevelopmentUpgradeInput): Deve
125125
// the boot refusal's terms. The 18.x release that registers the ceremony names
126126
// its steps here again.
127127
const manual =
128-
'18.0 supports fresh installs only and does not upgrade a v17 database: keep this development database on a ' +
128+
'18.0 supports fresh installs only and does not upgrade a v17 database: keep a v17 development database on a ' +
129129
'17.x release until the 18.x release that carries the upgrade path, and upgrade it there.';
130130
if (!input.sqliteFile) {
131131
return {

0 commit comments

Comments
 (0)