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

class DiaryHistory extends Model { }

DiaryHistory.init({
    diaryId: {
        type: DataTypes.INTEGER,
        allowNull: false},
    userId: {
        type: DataTypes.INTEGER,
        allowNull: false},
    oldText: {
        type: DataTypes.TEXT,
        allowNull: false}, 
    oldCreatedAt: {
        type: DataTypes.DATE,
        allowNull: false},
    oldUpdatedAt: {
        type: DataTypes.DATE,
        allowNull: false}}, {
    sequelize,
    modelName: 'DiaryHistory',
    tableName: 'diary_history',
    schema: 'community',
    timestamps: false,
    underscored: true});

export default DiaryHistory;
