percinate

This commit is contained in:
Lemuel Marquez
2021-03-24 20:15:24 -06:00
parent c2d1b2fabb
commit 82f65788b1
+8 -9
View File
@@ -9,18 +9,18 @@ const fechaLiberacion = async () => {
let lastUpdate = moment(res[i].updatedAt);
if (lastUpdate <= lastYear) {
// await Servicio.update(
// { fechaLiberacion: lastYear },
// { where: { idServicio: res[i].idServicio } }
// );
await Servicio.update(
{ fechaLiberacion: lastYear },
{ where: { idServicio: res[i].idServicio } }
);
console.log(
`El servicio con id ${res[i].idServicio} fue actualizado el ${res[i].updatedAt} año pasado`
);
} else {
// await Servicio.update(
// { fechaLiberacion: lastUpdate },
// { where: { idServicio: res[i].idServicio } }
// );
await Servicio.update(
{ fechaLiberacion: lastUpdate },
{ where: { idServicio: res[i].idServicio } }
);
console.log(
`El servicio con id ${res[i].idServicio} fue actualizado el ${res[i].updatedAt} siguiente año`
);
@@ -37,6 +37,5 @@ fechaLiberacion();
/*
ALTER TABLE servicio ADD fechaLiberacion datetime
agrear campo fecha liberacion a la tabla servicio
asignar fecha de liberacipon a servicios liberados
*/