|
1 | 1 | 'use strict' |
2 | 2 | module.exports = { |
3 | 3 | up: function (queryInterface, Sequelize) { |
4 | | - queryInterface.addColumn('Notes', 'authorship', Sequelize.TEXT) |
5 | | - queryInterface.addColumn('Revisions', 'authorship', Sequelize.TEXT) |
6 | | - queryInterface.createTable('Authors', { |
7 | | - id: { |
8 | | - type: Sequelize.INTEGER, |
9 | | - primaryKey: true, |
10 | | - autoIncrement: true |
11 | | - }, |
12 | | - color: Sequelize.STRING, |
13 | | - noteId: Sequelize.UUID, |
14 | | - userId: Sequelize.UUID, |
15 | | - createdAt: Sequelize.DATE, |
16 | | - updatedAt: Sequelize.DATE |
| 4 | + return queryInterface.addColumn('Notes', 'authorship', Sequelize.TEXT).then(function () { |
| 5 | + return queryInterface.addColumn('Revisions', 'authorship', Sequelize.TEXT) |
| 6 | + }).then(function () { |
| 7 | + return queryInterface.createTable('Authors', { |
| 8 | + id: { |
| 9 | + type: Sequelize.INTEGER, |
| 10 | + primaryKey: true, |
| 11 | + autoIncrement: true |
| 12 | + }, |
| 13 | + color: Sequelize.STRING, |
| 14 | + noteId: Sequelize.UUID, |
| 15 | + userId: Sequelize.UUID, |
| 16 | + createdAt: Sequelize.DATE, |
| 17 | + updatedAt: Sequelize.DATE |
| 18 | + }) |
17 | 19 | }) |
18 | 20 | }, |
19 | 21 |
|
20 | 22 | down: function (queryInterface, Sequelize) { |
21 | | - queryInterface.dropTable('Authors') |
22 | | - queryInterface.removeColumn('Revisions', 'authorship') |
23 | | - queryInterface.removeColumn('Notes', 'authorship') |
| 23 | + return queryInterface.dropTable('Authors').then(function () { |
| 24 | + return queryInterface.removeColumn('Revisions', 'authorship') |
| 25 | + }).then(function () { |
| 26 | + return queryInterface.removeColumn('Notes', 'authorship') |
| 27 | + }) |
24 | 28 | } |
25 | 29 | } |
0 commit comments