dbdelta
v0.0.10
Published
Database migrations done differently.
Readme
DBDelta
Database migrations done differently.
Overview
DBDelta is inpspired heavily by migra, for an excellent description of the concept while these docs are under development please take a look there.
Installation
npm install -g dbdelta
or
yarn global add dbdelta
Usage
All DBDelta commands take an optional --database argument, which
defaults to the enironment variable DATABASE_URL.
Show the current schema
dbdelta schemaSynchronise schema
Reads a set of SQL files stored on disk and synchronises the
database. Pass --show to see the SQL changes, and --commit to keep
the synchronised changes. Also accepts --base <path> to specify
where to find the SQL schema files (defaults to the current
directory).
dbdelta schema --show --commit --base ./dbMake migrations
Creates a new migration file to carry out the necessary changes to
synchonise the database. Accepts the same argumets as sync, with the
addtion of --migrations <path> which specifies where to place the
new migraiton.
dbdelta make --show --commit --base ./db --migrations ./db/migrationsMigrate database
Migrates the current database using made migrations. TODO
dbdelta make --base ./db --migrations ./db/migrations