Skip to content

v2.0.1

Latest

Choose a tag to compare

@github-actions github-actions released this 27 Sep 00:10
· 3 commits to main since this release

Changed

  • A -- @migrate backfill declaration left in schema.sql after its step is applied is now
    an error (diff exits 1 and the UPDATE is not printed) when nothing else about its table
    changes. Before, the UPDATE was silently printed again, and applying it overwrote data the
    application had written since. A backfill in a step that does change the table — a new
    column, a new CHECK / UNIQUE / foreign key on existing rows — is emitted as before.
  • mysql.Verify no longer fails on a sql_mode name MySQL 8.4 does not define (a server of
    another version or lineage runs with some): it compares the modes it knows and, on a
    mismatch, says which names it left out.

Fixed

  • On MySQL, sqlshape apply runs the DDL under the sql_mode the schema declares (the 8.4
    default when it declares none), the same setting the plan was verified under. Before, the
    DDL ran under the server's global mode, so the pre-check and the real run could disagree.
  • On MySQL, a backfill of an existing column is printed before the keys, CHECK constraints
    and foreign keys the step adds, so apply no longer fails on rows the backfill was meant
    to fix.

Documentation

  • The README leads with what a reader needs to decide: what is checked, the supported
    versions, that checking needs no database, and how sqlshape differs from generators and
    ORMs. A Limitations section states what is out of scope, including that a server of an
    undeclared version still runs but its divergences are not guaranteed to be caught.
  • The MySQL error catalog moved to docs/mysql-errors.md with an
    index by error number; docs/mysql.md now leads with the type table, the
    DSN requirements and the runtime. docs/migrations.md starts with the
    prerequisites and gained a section on running migrations across several environments.