create folders table

This commit is contained in:
Takeshi Kimata
2024-02-12 12:20:37 +09:00
parent 8de8d06399
commit 197a011c4c
13 changed files with 261 additions and 32 deletions

View File

@@ -2,7 +2,8 @@
module.exports = {
up: async (queryInterface, Sequelize) => {
return queryInterface.bulkInsert('Projects', [
// Add projects table records
await queryInterface.bulkInsert('Projects', [
{
name: 'Project 1',
detail: 'Details of Project 1',
@@ -11,13 +12,34 @@ module.exports = {
},
{
name: 'Project 2',
detail: 'Details of Project 2',
createdAt: new Date(),
updatedAt: new Date(),
},
{
name: 'Project 3',
detail: 'Details of Project 3',
createdAt: new Date(),
updatedAt: new Date(),
},
]);
// Add folders table records
await queryInterface.bulkInsert('folders', [
{
name: 'Folder 1',
detail: 'Details of Folder 1',
projectId: 1,
createdAt: new Date(),
updatedAt: new Date(),
},
{
name: 'Folder 2',
projectId: 1,
createdAt: new Date(),
updatedAt: new Date(),
},
{
name: 'Folder 3',
projectId: 1,
createdAt: new Date(),
updatedAt: new Date(),
},
@@ -25,6 +47,6 @@ module.exports = {
},
down: async (queryInterface, Sequelize) => {
// do nothing
// do nothingg
},
};