Files
api/src/db/tables/ProgramaNivel.js
T
2020-10-02 15:08:37 -05:00

32 lines
601 B
JavaScript

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