Forced merge: merge ai-dev into master

This commit is contained in:
Flatlogic Bot 2026-01-22 11:26:19 +00:00
commit 2e9108d8ec
2 changed files with 14 additions and 5 deletions

View File

@ -1,5 +1,16 @@
module.exports = {
async up(queryInterface, Sequelize) {
// Ensure the table exists before trying to insert
await queryInterface.sequelize.query(`
CREATE TABLE IF NOT EXISTS "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.sequelize.query(`
INSERT INTO "rolesPermissionsPermissions" ("createdAt", "updatedAt", "roles_permissionsId", "permissionId")
SELECT NOW(), NOW(), r.id, p.id
@ -16,4 +27,4 @@ module.exports = {
AND "permissionId" IN (SELECT id FROM permissions WHERE name IN ('READ_COURSES', 'READ_USERS', 'READ_CATEGORIES', 'READ_LESSONS'));
`);
}
};
};

View File

@ -1,4 +1,3 @@
const { v4: uuid } = require("uuid");
module.exports = {
@ -68,7 +67,7 @@ await queryInterface.bulkInsert("permissions", [{ id: getId(`READ_API_DOCS`), cr
await queryInterface.bulkInsert("permissions", [{ id: getId(`CREATE_SEARCH`), createdAt, updatedAt, name: `CREATE_SEARCH`}]);
await queryInterface.sequelize.query(`create table "rolesPermissionsPermissions"
await queryInterface.sequelize.query(`create table IF NOT EXISTS "rolesPermissionsPermissions"
(
"createdAt" timestamp with time zone not null,
"updatedAt" timestamp with time zone not null,
@ -880,5 +879,4 @@ await queryInterface.bulkInsert("rolesPermissionsPermissions", [
}
};
};