Skip to content

Commit

Permalink
moved migration specs to buster
Browse files Browse the repository at this point in the history
  • Loading branch information
sdepold committed Dec 12, 2012
1 parent 5f5b8e0 commit 4b57038
Show file tree
Hide file tree
Showing 23 changed files with 404 additions and 335 deletions.
14 changes: 14 additions & 0 deletions .watchr.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
var watchr = require('watchr')
, spawn = require('child_process').spawn

watchr.watch({
path: __dirname,
listener: function(eventName, filePath) {
if (['new', 'change'].indexOf(eventName) > -1) {
var buster = spawn('./node_modules/.bin/buster-test', ['--reporter', 'specification'], { env: process.ENV })

buster.stderr.on('data', function(data) { console.log(data.toString()) })
buster.stdout.on('data', function(data) { console.log(data.toString()) })
}
}
})
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
"sqlite3": "~2.1.5",
"pg": "~0.8.7",
"buster": "~0.6.0",
"dox-foundation": "~0.3.0"
"dox-foundation": "~0.3.0",
"watchr": "~2.1.6"
},
"keywords": [
"mysql",
Expand Down
313 changes: 0 additions & 313 deletions spec-jasmine/migrator.spec.js

This file was deleted.

15 changes: 15 additions & 0 deletions spec/assets/migrations/20111117063700-createPerson.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module.exports = {
up: function(migration, DataTypes) {
migration.createTable('Person', {
name: DataTypes.STRING,
isBetaMember: {
type: DataTypes.BOOLEAN,
defaultValue: false,
allowNull: false
}
})
},
down: function(migration) {
migration.dropTable('Person')
}
}
4 changes: 4 additions & 0 deletions spec/assets/migrations/20111130161100-emptyMigration.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
up: function() {},
down: function() {}
}
9 changes: 9 additions & 0 deletions spec/assets/migrations/20111205064000-renamePersonToUser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
up: function(migration, DataTypes) {
migration.renameTable('Person', 'User')
},

down: function(migration, DataTypes) {
migration.renameTable('User', 'Person')
}
}
13 changes: 13 additions & 0 deletions spec/assets/migrations/20111205162700-addSignatureColumnToUser.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
up: function(migration, DataTypes) {
migration.addColumn('User', 'signature', DataTypes.TEXT)
migration.addColumn('User', 'shopId', { type: DataTypes.INTEGER, allowNull: true })
migration.addColumn('User', 'isAdmin', { type: DataTypes.BOOLEAN, defaultValue: false, allowNull: false })
},

down: function(migration, DataTypes) {
migration.removeColumn('User', 'signature')
migration.removeColumn('User', 'shopId')
migration.removeColumn('User', 'isAdmin')
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
up: function(migration, DataTypes) {
migration.removeColumn('User', 'shopId')
},

down: function(migration, DataTypes) {
migration.addColumn('User', 'shopId', { type: DataTypes.INTEGER, allowNull: true })
}
}
Loading

0 comments on commit 4b57038

Please sign in to comment.