fix: refs #7722 delete sms #2732
|
@ -28,6 +28,10 @@ BEGIN
|
||||||
DELETE FROM ticketDown WHERE created < util.yesterday();
|
DELETE FROM ticketDown WHERE created < util.yesterday();
|
||||||
DELETE FROM entryLog WHERE creationDate < v2Months;
|
DELETE FROM entryLog WHERE creationDate < v2Months;
|
||||||
DELETE IGNORE FROM expedition WHERE created < v26Months;
|
DELETE IGNORE FROM expedition WHERE created < v26Months;
|
||||||
|
DELETE cs.*
|
||||||
|
FROM sms s
|
||||||
|
JOIN clientSms cs ON cs.smsFk = s.id
|
||||||
|
WHERE s. created < v18Months;
|
||||||
DELETE FROM sms WHERE created < v18Months;
|
DELETE FROM sms WHERE created < v18Months;
|
||||||
DELETE FROM saleTracking WHERE created < v1Years;
|
DELETE FROM saleTracking WHERE created < v1Years;
|
||||||
DELETE FROM productionError WHERE dated < v1Years;
|
DELETE FROM productionError WHERE dated < v1Years;
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
-- Place your SQL code here
|
||||||
|
ALTER TABLE vn.ticketSms__ DROP FOREIGN KEY IF EXISTS ticketSms_FK;
|
||||||
|
ALTER TABLE vn.ticketSms__ ADD CONSTRAINT ticketSms_FK FOREIGN KEY (smsFk) REFERENCES vn.sms(id) ON DELETE CASCADE ON UPDATE CASCADE;
|
Loading…
Reference in New Issue