smp

sequelize-migration-pg-extras

Add db:create and db:drop scripts to your project

Showing:

Popularity

Downloads/wk

4

GitHub Stars

6

Maintenance

Last Commit

7yrs ago

Contributors

0

Package

Dependencies

1

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

sequelize-migration-pg-extras

Easily add npm run db:create and npm run db:drop to your Sequelize project using Postgres.

Usage

$ npm install sequelize-migration-pg-extras

Then add the following to the scripts section in package.json:

{
  "scripts": {
    "db:create": "node_modules/.bin/create_database",
    "db:drop": "node_modules/.bin/drop_database"
  }
}

Configuration

If a .sequelizerc file is found, it will attempt the config location from there. Otherwise it will use config/config.json.

Test

Only manual tests available because life's too short sometimes.

You must have Postgres running beforehand.

To test using default location: cd test/default

To test using .sequelizerc: cd test/sequelizerc

create_database

$ ../../lib/create_database.js

Scenarios:

Database doesn't exist:

> Using NODE_ENV=development
> Using configuration in /Users/cesarandreu/Developer/sequelize-migration-pg-extras/test/default/config/config.json
> Database sequelize_migration_pg_extras_development created

Database exists:

> Using NODE_ENV=development
> Using configuration in /Users/cesarandreu/Developer/sequelize-migration-pg-extras/test/default/config/config.json
> Database sequelize_migration_pg_extras_development already exists

drop_database

$ ../../lib/drop_database.js

Scenarios:

Database exists:

> Using NODE_ENV=development
> Using configuration in /Users/cesarandreu/Developer/sequelize-migration-pg-extras/test/default/config/config.json
> Database sequelize_migration_pg_extras_development dropped

Database doesn't exist:

> Using NODE_ENV=development
> Using configuration in /Users/cesarandreu/Developer/sequelize-migration-pg-extras/test/default/config/config.json
> Database sequelize_migration_pg_extras_development doesn't exist

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100