Strata · Errors

INVALID_SEQUENCE

prepare throws INVALID_SEQUENCE when a sequence does not parse, here because it mixes sql steps with document steps. A sequence owns tables or documents, never both: sql steps cannot be combined with document steps or with documents. A table’s version is its database’s and is recorded in a ledger; a document’s version is stored with the document, as its stamp.

Sequence
{
  id: 'theatre.app',
  migrations: [
    {
      description: 'Season passes',
      steps: [
        {
          kind: 'sql',
          sql: 'CREATE TABLE passes (member text PRIMARY KEY, amount_cents int NOT NULL)',
        },
      ],
    },
    {
      description: 'label is now text',
      steps: [
        {
          kind: 'document',
          at: 'theatre.buttons/button',
          transform: {
            $renameKeys: { from: { $ref: '$.document' }, map: { label: 'text' } },
          },
        },
      ],
    },
  ],
}
Error
INVALID_SEQUENCE
A sequence does not parse ("theatre.app").
  (root): A sequence either owns tables (sql steps) or documents (document steps and
  `documents`), not both.
Output matches the expected value

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