Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
bass-migrations
Advanced tools
Migration library for Conga.js + Bass.js , built on top of DB-MIGRATE
Add the bass-migration dependency in package.json.
"dependencies":{
"bass-migrations":"*"
}
Make sure all the dependencies are installed:
$ npm install
The following configuration options are available to you in, bass.migrations.connection and bass.migrations.directory. Put this in app/config/config.yml
# configuration for Bass.js
bass:
# connections
connections:
mysql.default:
...
...
# configuration for bass-migrations
migrations:
# the connection name to use, under bass.connections
connection: mysql.default
# the path to generate and read migrations
directory: %kernel.project_path%/_resources/migrations
$ conga bass:migrations:generate <name-of-migration>
$ conga bass:migrations:migrate
$ conga bass:migrations:execute <name-of-migration> --up
$ conga bass:migrations:execute <name-of-migration> --down
Here are some usage examples for implementing migrations:
var Migration = require('bass-migrations').Migration;
module.exports = Migration;
Migration.singleton()
.verbose(true)
.up('alter table my_table modify column name varchar(100) null')
.down('alter table my_table modify column name varchar(100) not null');
var Migration = require('bass-migrations').Migration;
module.exports = Migration;
Migration.singleton()
.up('insert into my_table (name) values (?)', ["my name"])
.down('delete from my_table where name = ?', ["my name"]);
var Migration = require('bass-migrations').Migration;
module.exports = Migration;
Migration.singleton()
.up('alter table my_table modify column name varchar(100) null')
.up('alter table other_table add column status int(32) not null')
.finishUp(function(db, callback)
{
console.log('The UP queries have finished!');
callback();
})
.down('alter table my_table modify column name varchar(100) not null')
.down('alter table other_table drop column status')
.finishDown(function(db, callback)
{
console.log('The DOWN queries have finished!');
callback();
});
var Migration = require('bass-migrations').Migration;
module.exports = Migration;
Migration.singleton()
.up('alter table my_table modify column name varchar(100) null', null, function(callback)
{
console.log('The first UP query has finished');
callback();
})
.up('alter table other_table add column status int(32) not null')
.down('alter table my_table modify column name varchar(100) not null')
.down('alter table other_table drop column status');
Container migrations will boot the CongaJS kernel and expose the app's service container in your migration. See below for an example:
var Migration = require('bass-migrations').ContainerMigration;
module.exports = Migration;
Migration.singleton()
.up('alter table my_table add column foo varchar(100) null')
.finishUp(function(db, cb) {
var container = Migration.singleton().getContainer();
var param = container.get('some.param');
// etc...
});
FAQs
Migration library for BASS
The npm package bass-migrations receives a total of 11 weekly downloads. As such, bass-migrations popularity was classified as not popular.
We found that bass-migrations demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.