testing 101

Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
2026-06-30 19:31:45 +08:00
parent 89acdfc239
commit 1372f4e975
62 changed files with 6696 additions and 281 deletions
@@ -0,0 +1,34 @@
'use strict';
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.createTable('plan_prices', {
price_id: { type: Sequelize.BIGINT, primaryKey: true, autoIncrement: true },
plan_id: {
type: Sequelize.BIGINT,
allowNull: false,
references: { model: 'tier_plans', key: 'plan_id' },
onUpdate: 'CASCADE',
onDelete: 'CASCADE',
},
currency: { type: Sequelize.CHAR(3), allowNull: false },
price: { type: Sequelize.DECIMAL(10, 2), allowNull: false },
createdAt: { type: Sequelize.DATE, allowNull: false },
updatedAt: { type: Sequelize.DATE, allowNull: false },
});
await queryInterface.addConstraint('plan_prices', {
fields: ['plan_id', 'currency'],
type: 'unique',
name: 'uq_plan_prices_plan_currency',
});
await queryInterface.addIndex('plan_prices', ['plan_id'], {
name: 'idx_plan_prices_plan_id',
});
},
async down(queryInterface) {
await queryInterface.dropTable('plan_prices');
},
};