tablas programas y entidad
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user