0.0.0 • Published 4 years ago
migrate-sql v0.0.0
migrate-sql
Create migrations for postgresql via postgres or sqlite3 via better-sqlite3.
Install
This is a command-line tool and node.js library. Install with npm:
npm i -D migrate-sqlUsage
Basic usage can include:
Creating the migrations directory and config file:
migrate-sql initCreating new migrations:
migrate-sql create --name tableNameThe name passed to the create command will be used as the table name in the migration file, but this can be changed in the migration file.
Running migrations:
migrate-sql migrateRolling back migrations one at a time:
migrate-sql rollbackRolling back all migrations:
migrate-sql rollback --allHelp
Show the help text with migrate-sql help:
COMMANDS
create create a new migration
migrate run migrations
rollback rollback latest migration or all migrations
help this message
OPTIONS
--config,-c relative path to config filepath. default: migrate-sql.config.js
--type,-t type of database. options: sqlite, postgresql
--migrations,-m relative path to migrations directory. default: migrations
EXAMPLES
Create a new migration file:
migrate-sql create --name post
Run migrations:
migrate-sql migrate
Rollback latest migration:
migrate-sql rollback
Rollback all migrations:
migrate-sql rollback --allLicense
0.0.0
4 years ago