34042/backend/src/db/seeders/20231127130745-sample-data.js
2025-09-13 09:28:32 +00:00

63 lines
1000 B
JavaScript

const db = require('../models');
const Users = db.users;
const Employees = db.employees;
const EmployeesData = [
{
first_name: 'John',
last_name: 'Doe',
email: 'john.doe@example.com',
job_title: 'Software Engineer',
},
{
first_name: 'Jane',
last_name: 'Smith',
email: 'jane.smith@example.com',
job_title: 'Product Manager',
},
{
first_name: 'Emily',
last_name: 'Johnson',
email: 'emily.johnson@example.com',
job_title: 'HR Specialist',
},
{
first_name: 'Michael',
last_name: 'Brown',
email: 'michael.brown@example.com',
job_title: 'Sales Executive',
},
];
// Similar logic for "relation_many"
module.exports = {
up: async (queryInterface, Sequelize) => {
await Employees.bulkCreate(EmployeesData);
await Promise.all([
// Similar logic for "relation_many"
]);
},
down: async (queryInterface, Sequelize) => {
await queryInterface.bulkDelete('employees', null, {});
},
};