Gathering detailed insights and metrics for sails-grunt-task-db-migrate
Gathering detailed insights and metrics for sails-grunt-task-db-migrate
Gathering detailed insights and metrics for sails-grunt-task-db-migrate
Gathering detailed insights and metrics for sails-grunt-task-db-migrate
npm install sails-grunt-task-db-migrate
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
82 Commits
1 Forks
1 Watchers
1 Branches
1 Contributors
Updated on Apr 07, 2021
Latest Version
1.0.2
Package Id
sails-grunt-task-db-migrate@1.0.2
Unpacked Size
19.44 kB
Size
6.35 kB
File Count
12
NPM Version
6.14.10
Node Version
14.15.4
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
db-migrate integration for Sails.js. This is a fairly simple wrapper,
which provides grunt tasks for running and creating migrations. It also
extracts the database configuration from the Sails config, so you don't have to
duplicate you config in a database.json
file.
Supports Sails 0.10.x+ till Sails 1.2.4.
You don't need to install the dependencies manually. Instead, the dependencies ( like db-migrate, db-migrate-mongodb, etc... ) will be installed automatically. Before install this npm, please create config/migrations.js
.
And also, this npm supports db:create, db:drop and db:seed.
Installation is very typical.
1$ npm install --save sails-grunt-task-db-migrate 2 3 4You need to setup `config/migrations.js` to name the connection which you will 5use to run migrations. 6 7```JavaScript 8// config/migrations.js 9module.exports.migrations = { 10 // connection name matches a field from config/connections.js 11 connection: 'default' // or MySQL 12};
Optionally, you can specify in the config file the name of the database table to
be used to track migrations (defaults to migrations
), the directory to use for
migrations (defaults to migrations
), and whether to create a coffeescript
file for the migrations instead of javascript file (defaults to false
).
And also, we can set seedingDir
option. If it is not yet set, the default path will be seeders
folder under root folder.
1// config/migrations.js 2module.exports.migrations = { 3 // connection name matches a field from config/connections.js 4 connection: 'somePostgresqlServer', // or MySQL 5 table: 'sails_migrations', 6 migrationsDir: 'db/migrate', 7 seedingDir: 'db/seeders', 8 coffeeFile: true 9};
You'll also need to setup tasks/register/dbMigrate.js
to add the db:migrate
tasks to grunt.
1// tasks/register/dbMigrate.js 2module.exports = require( 'sails-grunt-task-db-migrate' ).sailsGruntTasks
npm i -S sails-grunt-task-db-migrate
grunt db:migrate:create --name=create_test_schema
grunt db:migrate:up
grunt db:migrate:down --count=150
grunt db:migrate:db:create --db-name=test_db
grunt db:migrate:db:drop --db-name=test_db
1// seeders/TestTableSeeder.js or db/seeders/TestTableSeeder ( where TestTable is a model of a db table test_table ) 2module.exports = aysnc() { 3 TestTable.create( { field1: 'value', field: 'value' } ) 4}
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More