feat: nested folders (#266)

This commit is contained in:
Eliezer Castro
2025-08-06 10:26:38 -03:00
committed by GitHub
parent d4c5f59755
commit 424b1bdbc7
10 changed files with 457 additions and 79 deletions

View File

@@ -0,0 +1,22 @@
'use strict';
/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up(queryInterface) {
await queryInterface.addConstraint('folders', {
fields: ['parentFolderId'],
type: 'foreign key',
name: 'fk_folders_parentFolderId',
references: {
table: 'folders',
field: 'id',
},
onDelete: 'CASCADE',
onUpdate: 'CASCADE',
});
},
async down(queryInterface) {
await queryInterface.removeConstraint('folders', 'fk_folders_parentFolderId');
},
};