Skip to content

A database moved from the fork back to upstream can skip upstream migrations numbered 1.5.0 or lower #86

Closed

Description

@vheathen

Follow-up to #36.

This issue described both directions, and #75 fixes one of them: a database with upstream's 1.5.0 row moving to the fork. The other still holds: a database the fork created or migrated records 1.5.0 (EventStore.Sql.Init inserts (1, 5, 0), and the fork's migrate adds a 1.5.0 row), while upstream's migrate runs only versions strictly greater than the highest one recorded. If upstream ships its own v1.5.0.sql, a database moved from the fork back to upstream would skip it and still report itself migrated, so the database never gets that migration's changes.

Severity: depends on that migration: the database silently lacks its changes while reporting itself migrated. Likelihood: low: only if upstream ships a migration numbered 1.5.0 or lower that differs from the fork's, and a database moves back.

The same rule makes the skip wider than 1.5.0, going by the code (I only ran 1.5.0): moving a database back can skip any unapplied upstream migration numbered 1.5.0 or lower, a future 1.4.x one included, while one above 1.5.0 passes the check.

How I checked it

I checked this with a stand-in, not a real upstream release: upstream's EventStore.Tasks.Migrate, which is the fork's code before #75, compiled under another name, with a v1.5.0.sql that adds a marker column. On a database initialised by the fork at a2ce825, and on a database shaped like upstream 1.4 and then migrated by the fork, it printed "The EventStore database is already migrated." and added no column (3 of 3). On a control shaped like upstream 1.4 alone, it ran v1.5.0 and added the column.

Do you plan to bring this migration upstream as 1.5.0, or keep the fork's version numbers separate from upstream's?

Activity

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions