mirror of
https://github.com/rgrgogu/new_starr.git
synced 2026-09-27 00:12:54 +08:00
22 lines
646 B
JavaScript
22 lines
646 B
JavaScript
'use strict';
|
|
|
|
// user_tiers.tier was ENUM('free','premium','exclusive').
|
|
// Drop the check constraint so it can hold any tier_categories.slug value.
|
|
|
|
module.exports = {
|
|
async up(queryInterface) {
|
|
await queryInterface.sequelize.query(
|
|
`ALTER TABLE user_tiers DROP CONSTRAINT IF EXISTS check_tier`
|
|
);
|
|
await queryInterface.sequelize.query(
|
|
`ALTER TABLE user_tiers DROP CONSTRAINT IF EXISTS "user_tiers_tier_check"`
|
|
);
|
|
},
|
|
|
|
async down(queryInterface) {
|
|
await queryInterface.sequelize.query(
|
|
`ALTER TABLE user_tiers ADD CONSTRAINT check_tier CHECK (tier IN ('free', 'premium', 'exclusive'))`
|
|
);
|
|
},
|
|
};
|