Last active
June 30, 2016 17:41
-
-
Save mariano-aguero/43295f51271279678d8448d0fbb52a69 to your computer and use it in GitHub Desktop.
Sequelize Migration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
var fs = require('fs'); | |
module.exports = { | |
up: function (queryInterface, Sequelize, done) { | |
return fs.readFile('./node_modules/pg-job-queue/lib/schema.sql', 'utf-8', function (err, data) { | |
return queryInterface.sequelize.query(data) | |
.then(function (response) { | |
done(); | |
}).catch(function (err) { | |
done(); | |
}); | |
}); | |
}, | |
down: function (queryInterface, Sequelize, done) { | |
/* | |
Add reverting commands here. | |
Return a promise to correctly handle asynchronicity. | |
Example: | |
return queryInterface.dropTable('users'); | |
*/ | |
return queryInterface.dropTable('JobQueue'); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment