done #2058
|
@ -22,6 +22,7 @@ BEGIN
|
||||||
SET v2Years = util.VN_CURDATE() - INTERVAL 2 YEAR;
|
SET v2Years = util.VN_CURDATE() - INTERVAL 2 YEAR;
|
||||||
SET v5Years = util.VN_CURDATE() - INTERVAL 5 YEAR;
|
SET v5Years = util.VN_CURDATE() - INTERVAL 5 YEAR;
|
||||||
|
|
||||||
|
DELETE FROM workerActivity WHERE created < v2Years;
|
||||||
DELETE FROM ticketParking WHERE created < vDateShort;
|
DELETE FROM ticketParking WHERE created < vDateShort;
|
||||||
DELETE FROM routesMonitor WHERE dated < vDateShort;
|
DELETE FROM routesMonitor WHERE dated < vDateShort;
|
||||||
DELETE FROM workerTimeControlLog WHERE created < vDateShort;
|
DELETE FROM workerTimeControlLog WHERE created < vDateShort;
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
-- Place your SQL code here
|
||||||
|
CREATE TABLE vn.workerActivity (
|
||||||
|
id INT PRIMARY KEY AUTO_INCREMENT,
|
||||||
|
created TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
model ENUM('COM', 'ENT', 'TPV', 'ENC', 'LAB', 'ETI') NOT NULL,
|
||||||
|
workerFk INT(10) UNSIGNED NOT NULL,
|
||||||
|
event ENUM('open', 'close', 'insert', 'delete', 'update', 'refresh') NOT NULL,
|
||||||
|
description VARCHAR(255) DEFAULT NULL,
|
||||||
|
CONSTRAINT fk_workerActivity_worker FOREIGN KEY (workerFk)
|
||||||
|
REFERENCES vn.worker (id)
|
||||||
|
ON DELETE CASCADE
|
||||||
|
ON UPDATE CASCADE
|
||||||
|
);
|
Loading…
Reference in New Issue