A library for managing and running database migrations. For a command-line tool, see:
- psql-migrate for PostgreSQL
- sqlite-migrate for SQLite3
This library has a few goals:
- Production-friendly: Transactional DDL by default, with per-migration overrides
- Safe: Strict validation of migration files, for gaps or conflicts with the database
- Minimal: Bring your own database driver
If you want to use libmigrate directly as a library, look at psql-migrate
or
sqlite-migrate
.
Migration files can be marked to run without a transaction with a prefix comment:
-- migrate: no-transaction