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

class Candidate extends Model {}

Candidate.init({
  id: {
    type: DataTypes.INTEGER,
    primaryKey: true,
    autoIncrement: true},
  electionId: {
    type: DataTypes.INTEGER,
    allowNull: false},
  characterId: {
    type: DataTypes.INTEGER,
    allowNull: false}}, {
  sequelize,
  modelName: 'Candidate',
  tableName: 'candidate',
  schema: 'falukant_data',
  timestamps: true,
  underscored: true});

export default Candidate;
