primer semestre
This commit is contained in:
@@ -12,7 +12,7 @@ Dia.init(
|
||||
autoIncrement: true,
|
||||
},
|
||||
dia: {
|
||||
type: DataTypes.STRING(8),
|
||||
type: DataTypes.STRING(10),
|
||||
allowNull: false,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -17,7 +17,7 @@ DiaHora.init(
|
||||
{
|
||||
sequelize,
|
||||
modelName: 'DiaHora',
|
||||
tableName: 'diaHora',
|
||||
tableName: 'dia_hora',
|
||||
timestamps: false,
|
||||
}
|
||||
);
|
||||
|
||||
@@ -17,7 +17,7 @@ GrupoDiaHora.init(
|
||||
{
|
||||
sequelize,
|
||||
modelName: 'GrupoDiaHora',
|
||||
tableName: 'grupoDiaHora',
|
||||
tableName: 'grupo_dia_hora',
|
||||
timestamps: false,
|
||||
}
|
||||
);
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
const { DataTypes, Model } = require('sequelize');
|
||||
const sequelize = require('../../config/sequelize.conf');
|
||||
const GrupoDiaHora = require('./GrupoDiaHora');
|
||||
|
||||
class PrimerSemestre extends Model {}
|
||||
PrimerSemestre.init(
|
||||
{
|
||||
idPrimerSemestre: {
|
||||
type: DataTypes.INTEGER,
|
||||
primaryKey: true,
|
||||
allowNull: false,
|
||||
unique: true,
|
||||
autoIncrement: true,
|
||||
},
|
||||
numeroCuenta: {
|
||||
type: DataTypes.STRING(10),
|
||||
allowNull: false,
|
||||
unique: true,
|
||||
},
|
||||
nombre: {
|
||||
type: DataTypes.STRING(70),
|
||||
allowNull: false,
|
||||
},
|
||||
correo: {
|
||||
type: DataTypes.STRING(60),
|
||||
allowNull: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
sequelize,
|
||||
modelName: 'PrimerSemestre',
|
||||
tableName: 'primer_semestre',
|
||||
timestamps: false,
|
||||
}
|
||||
);
|
||||
|
||||
PrimerSemestre.belongsTo(GrupoDiaHora, {
|
||||
foreignKey: {
|
||||
name: 'idGrupoDiaHora',
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
});
|
||||
|
||||
module.exports = PrimerSemestre;
|
||||
Reference in New Issue
Block a user