foder route ok

This commit is contained in:
helori_ollivier
2026-04-24 23:28:53 +02:00
parent 6813dd23e1
commit 132b8cacd5
8 changed files with 91 additions and 36 deletions
+28
View File
@@ -0,0 +1,28 @@
const {Sequelize, DataTypes} = require('sequelize');
const db = require('../config/db')
const folder = db.define('Folders', {
folderid: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true,
},
folderName: {
type: DataTypes.STRING,
allowNull: false,
},
folderParent: {
type: DataTypes.INTEGER,
allowNull: true,
references: {
model: 'File',
key: 'folderId',
},
},
});
folder.hasMany(folder, { as: 'subFolders', foreignKey: 'folderParent' });
module.exports = folder;