import {Model, DataTypes} from 'sequelize'; import {sequelize} from './Connection'; interface TaxCategoriesCategoriesInterface extends Model { id: number; categories_id: number; tax_categories_id: number; } const TaxCategoriesCategoriesModel = sequelize.define('TaxCategoriesCategories', { id: { type: DataTypes.INTEGER.UNSIGNED, autoIncrement: true, primaryKey: true, }, categories_id: { type: DataTypes.INTEGER.UNSIGNED, allowNull: true, references: {model: 'Categories', key: 'id'}, onDelete: 'CASCADE', }, tax_categories_id: { type: DataTypes.INTEGER.UNSIGNED, allowNull: true, references: {model: 'TaxCategories', key: 'id'}, onDelete: 'CASCADE', } }, { tableName: 'r_tax_categories_categories', freezeTableName: true, timestamps: true, underscored: true, name:{ singular: 'TaxCategoryCategory', plural: 'TaxCategoryCategory' }, } ); export {TaxCategoriesCategoriesModel, TaxCategoriesCategoriesInterface};