Tidy / fix migrations - MUST return a promise

This commit is contained in:
Tom Moor
2017-11-19 16:49:51 -08:00
parent 336f43cc6d
commit 1f859f01e3
30 changed files with 192 additions and 227 deletions

View File

@@ -1,6 +1,6 @@
module.exports = {
up: function(queryInterface, Sequelize) {
queryInterface.createTable('apiKeys', {
up: async (queryInterface, Sequelize) => {
await queryInterface.createTable('apiKeys', {
id: {
type: 'UUID',
allowNull: false,
@@ -17,11 +17,7 @@ module.exports = {
},
userId: {
type: 'UUID',
allowNull: true,
// references: {
// model: 'users',
// key: 'id',
// },
allowNull: true
},
createdAt: {
type: 'TIMESTAMP WITH TIME ZONE',
@@ -38,7 +34,7 @@ module.exports = {
});
},
down: function(queryInterface, Sequelize) {
queryInterface.dropTable('apiKeys');
down: async (queryInterface, Sequelize) => {
await queryInterface.dropTable('apiKeys');
},
};