@grouparoo/core
Version:
The Grouparoo Core
37 lines (36 loc) • 1.6 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = {
up: async (queryInterface, DataTypes) => {
await queryInterface.addColumn("profileProperties", "position", {
type: DataTypes.BIGINT,
allowNull: false,
defaultValue: 0,
});
await queryInterface.addColumn("profilePropertyRules", "isArray", {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: false,
});
await queryInterface.removeIndex("profileProperties", ["profileGuid", "profilePropertyRuleGuid"], {
unique: true,
fields: ["profileGuid", "profilePropertyRuleGuid"],
});
await queryInterface.addIndex("profileProperties", ["profileGuid", "profilePropertyRuleGuid", "position"], {
unique: true,
fields: ["profileGuid", "profilePropertyRuleGuid", "position"],
});
},
down: async (queryInterface) => {
await queryInterface.removeColumn("profileProperties", "position");
await queryInterface.removeColumn("profilePropertyRules", "isArray");
await queryInterface.removeIndex("profileProperties", ["profileGuid", "profilePropertyRuleGuid", "position"], {
unique: true,
fields: ["profileGuid", "profilePropertyRuleGuid", "position"],
});
await queryInterface.addIndex("profileProperties", ["profileGuid", "profilePropertyRuleGuid"], {
unique: true,
fields: ["profileGuid", "profilePropertyRuleGuid"],
});
},
};