UNPKG

@grouparoo/core

Version:
49 lines (41 loc) 996 B
import Sequelize from "sequelize"; export default { up: async ( queryInterface: Sequelize.QueryInterface, DataTypes: typeof Sequelize ) => { await queryInterface.createTable("destinationGroups", { guid: { type: DataTypes.STRING(40), primaryKey: true, }, createdAt: { type: DataTypes.DATE, allowNull: false, }, updatedAt: { type: DataTypes.DATE, allowNull: false, }, destinationGuid: { type: DataTypes.STRING(40), allowNull: false, }, groupGuid: { type: DataTypes.STRING(40), allowNull: false, }, }); await queryInterface.addIndex( "destinationGroups", ["destinationGuid", "groupGuid"], { unique: true, fields: ["destinationGuid", "groupGuid"], } ); }, down: async (queryInterface: Sequelize.QueryInterface) => { await queryInterface.dropTable("destinationGroups"); }, };