Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ sequelize db:migrate
- Sequelize [Node: 0.10.33, CLI: 1.3.0, ORM: 2.0.3, sqlite3: ^3.0.5]
- Loaded configuration file 'config\config.json'.
- Using environment 'development'.
- Note: When passing a callback to a transaction a promise chain is expected in return, the transaction will be committed or rejected based on the promise chain returned to the callback.
- Possibly unhandled Error: ,[object Statement]
- at Promise._rejectUncheckedCheckError (C:\MinGW\msys\1.0\home\user\src\app\node_modules\sequelize\node_modules\bluebird\js\main\promise.js:815:68)
- at Promise._settlePromiseAt (C:\MinGW\msys\1.0\home\user\src\app\node_modules\sequelize-cli\node_modules\bluebird\js\main\promise.js:528:21)
- at Promise._settlePromises (C:\MinGW\msys\1.0\home\user\src\app\node_modules\sequelize-cli\node_modules\bluebird\js\main\promise.js:646:14)
- at Async._drainQueue (C:\MinGW\msys\1.0\home\user\src\app\node_modules\sequelize-cli\node_modules\bluebird\js\main\async.js:79:16)
- at Async._drainQueues (C:\MinGW\msys\1.0\home\user\src\app\node_modules\sequelize-cli\node_modules\bluebird\js\main\async.js:89:10)
- at Async.drainQueues (C:\MinGW\msys\1.0\home\user\src\app\node_modules\sequelize-cli\node_modules\bluebird\js\main\async.js:14:14)
- at process._tickCallback (node.js:419:13)
- migration file:
- module.exports = {
- up: function(migration, DataTypes, done) {
- var sequelize = migration.sequelize;
- sequelize.transaction(function (t) {
- return sequelize.Promise.all([
- sequelize.query(
- 'CREATE TABLE Bars (baz INTEGER)',
- {transaction: t}
- )
- ]);
- }).then(done);
- },
- down: function(migration, DataTypes, done) {
- done();
- }
- };
- Result:
- sqlite> .schema Bars
- CREATE TABLE Bars (baz INTEGER);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement