Files

150 lines
3.0 KiB
JavaScript
Raw Permalink Normal View History

2020-11-15 22:49:00 -06:00
const { DataTypes, Model } = require('sequelize');
const sequelize = require('../../config/sequelize.conf');
const Usuario = require('./Usuario');
const Carrera = require('./Carrera');
const Programa = require('./Programa');
const Status = require('./Status');
const CuestionarioAlumno = require('./CuestionarioAlumno');
const CuestionarioPrograma = require('./CuestionarioPrograma');
class Servicio extends Model {}
Servicio.init(
{
idServicio: {
type: DataTypes.INTEGER,
primaryKey: true,
allowNull: false,
unique: true,
autoIncrement: true,
},
creditos: {
type: DataTypes.STRING(3),
allowNull: false,
},
correo: {
2020-11-17 17:27:12 -06:00
type: DataTypes.STRING(60),
2020-11-15 22:49:00 -06:00
allowNull: false,
},
telefono: {
2020-12-26 03:52:10 -06:00
type: DataTypes.STRING(15),
2020-11-15 22:49:00 -06:00
allowNull: true,
defaultValue: null,
},
direccion: {
2020-11-19 11:47:23 -06:00
type: DataTypes.STRING(200),
2020-11-15 22:49:00 -06:00
allowNull: true,
defaultValue: null,
},
fechaInicio: {
type: DataTypes.DATE,
allowNull: false,
},
fechaFin: {
type: DataTypes.DATE,
2021-03-24 20:09:14 -06:00
allowNull: false,
2020-11-15 22:49:00 -06:00
},
2021-03-01 19:14:04 -06:00
fechaLiberacion: {
type: DataTypes.DATE,
allowNull: true,
defaultValue: null,
},
2020-11-15 22:49:00 -06:00
fechaNacimiento: {
type: DataTypes.DATE,
allowNull: true,
defaultValue: null,
},
2020-11-16 12:47:46 -06:00
carpeta: {
2020-11-17 17:27:12 -06:00
type: DataTypes.STRING(60),
2021-03-24 20:09:14 -06:00
allowNull: false,
2020-11-16 12:47:46 -06:00
},
2020-11-15 22:49:00 -06:00
cartaAceptacion: {
2020-11-17 17:27:12 -06:00
type: DataTypes.STRING(60),
2020-11-15 22:49:00 -06:00
allowNull: false,
},
cartaTermino: {
2020-11-17 17:27:12 -06:00
type: DataTypes.STRING(60),
2020-11-15 22:49:00 -06:00
allowNull: true,
defaultValue: null,
},
informeGlobal: {
2020-11-17 17:27:12 -06:00
type: DataTypes.STRING(60),
2020-11-15 22:49:00 -06:00
allowNull: true,
defaultValue: null,
},
programaInterno: {
2021-01-28 19:25:09 -06:00
type: DataTypes.STRING(250),
2020-11-15 22:49:00 -06:00
allowNull: true,
defaultValue: null,
},
profesor: {
2020-11-17 10:12:30 -06:00
type: DataTypes.STRING(50),
2020-11-15 22:49:00 -06:00
allowNull: true,
defaultValue: null,
},
vistoBuenoAcatlan: {
type: DataTypes.BOOLEAN,
allowNull: true,
defaultValue: null,
},
},
{
sequelize,
modelName: 'Servicio',
tableName: 'servicio',
2020-11-23 11:03:30 -06:00
timestamps: true,
2020-11-15 22:49:00 -06:00
}
);
Servicio.belongsTo(Usuario, {
foreignKey: {
name: 'idUsuario',
type: DataTypes.INTEGER,
allowNull: false,
},
});
Servicio.belongsTo(Carrera, {
foreignKey: {
name: 'idCarrera',
type: DataTypes.INTEGER,
allowNull: false,
},
});
Servicio.belongsTo(Status, {
foreignKey: {
name: 'idStatus',
type: DataTypes.INTEGER,
allowNull: false,
2020-11-16 12:47:46 -06:00
defaultValue: 1,
2020-11-15 22:49:00 -06:00
},
});
Servicio.belongsTo(Programa, {
foreignKey: {
name: 'idPrograma',
type: DataTypes.INTEGER,
allowNull: false,
},
});
Servicio.belongsTo(CuestionarioAlumno, {
foreignKey: {
name: 'idCuestionarioAlumno',
type: DataTypes.INTEGER,
2020-11-16 12:47:46 -06:00
allowNull: true,
defaultValue: null,
2020-11-15 22:49:00 -06:00
},
});
Servicio.belongsTo(CuestionarioPrograma, {
foreignKey: {
name: 'idCuestionarioPrograma',
type: DataTypes.INTEGER,
2020-11-16 12:47:46 -06:00
allowNull: true,
defaultValue: null,
2020-11-15 22:49:00 -06:00
},
});
module.exports = Servicio;