시드 생성

This commit is contained in:
2025-04-24 12:01:51 +09:00
parent beac42d60c
commit 7fa99e6988
42 changed files with 938 additions and 1170 deletions
@@ -0,0 +1,22 @@
module.exports = {
up: async (queryInterface, Sequelize) => {
// 샘플 클럽 5개 생성 (ownerId는 1~5)
const clubs = [];
for (let i = 1; i <= 5; i++) {
clubs.push({
name: `샘플 볼링 클럽 ${i}`,
description: `샘플 볼링 클럽 ${i} 설명입니다.`,
location: `도시${i}${i}`,
ownerId: i+1,
status: 'active',
memberCount: 10,
createdAt: new Date(),
updatedAt: new Date()
});
}
await queryInterface.bulkInsert('Clubs', clubs, {});
},
down: async (queryInterface, Sequelize) => {
await queryInterface.bulkDelete('Clubs', { name: { [Sequelize.Op.like]: '샘플 볼링 클럽 %' } }, {});
}
};