const { v4: uuid } = require('uuid'); module.exports = { /** * @param{import("sequelize").QueryInterface} queryInterface * @return {Promise} */ async up(queryInterface) { const createdAt = new Date(); const updatedAt = new Date(); /** @type {Map} */ const idMap = new Map(); /** * @param {string} key * @return {string} */ function getId(key) { if (idMap.has(key)) { return idMap.get(key); } const id = uuid(); idMap.set(key, id); return id; } await queryInterface.bulkInsert('roles', [ { id: getId('SuperAdmin'), name: 'Super Administrator', createdAt, updatedAt, }, { id: getId('Administrator'), name: 'Administrator', createdAt, updatedAt, }, { id: getId('RecruitmentDirector'), name: 'Recruitment Director', createdAt, updatedAt, }, { id: getId('SeniorRecruiter'), name: 'Senior Recruiter', createdAt, updatedAt, }, { id: getId('RecruitmentSpecialist'), name: 'Recruitment Specialist', createdAt, updatedAt, }, { id: getId('HRCoordinator'), name: 'HR Coordinator', createdAt, updatedAt, }, { id: getId('Candidate'), name: 'Candidate', createdAt, updatedAt }, ]); /** * @param {string} name */ function createPermissions(name) { return [ { id: getId(`CREATE_${name.toUpperCase()}`), createdAt, updatedAt, name: `CREATE_${name.toUpperCase()}`, }, { id: getId(`READ_${name.toUpperCase()}`), createdAt, updatedAt, name: `READ_${name.toUpperCase()}`, }, { id: getId(`UPDATE_${name.toUpperCase()}`), createdAt, updatedAt, name: `UPDATE_${name.toUpperCase()}`, }, { id: getId(`DELETE_${name.toUpperCase()}`), createdAt, updatedAt, name: `DELETE_${name.toUpperCase()}`, }, ]; } const entities = [ 'users', 'applications', 'candidates', 'hr_managers', 'jobs', 'recruiters', 'roles', 'permissions', 'organizations', 'likes', , ]; await queryInterface.bulkInsert( 'permissions', entities.flatMap(createPermissions), ); await queryInterface.bulkInsert('permissions', [ { id: getId(`READ_API_DOCS`), createdAt, updatedAt, name: `READ_API_DOCS`, }, ]); await queryInterface.bulkInsert('permissions', [ { id: getId(`CREATE_SEARCH`), createdAt, updatedAt, name: `CREATE_SEARCH`, }, ]); await queryInterface.bulkUpdate( 'roles', { globalAccess: true }, { id: getId('SuperAdmin') }, ); await queryInterface.sequelize .query(`create table "rolesPermissionsPermissions" ( "createdAt" timestamp with time zone not null, "updatedAt" timestamp with time zone not null, "roles_permissionsId" uuid not null, "permissionId" uuid not null, primary key ("roles_permissionsId", "permissionId") );`); await queryInterface.bulkInsert('rolesPermissionsPermissions', [ { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentDirector'), permissionId: getId('CREATE_USERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentDirector'), permissionId: getId('READ_USERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentDirector'), permissionId: getId('UPDATE_USERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentDirector'), permissionId: getId('DELETE_USERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SeniorRecruiter'), permissionId: getId('CREATE_USERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SeniorRecruiter'), permissionId: getId('READ_USERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentSpecialist'), permissionId: getId('CREATE_USERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentSpecialist'), permissionId: getId('READ_USERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('HRCoordinator'), permissionId: getId('CREATE_USERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('HRCoordinator'), permissionId: getId('READ_USERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('Candidate'), permissionId: getId('CREATE_USERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('Candidate'), permissionId: getId('READ_USERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentDirector'), permissionId: getId('CREATE_APPLICATIONS'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentDirector'), permissionId: getId('READ_APPLICATIONS'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentDirector'), permissionId: getId('UPDATE_APPLICATIONS'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentDirector'), permissionId: getId('DELETE_APPLICATIONS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SeniorRecruiter'), permissionId: getId('CREATE_APPLICATIONS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SeniorRecruiter'), permissionId: getId('READ_APPLICATIONS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SeniorRecruiter'), permissionId: getId('UPDATE_APPLICATIONS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SeniorRecruiter'), permissionId: getId('DELETE_APPLICATIONS'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentSpecialist'), permissionId: getId('CREATE_APPLICATIONS'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentSpecialist'), permissionId: getId('READ_APPLICATIONS'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentSpecialist'), permissionId: getId('UPDATE_APPLICATIONS'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentSpecialist'), permissionId: getId('DELETE_APPLICATIONS'), }, { createdAt, updatedAt, roles_permissionsId: getId('HRCoordinator'), permissionId: getId('CREATE_APPLICATIONS'), }, { createdAt, updatedAt, roles_permissionsId: getId('HRCoordinator'), permissionId: getId('READ_APPLICATIONS'), }, { createdAt, updatedAt, roles_permissionsId: getId('HRCoordinator'), permissionId: getId('UPDATE_APPLICATIONS'), }, { createdAt, updatedAt, roles_permissionsId: getId('HRCoordinator'), permissionId: getId('DELETE_APPLICATIONS'), }, { createdAt, updatedAt, roles_permissionsId: getId('Candidate'), permissionId: getId('CREATE_APPLICATIONS'), }, { createdAt, updatedAt, roles_permissionsId: getId('Candidate'), permissionId: getId('READ_APPLICATIONS'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentDirector'), permissionId: getId('CREATE_CANDIDATES'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentDirector'), permissionId: getId('READ_CANDIDATES'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentDirector'), permissionId: getId('UPDATE_CANDIDATES'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentDirector'), permissionId: getId('DELETE_CANDIDATES'), }, { createdAt, updatedAt, roles_permissionsId: getId('SeniorRecruiter'), permissionId: getId('CREATE_CANDIDATES'), }, { createdAt, updatedAt, roles_permissionsId: getId('SeniorRecruiter'), permissionId: getId('READ_CANDIDATES'), }, { createdAt, updatedAt, roles_permissionsId: getId('SeniorRecruiter'), permissionId: getId('UPDATE_CANDIDATES'), }, { createdAt, updatedAt, roles_permissionsId: getId('SeniorRecruiter'), permissionId: getId('DELETE_CANDIDATES'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentSpecialist'), permissionId: getId('CREATE_CANDIDATES'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentSpecialist'), permissionId: getId('READ_CANDIDATES'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentSpecialist'), permissionId: getId('UPDATE_CANDIDATES'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentSpecialist'), permissionId: getId('DELETE_CANDIDATES'), }, { createdAt, updatedAt, roles_permissionsId: getId('HRCoordinator'), permissionId: getId('CREATE_CANDIDATES'), }, { createdAt, updatedAt, roles_permissionsId: getId('HRCoordinator'), permissionId: getId('READ_CANDIDATES'), }, { createdAt, updatedAt, roles_permissionsId: getId('Candidate'), permissionId: getId('CREATE_CANDIDATES'), }, { createdAt, updatedAt, roles_permissionsId: getId('Candidate'), permissionId: getId('READ_CANDIDATES'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentDirector'), permissionId: getId('CREATE_HR_MANAGERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentDirector'), permissionId: getId('READ_HR_MANAGERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentDirector'), permissionId: getId('UPDATE_HR_MANAGERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentDirector'), permissionId: getId('DELETE_HR_MANAGERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SeniorRecruiter'), permissionId: getId('CREATE_HR_MANAGERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SeniorRecruiter'), permissionId: getId('READ_HR_MANAGERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentSpecialist'), permissionId: getId('CREATE_HR_MANAGERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentSpecialist'), permissionId: getId('READ_HR_MANAGERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('HRCoordinator'), permissionId: getId('CREATE_HR_MANAGERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('HRCoordinator'), permissionId: getId('READ_HR_MANAGERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('HRCoordinator'), permissionId: getId('UPDATE_HR_MANAGERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('HRCoordinator'), permissionId: getId('DELETE_HR_MANAGERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentDirector'), permissionId: getId('CREATE_JOBS'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentDirector'), permissionId: getId('READ_JOBS'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentDirector'), permissionId: getId('UPDATE_JOBS'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentDirector'), permissionId: getId('DELETE_JOBS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SeniorRecruiter'), permissionId: getId('CREATE_JOBS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SeniorRecruiter'), permissionId: getId('READ_JOBS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SeniorRecruiter'), permissionId: getId('UPDATE_JOBS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SeniorRecruiter'), permissionId: getId('DELETE_JOBS'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentSpecialist'), permissionId: getId('CREATE_JOBS'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentSpecialist'), permissionId: getId('READ_JOBS'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentSpecialist'), permissionId: getId('UPDATE_JOBS'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentSpecialist'), permissionId: getId('DELETE_JOBS'), }, { createdAt, updatedAt, roles_permissionsId: getId('HRCoordinator'), permissionId: getId('CREATE_JOBS'), }, { createdAt, updatedAt, roles_permissionsId: getId('HRCoordinator'), permissionId: getId('READ_JOBS'), }, { createdAt, updatedAt, roles_permissionsId: getId('Candidate'), permissionId: getId('CREATE_JOBS'), }, { createdAt, updatedAt, roles_permissionsId: getId('Candidate'), permissionId: getId('READ_JOBS'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentDirector'), permissionId: getId('CREATE_RECRUITERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentDirector'), permissionId: getId('READ_RECRUITERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentDirector'), permissionId: getId('UPDATE_RECRUITERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentDirector'), permissionId: getId('DELETE_RECRUITERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SeniorRecruiter'), permissionId: getId('CREATE_RECRUITERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SeniorRecruiter'), permissionId: getId('READ_RECRUITERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SeniorRecruiter'), permissionId: getId('UPDATE_RECRUITERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SeniorRecruiter'), permissionId: getId('DELETE_RECRUITERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentSpecialist'), permissionId: getId('CREATE_RECRUITERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentSpecialist'), permissionId: getId('READ_RECRUITERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('HRCoordinator'), permissionId: getId('CREATE_RECRUITERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('HRCoordinator'), permissionId: getId('READ_RECRUITERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentDirector'), permissionId: getId('CREATE_SEARCH'), }, { createdAt, updatedAt, roles_permissionsId: getId('SeniorRecruiter'), permissionId: getId('CREATE_SEARCH'), }, { createdAt, updatedAt, roles_permissionsId: getId('RecruitmentSpecialist'), permissionId: getId('CREATE_SEARCH'), }, { createdAt, updatedAt, roles_permissionsId: getId('HRCoordinator'), permissionId: getId('CREATE_SEARCH'), }, { createdAt, updatedAt, roles_permissionsId: getId('Candidate'), permissionId: getId('CREATE_SEARCH'), }, { createdAt, updatedAt, roles_permissionsId: getId('Administrator'), permissionId: getId('CREATE_USERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('Administrator'), permissionId: getId('READ_USERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('Administrator'), permissionId: getId('UPDATE_USERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('Administrator'), permissionId: getId('DELETE_USERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('Administrator'), permissionId: getId('CREATE_APPLICATIONS'), }, { createdAt, updatedAt, roles_permissionsId: getId('Administrator'), permissionId: getId('READ_APPLICATIONS'), }, { createdAt, updatedAt, roles_permissionsId: getId('Administrator'), permissionId: getId('UPDATE_APPLICATIONS'), }, { createdAt, updatedAt, roles_permissionsId: getId('Administrator'), permissionId: getId('DELETE_APPLICATIONS'), }, { createdAt, updatedAt, roles_permissionsId: getId('Administrator'), permissionId: getId('CREATE_CANDIDATES'), }, { createdAt, updatedAt, roles_permissionsId: getId('Administrator'), permissionId: getId('READ_CANDIDATES'), }, { createdAt, updatedAt, roles_permissionsId: getId('Administrator'), permissionId: getId('UPDATE_CANDIDATES'), }, { createdAt, updatedAt, roles_permissionsId: getId('Administrator'), permissionId: getId('DELETE_CANDIDATES'), }, { createdAt, updatedAt, roles_permissionsId: getId('Administrator'), permissionId: getId('CREATE_HR_MANAGERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('Administrator'), permissionId: getId('READ_HR_MANAGERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('Administrator'), permissionId: getId('UPDATE_HR_MANAGERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('Administrator'), permissionId: getId('DELETE_HR_MANAGERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('Administrator'), permissionId: getId('CREATE_JOBS'), }, { createdAt, updatedAt, roles_permissionsId: getId('Administrator'), permissionId: getId('READ_JOBS'), }, { createdAt, updatedAt, roles_permissionsId: getId('Administrator'), permissionId: getId('UPDATE_JOBS'), }, { createdAt, updatedAt, roles_permissionsId: getId('Administrator'), permissionId: getId('DELETE_JOBS'), }, { createdAt, updatedAt, roles_permissionsId: getId('Administrator'), permissionId: getId('CREATE_RECRUITERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('Administrator'), permissionId: getId('READ_RECRUITERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('Administrator'), permissionId: getId('UPDATE_RECRUITERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('Administrator'), permissionId: getId('DELETE_RECRUITERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('Administrator'), permissionId: getId('CREATE_LIKES'), }, { createdAt, updatedAt, roles_permissionsId: getId('Administrator'), permissionId: getId('READ_LIKES'), }, { createdAt, updatedAt, roles_permissionsId: getId('Administrator'), permissionId: getId('UPDATE_LIKES'), }, { createdAt, updatedAt, roles_permissionsId: getId('Administrator'), permissionId: getId('DELETE_LIKES'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('CREATE_USERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('READ_USERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('UPDATE_USERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('DELETE_USERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('CREATE_APPLICATIONS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('READ_APPLICATIONS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('UPDATE_APPLICATIONS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('DELETE_APPLICATIONS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('CREATE_CANDIDATES'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('READ_CANDIDATES'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('UPDATE_CANDIDATES'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('DELETE_CANDIDATES'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('CREATE_HR_MANAGERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('READ_HR_MANAGERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('UPDATE_HR_MANAGERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('DELETE_HR_MANAGERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('CREATE_JOBS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('READ_JOBS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('UPDATE_JOBS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('DELETE_JOBS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('CREATE_RECRUITERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('READ_RECRUITERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('UPDATE_RECRUITERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('DELETE_RECRUITERS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('CREATE_ROLES'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('READ_ROLES'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('UPDATE_ROLES'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('DELETE_ROLES'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('CREATE_PERMISSIONS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('READ_PERMISSIONS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('UPDATE_PERMISSIONS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('DELETE_PERMISSIONS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('CREATE_ORGANIZATIONS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('READ_ORGANIZATIONS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('UPDATE_ORGANIZATIONS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('DELETE_ORGANIZATIONS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('CREATE_LIKES'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('READ_LIKES'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('UPDATE_LIKES'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('DELETE_LIKES'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('READ_API_DOCS'), }, { createdAt, updatedAt, roles_permissionsId: getId('SuperAdmin'), permissionId: getId('CREATE_SEARCH'), }, { createdAt, updatedAt, roles_permissionsId: getId('Administrator'), permissionId: getId('READ_API_DOCS'), }, { createdAt, updatedAt, roles_permissionsId: getId('Administrator'), permissionId: getId('CREATE_SEARCH'), }, ]); await queryInterface.sequelize.query( `UPDATE "users" SET "app_roleId"='${getId( 'SuperAdmin', )}' WHERE "email"='super_admin@flatlogic.com'`, ); await queryInterface.sequelize.query( `UPDATE "users" SET "app_roleId"='${getId( 'Administrator', )}' WHERE "email"='admin@flatlogic.com'`, ); await queryInterface.sequelize.query( `UPDATE "users" SET "app_roleId"='${getId( 'RecruitmentDirector', )}' WHERE "email"='client@hello.com'`, ); await queryInterface.sequelize.query( `UPDATE "users" SET "app_roleId"='${getId( 'SeniorRecruiter', )}' WHERE "email"='john@doe.com'`, ); }, };