import {Model, DataTypes} from 'sequelize'; import {sequelize} from './Connection'; interface StoreInstance extends Model { id: number; name: string; code: string; } const StoreModel = sequelize.define('Store', { id: { type: DataTypes.INTEGER.UNSIGNED, autoIncrement: true, primaryKey: true, }, code: { type: DataTypes.STRING(2), allowNull: false, }, name: { type: new DataTypes.STRING(30), allowNull: false, }, }, { tableName: 'nom_store', freezeTableName: true, timestamps: true, underscored: true } ); export {StoreModel, StoreInstance};