Strata · Migrations

Marker migrations

A migration with steps: [] is a marker: it increments the grammar’s version without transforming any document. Use it to record an addition to a strict grammar. Code that has the marker reads an older document unchanged, and code from before it rejects a document stamped after it with TOO_NEW, where it would otherwise have met an unknown key.

Migration 2 (marker)
{ description: 'A button may carry an icon', steps: [] }
Stored document
{ text: 'Book seats' }
Stored stamp
{ theatre.buttons: 1 }
Output
{
  document: { text: 'Book seats' },
  stamp: { theatre.buttons: 2 },
  applied: ['theatre.buttons/2'],
}
Output matches the expected value

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