diff --git a/server/db/tablas/Carrera.js b/server/db/tablas/Carrera.js index 0c15c7c..a0e1c85 100644 --- a/server/db/tablas/Carrera.js +++ b/server/db/tablas/Carrera.js @@ -12,7 +12,7 @@ Carrera.init( autoIncrement: true, }, carrera: { - type: DataTypes.STRING(15), + type: DataTypes.STRING(40), allowNull: false, }, }, diff --git a/server/db/tablas/Carrito.js b/server/db/tablas/Carrito.js index 4e38534..cf5a3a0 100644 --- a/server/db/tablas/Carrito.js +++ b/server/db/tablas/Carrito.js @@ -14,11 +14,11 @@ Carrito.init( autoIncrement: true, }, carrito: { - type: DataTypes.STRING(15), + type: DataTypes.STRING(4), allowNull: false, }, sobrenombre: { - type: DataTypes.STRING(15), + type: DataTypes.STRING(4), allowNull: false, }, activo: { diff --git a/server/db/tablas/Equipo.js b/server/db/tablas/Equipo.js index 89a4baf..917ccf2 100644 --- a/server/db/tablas/Equipo.js +++ b/server/db/tablas/Equipo.js @@ -23,19 +23,22 @@ Equipo.init( allowNull: false, }, sobrenombre: { - type: DataTypes.STRING(15), + type: DataTypes.STRING(4), allowNull: false, }, activo: { type: DataTypes.BOOLEAN, allowNull: false, + defaultValue: false, }, }, { sequelize, modelName: 'Equipo', tableName: 'equipo', - // activar unicamente updateat + timestamps: true, + createdAt: false, + updatedAt: true, } ); diff --git a/server/db/tablas/Modulo.js b/server/db/tablas/Modulo.js index b60f5bf..4316e80 100644 --- a/server/db/tablas/Modulo.js +++ b/server/db/tablas/Modulo.js @@ -12,7 +12,7 @@ Modulo.init( autoIncrement: true, }, modulo: { - type: DataTypes.STRING(15), + type: DataTypes.STRING(20), allowNull: false, }, }, diff --git a/server/db/tablas/Operador.js b/server/db/tablas/Operador.js index 6efe533..f08f2c3 100644 --- a/server/db/tablas/Operador.js +++ b/server/db/tablas/Operador.js @@ -13,18 +13,18 @@ Operador.init( autoIncrement: true, }, operador: { - type: DataTypes.STRING(100), + type: DataTypes.STRING(20), allowNull: false, unique: true, }, password: { type: DataTypes.STRING(60), - allowNull: true, - defaultValue: null, + allowNull: false, }, activo: { type: DataTypes.BOOLEAN, allowNull: false, + defaultValue: true, }, }, { diff --git a/server/db/tablas/Prestamo.js b/server/db/tablas/Prestamo.js index c555e16..6e0c96b 100644 --- a/server/db/tablas/Prestamo.js +++ b/server/db/tablas/Prestamo.js @@ -24,18 +24,22 @@ Prestamo.init( }, horaEntrega: { type: DataTypes.DATE, - allowNull: false, + allowNull: true, + defaultValue: null, }, activo: { type: DataTypes.BOOLEAN, allowNull: false, + defaultValue: false, }, }, { sequelize, modelName: 'Prestamo', tableName: 'Prestamo', - // activar createdat + timestamps: true, + createdAt: true, + updatedAt: false, } ); @@ -51,7 +55,8 @@ Prestamo.belongsTo(Operador, { foreignKey: { name: 'idOperadorRegreso', type: DataTypes.INTEGER, - allowNull: false, + allowNull: true, + defaultValue: null, }, }); diff --git a/server/db/tablas/Status.js b/server/db/tablas/Status.js index ea475f4..8a56bd7 100644 --- a/server/db/tablas/Status.js +++ b/server/db/tablas/Status.js @@ -12,7 +12,7 @@ Status.init( autoIncrement: true, }, status: { - type: DataTypes.STRING(15), + type: DataTypes.STRING(20), allowNull: false, }, }, diff --git a/server/db/tablas/Usuario.js b/server/db/tablas/Usuario.js index f7a769b..a1a4535 100644 --- a/server/db/tablas/Usuario.js +++ b/server/db/tablas/Usuario.js @@ -14,7 +14,7 @@ Usuario.init( autoIncrement: true, }, usuario: { - type: DataTypes.STRING(100), + type: DataTypes.STRING(10), allowNull: false, unique: true, }, @@ -27,7 +27,7 @@ Usuario.init( allowNull: false, }, telefono: { - type: DataTypes.STRING(70), + type: DataTypes.STRING(15), allowNull: false, }, multa: {