Strata · Errors

TOO_NEW: database

planMigrations reports TOO_NEW when the database’s ledger is ahead of the code. Here the ledger records 4 applied migrations of theatre.app and the code has 3. Older code cannot tell what migration 4 changed, so nothing is run against the database.

Sequence (descriptions only)
{
  id: 'theatre.app',
  migrations: ['Shows', 'Bookings', 'Season passes'],
}
Ledger
[
  { sequence: 'theatre.app', n: 1, description: 'Shows' },
  { sequence: 'theatre.app', n: 2, description: 'Bookings' },
  { sequence: 'theatre.app', n: 3, description: 'Season passes' },
  { sequence: 'theatre.app', n: 4, description: 'Gift vouchers' },
]
Error
TOO_NEW
The migrations cannot be applied safely.
  TOO_NEW: theatre.app: the database is at 4, this code knows 3 — it was migrated by newer code.
Output matches the expected value

Runs in this page on the installed package. The input and the expected output are defined by the example.