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

class ElectionHistory extends Model { }

ElectionHistory.init({
    electionId: {
        type: DataTypes.INTEGER,
        allowNull: false},
    politicalOfficeTypeId: {
        type: DataTypes.INTEGER,
        allowNull: false},
    electionDate: {
        type: DataTypes.DATE,
        allowNull: false},
    electionResult: {
        type: DataTypes.JSON,
        allowNull: false}
}, {
    sequelize,
    modelName: 'ElectionHistory',
    tableName: 'election_history',
    schema: 'falukant_log',
    timestamps: true,
    underscored: true});

export default ElectionHistory;
