package migra
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
A database migration tool for OCaml supporting PostgreSQL, MariaDB, and SQLite
Install
dune-project
Dependency
Authors
Maintainers
Sources
migra-1.0.0.tbz
sha256=08ceb8f21f00227f21209484ef1eb8cc326ed26a280747798ec5b0b7c5fdd678
sha512=70050833623ba7801a0a31b1700f5473903335c8db2cdf4de5bbd1876180ec0a93907444b42f7a39b6af454303e0ee5f4c3543ca51378d6324583a26b93f535c
doc/CHANGELOG.html
Changelog
All notable changes to this project are documented here. The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.0.0
First stable release.
Added
- Checksums & validation - each applied migration's file checksum is recorded;
migraterefuses to run if an already-applied migration was modified (ChecksumMismatch) or its file went missing (AppliedFileMissing). - Out-of-order detection - adding a migration older than the latest applied one is rejected (
OutOfOrder). - Configurable migrations table via
--table/Migrator.make ~table. redocommand andMigrator.redo- roll back the last migration(s) and re-apply.--dry-runformigrateandrollback- preview without changing the database.--database-urlflag - overrides theDATABASE_URLenvironment variable.- Library facade -
Migra.Migrator(run/run_or_error/rollback/redo/status/generate, with?on_eventprogress callbacks) andMigra.Database(lifecycle + URL helpers) form the public API; the implementation lives in the internalmigra.enginelibrary. Migra.Migrator.run_or_error- a fail-fast wrapper aroundrunfor the migrate-on-startup path: a migration whose SQL fails is returned asError(MigrationError (ExecutionFailed ...)) rather thanOkwithfailure_count > 0.- Arbitrary SQL support: dollar-quoted bodies,
DELIMITERfor MySQL/MariaDB routines, line/block comments, and literal$/?in statements.
Changed
- Credentials are masked (
*****) instatusoutput and never printed in clear. - Stricter migration filenames: exactly 14 digits then
_<description>.sql; malformed migration-shaped files are reported instead of silently skipped. Migrator.run/rollbackreturnErroronly when migrations could not run; per-migration SQL failures surface asOkwithfailure_count > 0(seeMigrator.succeeded).
Fixed
- Connections are always closed (no leak), even on error paths.
- The admin connection URL preserves passwords, query parameters, and IPv6 hosts.
- Duplicate migration versions are detected and rejected.
Known limitations
- On MySQL/MariaDB, DDL statements implicitly commit and cannot be rolled back, so a multi-statement DDL migration is not atomic there. Keep MySQL/MariaDB migrations to a single DDL change each. (PostgreSQL and SQLite are fully transactional, including DDL.)
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page