import { sequelize } from '../../utils/sequelize.js';
import { DataTypes } from 'sequelize';

const FolderVisibilityUser = sequelize.define('folder_visibility_user', {
    id: {
        type: DataTypes.INTEGER,
        autoIncrement: true,
        primaryKey: true,
        allowNull: false
    },
    folderId: {
        type: DataTypes.INTEGER,
        allowNull: false,
        references: {
            model: 'folder',
            key: 'id'
        }
    },
    visibilityUserId: {
        type: DataTypes.INTEGER,
        allowNull: false,
        references: {
            model: 'image_visibility_user',
            key: 'id'
        }
    }
}, {
    tableName: 'folder_visibility_user',
    schema: 'community',
    timestamps: false,
    underscored: true});

export default FolderVisibilityUser;
