Changed controllers to classes, added image functionality

This commit is contained in:
Torsten Schulz
2024-09-21 15:26:29 +02:00
parent e494fe41db
commit f1b6dd74f7
20 changed files with 836 additions and 581 deletions

View File

@@ -0,0 +1,41 @@
import { sequelize } from '../../utils/sequelize.js';
import { DataTypes } from 'sequelize';
import UserParamVisibilityType from '../type/user_param_visibility.js';
const Folder = sequelize.define('folder', {
name: {
type: DataTypes.STRING,
allowNull: false,
},
parentId: {
type: DataTypes.INTEGER,
allowNull: true,
references: {
model: 'folder',
key: 'id',
},
},
userId: {
type: DataTypes.INTEGER,
allowNull: false,
references: {
model: 'user',
key: 'id',
},
},
visibilityType: {
type: DataTypes.INTEGER,
allowNull: false,
references: {
model: UserParamVisibilityType,
key: 'id',
},
},
}, {
tableName: 'folder',
schema: 'community',
underscored: true,
timestamps: true,
});
export default Folder;