v1.5.0
Share code between script migrations with static local and installed npm imports. This release also adds experimental script support for more databases, explicit transaction control, SQL error recovery, and restored 32-bit release builds.
Added
- Static imports and re-exports in JS, TS and MJS migrations, including shared helpers outside the migration directory and installed npm packages compatible with Goja. Package exports, subpaths and static CommonJS dependencies are bundled.
- Embedded and in-memory module sources through the public Go API, with explicit disk dependency directories when virtual sources need installed packages.
- Per-script
export const config = { transaction: false }for native/manual transaction workflows on a dedicated connection. - Experimental JS/TS/MJS execution for TiDB, Redshift, Oracle, ClickHouse and MSSQL. Inspect verification status, aliases and transaction modes with
migrate capabilities. - Case-insensitive database aliases, including PostgreSQL
pg/pgsql/postgresql/pgxand MSSQLsqlserver/azuresql. - Runnable SQLite examples for shared helpers, package.json/npm imports and Go embedding.
Fixed
- Restore Linux and Windows x86 SQL/full builds with the upstream Oracle driver fix for 32-bit INTERVAL arithmetic overflow.
- Ignore ordinary synchronous return values from migration entrypoints.
- Allow scripts to catch sanitized driver errors and perform subsequent SQL recovery. Actual execution cancellation, overall timeout, validation and resource limits remain fatal; commit and history-write errors still fail the migration.
- Forward script SQL unchanged to drivers, including native batches and procedure definitions. Remove keyword and single-statement restrictions and the handwritten MSSQL validator. SQL files retain their existing parser.
- Return healthy nontransactional connections to the pool; discard failed/panicked invocations to clean up unfinished manual transactions.
- Upgrade Oracle to go-ora v3 for modern authentication and correct history DDL, native binding and missing result metadata handling.
Compatibility
- Default builds remain SQL-only. Full assets add
_fullbefore the optional.exesuffix; existing SQL asset filenames, SQL hashes and migration history stay compatible. - Script checksums cover entry source only. Helpers, packages and lockfiles are excluded; dependency changes do not replay applied migrations. Retain historical dependency behavior and pin package versions when migrations must remain reproducible.
- Install npm dependencies before migration execution. The tool does not install packages or provide Node.js APIs, native addons, dynamic loading or async entrypoints.
- Nontransactional scripts can leave partial changes without successful history on failure. Authors finish manual transactions and restore session state. Oracle DDL can implicitly commit; ClickHouse has no automatic transaction rollback.
- New script dialects remain experimental. TiDB container coverage uses Unistore; distributed TiKV and Azure SQL deployments remain unverified. External Oracle, Redshift and MSSQL integration checks require dedicated DSNs; skipped checks do not establish real-instance verification.
Install
Default SQL build:
bash
go install github.com/exc-works/migrate/cmd/migrate@v1.5.0Full SQL/JS/TS/MJS build:
bash
go install -tags=full github.com/exc-works/migrate/cmd/migrate@v1.5.0
migrate capabilities --output jsonPrebuilt SQL and full binaries cover Linux arm64/x64/x86, macOS arm64/amd64, and Windows arm64/x64/x86. Verify downloads against checksums.txt; migration-api.d.ts provides editor declarations. No Node.js installation is required to execute migrations.
中文指南 · English guide · Runnable examples · Full changelog · Changes since v1.4.0