Repository navigation
Description
Question
Will the release that ships migration 0063 also add rollbackSafeFrom edges for platforms currently on 1.3.0, 1.4.0 or 1.5.0? I'm asking before the next release goes out, because without those edges a 1.5.0 platform would not be able to upgrade to it.
What I see
preparePlatformDatabaseConnection checks the edges only when migrations are pending and the installation already has Workers. In that case it refuses unless the target's rollbackSafeFrom lists the source { platformVersion, schemaDigest }:
void/packages/void/src/cli/platform-installer-database.ts
Lines 403 to 433 in afeeff6
| export async function preparePlatformDatabaseConnection( | |
| client: QueryConnection, | |
| runtimeDirectory: string, | |
| database: PlatformRuntimeDatabaseManifest, | |
| sourcePlatformVersion: string | null, | |
| hasPriorWorkers: boolean, | |
| ): Promise<PlatformDatabaseMigrationResult> { | |
| verifyPlatformDatabaseArtifacts(runtimeDirectory, database); | |
| const before = await inspectPlatformDatabaseStateConnection(client, database); | |
| if (before.pendingMigrations.length === 0) { | |
| if (before.schemaDigest !== database.schemaDigest) { | |
| throw new Error('platform: PostgreSQL schema digest does not match the packaged runtime.'); | |
| } | |
| return { | |
| appliedMigrations: 0, | |
| previousSchemaDigest: before.schemaDigest, | |
| schemaDigest: before.schemaDigest, | |
| }; | |
| } | |
| if ( | |
| hasPriorWorkers && | |
| !database.rollbackSafeFrom.some( | |
| (entry) => | |
| entry.platformVersion === sourcePlatformVersion && | |
| entry.schemaDigest === before.schemaDigest, | |
| ) | |
| ) { | |
| throw new Error( | |
| `platform: Void Platform ${sourcePlatformVersion ?? 'unknown'} cannot safely roll back after migrating database schema ${before.schemaDigest} to this release. Upgrade through a supported intermediate version or install into a fresh database.`, | |
| ); | |
| } |
The runtime build copies compatibility.json into the runtime manifest unchanged:
void/packages/platform/scripts/build-runtime.mjs
Lines 215 to 222 in afeeff6
| return { | |
| journalSha256: sha256(journalContents), | |
| lineage: compatibility.lineage, | |
| migrations, | |
| protocolVersion: 1, | |
| rollbackSafeFrom: compatibility.rollbackSafeFrom, | |
| schemaDigest: platformDatabaseSchemaDigest(compatibility.lineage, migrations), | |
| }; |
- Migrations
0061and0062first shipped in 1.3.0. Platforms on 1.3.0, 1.4.0 and 1.5.0 therefore all have the0000–0062schema. No upgrade between those versions had a pending migration, so none of them needed an edge. - feat(platform): add refresh tokens for connected-app identity grants #631 (a274d4f) adds
0063_oauth_refresh_tokens.sqlbut does not touchcompatibility.json: a274d4f - On current
main, the list still ends at 1.2.1:void/platform/packages/api/drizzle/compatibility.json
Lines 89 to 101 in 291d353
{ "platformVersion": "1.1.12", "schemaDigest": "d8e007d2bbe02637f6e77a33c1db152e0c4f21b30439ad512e16bce6726d6b9b" }, { "platformVersion": "1.2.0", "schemaDigest": "d8e007d2bbe02637f6e77a33c1db152e0c4f21b30439ad512e16bce6726d6b9b" }, { "platformVersion": "1.2.1", "schemaDigest": "d8e007d2bbe02637f6e77a33c1db152e0c4f21b30439ad512e16bce6726d6b9b" } ]
For comparison, when #551 added 0061, it also added edges for the versions that were released at the time (1.1.11 to 1.2.1): 36a3697
If a release shipped from main as it is now, upgrading a 1.5.0 platform would stop with:
platform: Void Platform 1.5.0 cannot safely roll back after migrating database schema <digest of 0000–0062> to this release. Upgrade through a supported intermediate version or install into a fresh database.
No intermediate version exists for that schema. Platforms on 1.2.1 or older, and fresh installs, are not affected.
Questions
- Will the release that includes
0063add{1.3.0 | 1.4.0 | 1.5.0, digest(0000–0062)}torollbackSafeFrom?0063only adds a new table with a foreign key tooauth_grants, so it looks additive for the older runtimes. I understand that is something for you to verify. - If those edges won't be added, what is the supported upgrade path for a 1.5.0 platform?
I know that schema-ci.md says to "add an edge only after testing that compatibility", so a lag here may be intentional:
void/docs/guide/platform/development/schema-ci.md
Lines 15 to 17 in 291d353
| Review the generated SQL and migration journal before committing them. Released migrations are append-only. An upgrade applies new migrations while the previous Workers may still serve requests, so schema changes must remain compatible with that code. | |
| `platform/packages/api/drizzle/compatibility.json` records which earlier runtimes have been verified against the new schema. Add an edge only after testing that compatibility. The runtime build checks that the migration files and recorded schema history agree. |
That is why I'm asking here instead of opening a PR: only you can test those edges.
Prepared with Claude Code on behalf of @iPLAYCAFE-dev; reviewed by the maintainer of this account.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
fix(platform): let 1.3.0 through 1.5.0 upgrade past migration 0063 (v…