tabla casos especiales db
This commit is contained in:
@@ -0,0 +1,100 @@
|
||||
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');
|
||||
|
||||
class CasoEspecial extends Model {}
|
||||
CasoEspecial.init(
|
||||
{
|
||||
idServicio: {
|
||||
type: DataTypes.INTEGER,
|
||||
primaryKey: true,
|
||||
allowNull: false,
|
||||
unique: true,
|
||||
autoIncrement: true,
|
||||
},
|
||||
creditos: {
|
||||
type: DataTypes.STRING(3),
|
||||
allowNull: false,
|
||||
},
|
||||
correo: {
|
||||
type: DataTypes.STRING(60),
|
||||
allowNull: false,
|
||||
},
|
||||
telefono: {
|
||||
type: DataTypes.STRING(15),
|
||||
allowNull: true,
|
||||
defaultValue: null,
|
||||
},
|
||||
direccion: {
|
||||
type: DataTypes.STRING(200),
|
||||
allowNull: true,
|
||||
defaultValue: null,
|
||||
},
|
||||
fechaInicio: {
|
||||
type: DataTypes.DATE,
|
||||
allowNull: false,
|
||||
},
|
||||
fechaFin: {
|
||||
type: DataTypes.DATE,
|
||||
allowNull: true,
|
||||
defaultValue: null,
|
||||
},
|
||||
fechaNacimiento: {
|
||||
type: DataTypes.DATE,
|
||||
allowNull: true,
|
||||
defaultValue: null,
|
||||
},
|
||||
carpeta: {
|
||||
type: DataTypes.STRING(60),
|
||||
allowNull: false,
|
||||
},
|
||||
archivoZip: {
|
||||
type: DataTypes.STRING(60),
|
||||
allowNull: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
sequelize,
|
||||
modelName: 'CasoEspecial',
|
||||
tableName: 'caso_especial',
|
||||
timestamps: true,
|
||||
}
|
||||
);
|
||||
|
||||
CasoEspecial.belongsTo(Usuario, {
|
||||
foreignKey: {
|
||||
name: 'idUsuario',
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
});
|
||||
|
||||
CasoEspecial.belongsTo(Carrera, {
|
||||
foreignKey: {
|
||||
name: 'idCarrera',
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
});
|
||||
|
||||
CasoEspecial.belongsTo(Status, {
|
||||
foreignKey: {
|
||||
name: 'idStatus',
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
defaultValue: 1,
|
||||
},
|
||||
});
|
||||
|
||||
CasoEspecial.belongsTo(Programa, {
|
||||
foreignKey: {
|
||||
name: 'idPrograma',
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
});
|
||||
|
||||
module.exports = CasoEspecial;
|
||||
Reference in New Issue
Block a user