import { DataTypes } from 'sequelize';
import sequelize from '../database.js';
import DiaryDate from './DiaryDates.js';

const Activity = sequelize.define('Activity', {
    id: {
        type: DataTypes.INTEGER,
        primaryKey: true,
        autoIncrement: true,
        allowNull: false
    },
    description: {
        type: DataTypes.TEXT('long'),
        allowNull: false
    },
    diaryDateId: {
        type: DataTypes.INTEGER,
        allowNull: false,
        references: {
            model: DiaryDate,
            key: 'id'
        }
    }
}, {
    underscored: true,
    tableName: 'activities',
    timestamps: true
});

export default Activity;
