tablas programas y entidad

This commit is contained in:
2020-10-02 15:08:37 -05:00
parent 40133cc488
commit 6c022ef57b
8 changed files with 166 additions and 8 deletions
+31
View File
@@ -0,0 +1,31 @@
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