Skip to content

2.0.0

Choose a tag to compare

@dsincl12 dsincl12 released this 11 Jun 21:12
· 24 commits to master since this release

CHANGES:

Changed (breaking)

  • The engine is no longer shipped as a separate public migra.engine library.
    Its modules (runner, SQL parser, dialect, discovery, migration, connection)
    are now private modules of migra, so code that reached into Migra_engine.*
    must use the public Migra.* API. The CLI and the Migra.Database /
    Migra.Migrator / Migra.Types / Migra.Logging facades are unchanged.
  • Migra.Migrator.rollback_strategy is its own type rather than an alias of the
    engine's strategy type.
  • Logging is no longer configured as a side effect of loading the library.
    Linking migra no longer installs a Logs reporter or sets the level; call
    Migra.Logging.setup () to opt in (the CLI does this at startup).
  • Removed the unused error variants FileNotFound, DatabaseNotFound, and
    TransactionFailed, and added WriteError for migration-file write failures.

Added

  • generate honors the --dir option (and Migrator.generate ~migrations_dir).

Fixed

  • The database lifecycle commands (init/setup/drop/reset) accept
    sqlite3:path URLs - the documented form, and what sqlite3:// normalizes
    to - which previously failed with "invalid path format".
  • mysql:// connection URLs are rewritten to the mariadb:// scheme the Caqti
    driver registers, so they connect instead of reporting a missing driver.
  • A connection failure that merely mentions "not found" (a missing host, role,
    or database) is no longer misreported as a missing database driver.
  • Migration version stamps are generated in UTC, so they no longer depend on the
    developer's timezone or DST.
  • The DELIMITER directive is honored only for MySQL/MariaDB, so SQL beginning
    with the word "delimiter" is not misparsed on other dialects.
  • The SQL splitter handles digit-led dollar tags ($1$), PostgreSQL E'...'
    escape strings, and backslash escapes inside MySQL double-quoted strings.
  • Each migration file is read once when applied, so the recorded checksum always
    matches the SQL that ran.
  • status and migrate --dry-run are read-only and no longer create the
    migrations-tracking table.
  • Conflicting rollback selectors (--all with --to or --step) are
    rejected instead of silently ignored.
  • A migration-file write failure is reported as a write error (no longer a read
    error) and no longer leaks the file descriptor.
  • Removed a doubled blank line from applied/rolled-back migration output.

Known limitations

  • Migration atomicity has per-dialect limits: MySQL/MariaDB DDL implicitly
    commits, a COMMIT/BEGIN in a migration's own SQL ends Migra's wrapping
    transaction early, and on PostgreSQL a statement that returns rows (e.g.
    SELECT setval(...)) is rejected. See the Transactions notes in the README.