Merge pull request 'fix: ticket #158883' (!2095) from hotfix158883-entryObservationClean into master
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #2095
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
This commit is contained in:
Guillermo Bonet 2024-02-26 10:06:22 +00:00
commit e3fc9167a3
3 changed files with 7 additions and 6 deletions

View File

@ -37,7 +37,8 @@ BEGIN
DELETE FROM saleTracking WHERE created < vOneYearAgo;
DELETE FROM ticketTracking WHERE created < v18Month;
DELETE tobs FROM ticketObservation tobs
JOIN ticket t ON tobs.ticketFk = t.id WHERE t.shipped < TIMESTAMPADD(YEAR,-2,util.VN_CURDATE());
JOIN ticket t ON tobs.ticketFk = t.id
WHERE t.shipped < v5Years;
DELETE sc.* FROM saleCloned sc JOIN sale s ON s.id = sc.saleClonedFk JOIN ticket t ON t.id = s.ticketFk WHERE t.shipped < vOneYearAgo;
DELETE FROM sharingCart where ended < vDateShort;
DELETE FROM sharingClient where ended < vDateShort;

View File

@ -25,11 +25,6 @@ proc: BEGIN
DELETE FROM Movimientos_mark WHERE odbc_date < vDate;
DELETE FROM Splits WHERE Fecha < vDate18;
DELETE tobs
FROM ticket_observation tobs
JOIN Tickets t ON tobs.Id_Ticket = t.Id_Ticket
WHERE t.Fecha < vDate;
DELETE tobs
FROM movement_label tobs
JOIN Movimientos m ON tobs.Id_Movimiento = m.Id_Movimiento

View File

@ -0,0 +1,5 @@
DELETE FROM vn.entryObservation
WHERE observationTypeFk IS NULL;
ALTER TABLE vn.entryObservation
MODIFY COLUMN observationTypeFk tinyint(3) unsigned NOT NULL;