Skip to content

platform: no rollbackSafeFrom edge for 1.3.0–1.5.0 ahead of migration 0063 #664

Closed

Description

@iPLAYCAFE-dev

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 }:

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:

return {
journalSha256: sha256(journalContents),
lineage: compatibility.lineage,
migrations,
protocolVersion: 1,
rollbackSafeFrom: compatibility.rollbackSafeFrom,
schemaDigest: platformDatabaseSchemaDigest(compatibility.lineage, migrations),
};

  • Migrations 0061 and 0062 first shipped in 1.3.0. Platforms on 1.3.0, 1.4.0 and 1.5.0 therefore all have the 0000–0062 schema. 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.sql but does not touch compatibility.json: a274d4f
  • On current main, the list still ends at 1.2.1:
    {
    "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

  1. Will the release that includes 0063 add {1.3.0 | 1.4.0 | 1.5.0, digest(0000–0062)} to rollbackSafeFrom? 0063 only adds a new table with a foreign key to oauth_grants, so it looks additive for the older runtimes. I understand that is something for you to verify.
  2. 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:

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.

Activity

  1. added a commit that references this issue on Nov 2, 2026
    f184a2f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions