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

class VocabGrammarExerciseType extends Model {}

VocabGrammarExerciseType.init({
    id: {
        type: DataTypes.INTEGER,
        primaryKey: true,
        autoIncrement: true
    },
    name: {
        type: DataTypes.TEXT,
        allowNull: false,
        unique: true
    },
    description: {
        type: DataTypes.TEXT,
        allowNull: true
    },
    createdAt: {
        type: DataTypes.DATE,
        allowNull: false,
        defaultValue: DataTypes.NOW,
        field: 'created_at'
    }
}, {
    sequelize,
    modelName: 'VocabGrammarExerciseType',
    tableName: 'vocab_grammar_exercise_type',
    schema: 'community',
    timestamps: false,
    underscored: true
});

export default VocabGrammarExerciseType;
