25 lines
887 B
JavaScript
25 lines
887 B
JavaScript
module.exports = {
|
|
up: async (queryInterface, Sequelize) => {
|
|
// 각 클럽 5개에 대해 2개의 구독(플랜 1, 2)을 연결
|
|
const clubSubscriptions = [];
|
|
for (let clubId = 1; clubId <= 5; clubId++) {
|
|
const planId = Math.floor(Math.random() * 2) + 1; // 랜덤으로 플랜 1, 2 중 하나 선택
|
|
const startDate = new Date(2025, 4, 1 + clubId);
|
|
const endDate = new Date(startDate.getFullYear(), startDate.getMonth()+1, startDate.getDate());
|
|
clubSubscriptions.push({
|
|
clubId,
|
|
planId,
|
|
startDate,
|
|
endDate,
|
|
status: 'active',
|
|
createdAt: new Date(),
|
|
updatedAt: new Date()
|
|
});
|
|
}
|
|
await queryInterface.bulkInsert('ClubSubscriptions', clubSubscriptions, {});
|
|
},
|
|
down: async (queryInterface, Sequelize) => {
|
|
await queryInterface.bulkDelete('ClubSubscriptions', { }, {});
|
|
}
|
|
};
|