postgrator
Advanced tools
Changelog
8.0.0
glob
to latest dependency, which technically only supports Node v20 or later
. Which technically, makes this a breaking change?Changelog
7.3.0
Support sqlite3
and better-sqlite3
migrations with ;
in statements.
Add execSqlScript
option to execute migrations consisting of multiple statements. If not supplied, Postgrator will fallback to using execQuery
.
Changelog
7.1.1
Changelog
7.0.0
getDatabaseVersion
returns 0 when schema version table does not exist instead of undefined
. This is technically breaking if you rely on the undefined
returned in version 5.0.1.Changelog
6.0.0
Postgrator is now an ES module and requires Node 14 or later. .cjs
and .mjs
migration files are now supported.
No other changes have been made.
Changelog
5.0.1
getDatabaseVersion
error when schemaversion table does not exist. undefined
is returned instead.Changelog
5.0.0
Version 5 represents an effort to simplify things, allow more flexibility, and reduce the maintenance of this package.
This is made possible by requiring the database query execution function be injected to postgrator. Postgrator no longer manages the database connection, and as a result no longer needs to maintain a mapping to specific database driver implementations.
Despite all the breaking changes below, nothing has changed in the overall migration file approach. Migrations that worked for previous versions of postgrator will still work in v5.
See examples/
directory for quick overview of how v5 is used.
host
, port
, username
, password
, ssl
, options
. Manage connections with execQuery
instead.mysql2
unsupported. (You can still use the mysql2
package for your execQuery
implementation, but set driver to mysql
)migrationDirectory
option. Use migrationPattern
instead. In most cases it will be path/to/migrations/*
. Any glob syntax supported.GO
keyword splitting for mssql
. Using GO
could leave your system in a partially migrated state on failure and is not recommended.Changelog
4.3.1
currentSchema
config. It'll stay for v5.