const { DataTypes, Model } = require('sequelize') const sequelize = require('../../config/sequelize.conf') const Programa = require('./Programa') class ProgramaNivel extends Model {} ProgramaNivel.init( { idPrograma: { type: DataTypes.INTEGER, primaryKey: true, allowNull: false, }, nivel: { type: DataTypes.STRING(1), allowNull: false, }, }, { sequelize, modelName: 'ProgramaNivel', tableName: 'programa_nivel', } ) ProgramaNivel.belongsTo(Programa, { foreignKey: { name: 'idPrograma', }, }) module.exports = ProgramaNivel