percinate
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user