Refactor multiple models to remove foreign key references while maintaining required fields, enhancing data integrity and simplifying model definitions.

This commit is contained in:
Torsten Schulz (local)
2025-12-18 16:08:30 +01:00
parent c66fbf1a62
commit c8072b8052
24 changed files with 38 additions and 222 deletions

View File

@@ -8,16 +8,12 @@ const Folder = sequelize.define('folder', {
allowNull: false},
parentId: {
type: DataTypes.INTEGER,
allowNull: true,
references: {
model: 'folder',
key: 'id'}},
allowNull: true
},
userId: {
type: DataTypes.INTEGER,
allowNull: false,
references: {
model: 'user',
key: 'id'}}}, {
allowNull: false
}}, {
tableName: 'folder',
schema: 'community',
underscored: true,