2.0.0
CHANGES:
Changed (breaking)
- The engine is no longer shipped as a separate public
migra.enginelibrary.
Its modules (runner, SQL parser, dialect, discovery, migration, connection)
are now private modules ofmigra, so code that reached intoMigra_engine.*
must use the publicMigra.*API. The CLI and theMigra.Database/
Migra.Migrator/Migra.Types/Migra.Loggingfacades are unchanged. Migra.Migrator.rollback_strategyis 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.
Linkingmigrano longer installs aLogsreporter 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 addedWriteErrorfor migration-file write failures.
Added
generatehonors the--diroption (andMigrator.generate ~migrations_dir).
Fixed
- The database lifecycle commands (
init/setup/drop/reset) accept
sqlite3:pathURLs - the documented form, and whatsqlite3://normalizes
to - which previously failed with "invalid path format". mysql://connection URLs are rewritten to themariadb://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
DELIMITERdirective 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$), PostgreSQLE'...'
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. statusandmigrate --dry-runare read-only and no longer create the
migrations-tracking table.- Conflicting
rollbackselectors (--allwith--toor--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, aCOMMIT/BEGINin 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.