UNPKG

@grouparoo/core

Version:
58 lines (48 loc) 1.22 kB
import Sequelize from "sequelize"; export default { up: async ( queryInterface: Sequelize.QueryInterface, DataTypes: typeof Sequelize ) => { await queryInterface.createTable("profileProperties", { guid: { type: DataTypes.STRING(40), primaryKey: true, }, createdAt: { type: DataTypes.DATE, allowNull: false, }, updatedAt: { type: DataTypes.DATE, allowNull: false, }, profileGuid: { type: DataTypes.STRING(40), allowNull: false, }, rawValue: { type: DataTypes.TEXT, allowNull: true, }, profilePropertyRuleGuid: { type: DataTypes.STRING(40), allowNull: false, }, }); await queryInterface.addIndex( "profileProperties", ["profileGuid", "profilePropertyRuleGuid"], { unique: true, fields: ["profileGuid", "profilePropertyRuleGuid"], } ); await queryInterface.addIndex("profileProperties", ["profileGuid"], { fields: ["profileGuid"], }); }, down: async (queryInterface: Sequelize.QueryInterface) => { await queryInterface.dropTable("profileProperties"); }, };