sequelize-migration-mssql-extras v1.1.1
Original code!
This is a fork of sequelize-migration-mssql-extras to get the same scripts for MSSQL.
sequelize-migration-mssql-extras
Easily add npm run db:create and npm run db:drop to your Sequelize project using MSSQL.
Usage
$ npm install sequelize-migration-mssql-extrasThen add the following to the scripts section in package.json:
{
"scripts": {
"db:create": "create_database",
"db:drop": "drop_database"
}
}Configuration
If a .sequelizerc file is found, it will attempt the config location from there.
Otherwise it will use config/config.json or config/config.js depending on which exists.
Test
TESTS ADDED!
You must have MSSQL running beforehand on a default instance (or remap port 1433 to your instance).
npm run testThis runs tests that load configuration and tries to create and drop a database. It doesn't assert much yet because life's too short sometimes.
create_database
$ ../../lib/create_database.jsScenarios:
Database doesn't exist:
> Using NODE_ENV=development
> Using configuration in /Users/cesarandreu/Developer/sequelize-migration-mssql-extras/test/default/config/config.json
> Database sequelize_migration_mssql_extras_development createdDatabase exists:
> Using NODE_ENV=development
> Using configuration in /Users/cesarandreu/Developer/sequelize-migration-mssql-extras/test/default/config/config.json
> Database sequelize_migration_mssql_extras_development already existsdrop_database
$ ../../lib/drop_database.jsScenarios:
Database exists:
> Using NODE_ENV=development
> Using configuration in /Users/cesarandreu/Developer/sequelize-migration-mssql-extras/test/default/config/config.json
> Database sequelize_migration_mssql_extras_development droppedDatabase doesn't exist:
> Using NODE_ENV=development
> Using configuration in /Users/cesarandreu/Developer/sequelize-migration-mssql-extras/test/default/config/config.json
> Database sequelize_migration_mssql_extras_development doesn't exist