import { Model, DataTypes, CreationOptional, InferAttributes, InferCreationAttributes, } from 'sequelize'; import sequelize from '../sequelizeInstance'; class Dict extends Model< // eslint-disable-next-line no-use-before-define InferAttributes, // eslint-disable-next-line no-use-before-define InferCreationAttributes > { declare id: CreationOptional; declare key: string; declare val: string; declare createdAt: CreationOptional; declare updatedAt: CreationOptional; } Dict.init( { id: { type: DataTypes.INTEGER, autoIncrement: true, primaryKey: true, }, key: { type: DataTypes.STRING, allowNull: false, }, val: { type: DataTypes.STRING, allowNull: false, }, createdAt: DataTypes.DATE, updatedAt: DataTypes.DATE, }, { sequelize, modelName: 'Dict', underscored: true, tableName: 'dict', } ); export type DictCreationAttributes = InferCreationAttributes< Dict, { omit: 'id' | 'createdAt' | 'updatedAt' } >; export default Dict;