"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const sequelize_1=require("sequelize");class rolePermission extends sequelize_1.Model{static initModel(e){return rolePermission.init({id:{type:sequelize_1.DataTypes.INTEGER,autoIncrement:!0,primaryKey:!0,allowNull:!1},roleId:{type:sequelize_1.DataTypes.INTEGER,allowNull:!1,references:{model:"role",key:"id"}},permissionId:{type:sequelize_1.DataTypes.INTEGER,allowNull:!1,references:{model:"permission",key:"id"}}},{sequelize:e,modelName:"rolePermission",tableName:"role_permission",timestamps:!1,indexes:[{name:"PRIMARY",unique:!0,using:"BTREE",fields:[{name:"id"}]},{name:"RolePermissionPermissionIdFkey",using:"BTREE",fields:[{name:"permissionId"}]},{name:"RolePermissionRoleIdFkey",using:"BTREE",fields:[{name:"roleId"}]}]})}static associate(e){this.belongsTo(e.role,{as:"role",foreignKey:"roleId",onDelete:"CASCADE",onUpdate:"CASCADE"});this.belongsTo(e.permission,{as:"permission",foreignKey:"permissionId",onDelete:"CASCADE",onUpdate:"CASCADE"})}}exports.default=rolePermission;