diff --git a/backend/src/database/migrations/20201207222347-alter-column-queue-table-tickets.ts b/backend/src/database/migrations/20201207222347-alter-column-queue-table-tickets.ts index 5f4c398e..06a110fd 100644 --- a/backend/src/database/migrations/20201207222347-alter-column-queue-table-tickets.ts +++ b/backend/src/database/migrations/20201207222347-alter-column-queue-table-tickets.ts @@ -1,31 +1,27 @@ import { QueryInterface, DataTypes } from "sequelize"; module.exports = { - up: (queryInterface: QueryInterface) => { - return Promise.all([ - queryInterface.removeColumn("Tickets", "queue"), - queryInterface.addColumn("Tickets", "queue", { - type: DataTypes.INTEGER, - references: { model: "Queues", key: "id" }, - onUpdate: "CASCADE", - onDelete: "restrict", - defaultValue: null, - allowNull: true - }) - ]); + up: async (queryInterface: QueryInterface) => { + await queryInterface.removeColumn("Tickets", "queue"); + await queryInterface.addColumn("Tickets", "queue", { + type: DataTypes.INTEGER, + references: { model: "Queues", key: "id" }, + onUpdate: "CASCADE", + onDelete: "restrict", + defaultValue: null, + allowNull: true + }); }, - down: (queryInterface: QueryInterface) => { - return Promise.all([ - queryInterface.removeColumn("Tickets", "queue"), - queryInterface.addColumn("Tickets", "queue", { - type: DataTypes.INTEGER, - // references: { model: "ServiceQueue", key: "id" }, - // onUpdate: "CASCADE", - // onDelete: "CASCADE", - defaultValue: null, - allowNull: true - }) - ]); + down: async (queryInterface: QueryInterface) => { + await queryInterface.removeColumn("Tickets", "queue"); + await queryInterface.addColumn("Tickets", "queue", { + type: DataTypes.INTEGER, + // references: { model: "ServiceQueue", key: "id" }, + // onUpdate: "CASCADE", + // onDelete: "CASCADE", + defaultValue: null, + allowNull: true + }); } }; diff --git a/backend/src/database/migrations/20201208222701-alter-column-queue-table-tickets.ts b/backend/src/database/migrations/20201208222701-alter-column-queue-table-tickets.ts index 9281d3cc..bf2f5548 100644 --- a/backend/src/database/migrations/20201208222701-alter-column-queue-table-tickets.ts +++ b/backend/src/database/migrations/20201208222701-alter-column-queue-table-tickets.ts @@ -1,31 +1,27 @@ import { QueryInterface, DataTypes } from "sequelize"; module.exports = { - up: (queryInterface: QueryInterface) => { - return Promise.all([ - queryInterface.removeColumn("Tickets", "queue"), - queryInterface.addColumn("Tickets", "queueId", { - type: DataTypes.INTEGER, - references: { model: "Queues", key: "id" }, - onUpdate: "CASCADE", - onDelete: "restrict", - defaultValue: null, - allowNull: true - }) - ]); + up: async (queryInterface: QueryInterface) => { + await queryInterface.removeColumn("Tickets", "queue"); + await queryInterface.addColumn("Tickets", "queueId", { + type: DataTypes.INTEGER, + references: { model: "Queues", key: "id" }, + onUpdate: "CASCADE", + onDelete: "restrict", + defaultValue: null, + allowNull: true + }); }, - down: (queryInterface: QueryInterface) => { - return Promise.all([ - queryInterface.removeColumn("Tickets", "queueId"), - queryInterface.addColumn("Tickets", "queue", { - type: DataTypes.INTEGER, - // references: { model: "ServiceQueue", key: "id" }, - // onUpdate: "CASCADE", - // onDelete: "CASCADE", - defaultValue: null, - allowNull: true - }) - ]); + down: async (queryInterface: QueryInterface) => { + await queryInterface.removeColumn("Tickets", "queueId"); + await queryInterface.addColumn("Tickets", "queue", { + type: DataTypes.INTEGER, + // references: { model: "ServiceQueue", key: "id" }, + // onUpdate: "CASCADE", + // onDelete: "CASCADE", + defaultValue: null, + allowNull: true + }); } };