From 4880d1497fe807721f094ac53fba1dbc29556ff5 Mon Sep 17 00:00:00 2001 From: guillermo Date: Tue, 18 Jun 2024 08:40:33 +0200 Subject: [PATCH 1/7] feat: refs #6727 Added util logClean --- db/routines/util/events/log_clean.sql | 8 ++++ db/routines/util/procedures/log_clean.sql | 41 +++++++++++++++++++ .../11107-pinkAspidistra/00-firstScript.sql | 30 ++++++++++++++ 3 files changed, 79 insertions(+) create mode 100644 db/routines/util/events/log_clean.sql create mode 100644 db/routines/util/procedures/log_clean.sql create mode 100644 db/versions/11107-pinkAspidistra/00-firstScript.sql diff --git a/db/routines/util/events/log_clean.sql b/db/routines/util/events/log_clean.sql new file mode 100644 index 000000000..8447069e6 --- /dev/null +++ b/db/routines/util/events/log_clean.sql @@ -0,0 +1,8 @@ +DELIMITER $$ +CREATE OR REPLACE DEFINER=`root`@`localhost` EVENT `util`.`log_clean` + ON SCHEDULE EVERY 1 DAY + STARTS '2024-07-09 00:30:00.000' + ON COMPLETION PRESERVE + ENABLE +DO CALL util.log_clean$$ +DELIMITER ; diff --git a/db/routines/util/procedures/log_clean.sql b/db/routines/util/procedures/log_clean.sql new file mode 100644 index 000000000..1401b5dd8 --- /dev/null +++ b/db/routines/util/procedures/log_clean.sql @@ -0,0 +1,41 @@ +DELIMITER $$ +CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `util`.`log_clean`() +BEGIN +/** + * Hace limpieza de los datos de las tablas log, + * dejando únicamente los días de retención configurados. + */ + DECLARE vSchemaName VARCHAR(65); + DECLARE vTableName VARCHAR(65); + DECLARE vRetentionDays INT; + DECLARE vDated DATE; + DECLARE vDone BOOL; + + DECLARE vQueue CURSOR FOR + SELECT schemaName, tableName, retentionDays + FROM logClean + ORDER BY `order`; + + DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; + + OPEN vQueue; + l: LOOP + SET vDone = FALSE; + FETCH vQueue INTO vSchemaName, vTableName, vRetentionDays; + + SET vSchemaName = util.quoteIdentifier(vSchemaName); + SET vTableName = util.quoteIdentifier(vTableName); + SET vDated = VN_CURDATE() - INTERVAL vRetentionDays DAY; + + IF vDone THEN + LEAVE l; + END IF; + + CALL util.exec(CONCAT( + 'DELETE FROM ', vSchemaName , '.', vTableName, + " WHERE creationDate < '", vDated, "'" + )); + END LOOP; + CLOSE vQueue; +END$$ +DELIMITER ; diff --git a/db/versions/11107-pinkAspidistra/00-firstScript.sql b/db/versions/11107-pinkAspidistra/00-firstScript.sql new file mode 100644 index 000000000..e702da21e --- /dev/null +++ b/db/versions/11107-pinkAspidistra/00-firstScript.sql @@ -0,0 +1,30 @@ +CREATE OR REPLACE TABLE `util`.`logClean` ( + `schemaName` varchar(64) NOT NULL, + `tableName` varchar(64) NOT NULL, + `retentionDays` int(11) NOT NULL, + `order` int(11) DEFAULT NULL, + PRIMARY KEY (`schemaName`,`tableName`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; + +INSERT INTO `util`.`logClean` (`schemaName`, `tableName`, `retentionDays`, `order`) + VALUES + ('account', 'roleLog', 'xxx', NULL), + ('account', 'userLog', 'xxx', NULL), + ('vn', 'entryLog', 'xxx', NULL), + ('vn', 'clientLog', 'xxx', NULL), + ('vn', 'itemLog', 'xxx', NULL), + ('vn', 'shelvingLog', 'xxx', NULL), + ('vn', 'workerLog', 'xxx', NULL), + ('vn', 'deviceProductionLog', 'xxx', NULL), + ('vn', 'zoneLog', 'xxx', NULL), + ('vn', 'rateLog', 'xxx', NULL), + ('vn', 'ticketLog', 'xxx', NULL), + ('vn', 'agencyLog', 'xxx', NULL), + ('vn', 'userLog', 'xxx', NULL), + ('vn', 'routeLog', 'xxx', NULL), + ('vn', 'claimLog', 'xxx', NULL), + ('vn', 'supplierLog', 'xxx', NULL), + ('vn', 'invoiceInLog', 'xxx', NULL), + ('vn', 'travelLog', 'xxx', NULL), + ('vn', 'packingSiteDeviceLog', 'xxx', NULL), + ('vn', 'parkingLog', 'xxx', NULL); From 930e2951b74da376cba76dba7fdab9e326bcd0ff Mon Sep 17 00:00:00 2001 From: guillermo Date: Fri, 19 Jul 2024 08:27:39 +0200 Subject: [PATCH 2/7] feat: refs #6727 Added started and finished --- db/routines/util/procedures/log_clean.sql | 35 +++++++++++++------ .../11107-pinkAspidistra/00-firstScript.sql | 8 +++-- 2 files changed, 29 insertions(+), 14 deletions(-) diff --git a/db/routines/util/procedures/log_clean.sql b/db/routines/util/procedures/log_clean.sql index 1401b5dd8..850b26612 100644 --- a/db/routines/util/procedures/log_clean.sql +++ b/db/routines/util/procedures/log_clean.sql @@ -13,7 +13,7 @@ BEGIN DECLARE vQueue CURSOR FOR SELECT schemaName, tableName, retentionDays - FROM logClean + FROM logCleanMultiConfig ORDER BY `order`; DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; @@ -23,18 +23,31 @@ BEGIN SET vDone = FALSE; FETCH vQueue INTO vSchemaName, vTableName, vRetentionDays; - SET vSchemaName = util.quoteIdentifier(vSchemaName); - SET vTableName = util.quoteIdentifier(vTableName); - SET vDated = VN_CURDATE() - INTERVAL vRetentionDays DAY; + IF vRetentionDays THEN - IF vDone THEN - LEAVE l; + UPDATE logCleanMultiConfig + SET `started` = util.VN_NOW() + WHERE schemaName = vSchemaName + AND tableName = vTableName; + + SET vSchemaName = util.quoteIdentifier(vSchemaName); + SET vTableName = util.quoteIdentifier(vTableName); + SET vDated = VN_CURDATE() - INTERVAL vRetentionDays DAY; + + IF vDone THEN + LEAVE l; + END IF; + + CALL util.exec(CONCAT( + 'DELETE FROM ', vSchemaName , '.', vTableName, + " WHERE creationDate < '", vDated, "'" + )); + + UPDATE logCleanMultiConfig + SET `finished` = util.VN_NOW() + WHERE schemaName = vSchemaName + AND tableName = vTableName; END IF; - - CALL util.exec(CONCAT( - 'DELETE FROM ', vSchemaName , '.', vTableName, - " WHERE creationDate < '", vDated, "'" - )); END LOOP; CLOSE vQueue; END$$ diff --git a/db/versions/11107-pinkAspidistra/00-firstScript.sql b/db/versions/11107-pinkAspidistra/00-firstScript.sql index e702da21e..a1c4bb82f 100644 --- a/db/versions/11107-pinkAspidistra/00-firstScript.sql +++ b/db/versions/11107-pinkAspidistra/00-firstScript.sql @@ -1,12 +1,14 @@ -CREATE OR REPLACE TABLE `util`.`logClean` ( +CREATE OR REPLACE TABLE `util`.`logCleanMultiConfig` ( `schemaName` varchar(64) NOT NULL, `tableName` varchar(64) NOT NULL, - `retentionDays` int(11) NOT NULL, + `retentionDays` int(11) DEFAULT NULL, `order` int(11) DEFAULT NULL, + `started` datetime DEFAULT NULL, + `finished` datetime DEFAULT NULL, PRIMARY KEY (`schemaName`,`tableName`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; -INSERT INTO `util`.`logClean` (`schemaName`, `tableName`, `retentionDays`, `order`) +INSERT INTO `util`.`logCleanMultiConfig` (`schemaName`, `tableName`, `retentionDays`, `order`) VALUES ('account', 'roleLog', 'xxx', NULL), ('account', 'userLog', 'xxx', NULL), From 3cf55556120df016e1f6980b2ffebc089b548aae Mon Sep 17 00:00:00 2001 From: guillermo Date: Fri, 19 Jul 2024 08:58:51 +0200 Subject: [PATCH 3/7] feat: refs #6727 Fixes --- db/routines/util/procedures/log_clean.sql | 24 +++++------ .../11107-pinkAspidistra/00-firstScript.sql | 42 +++++++++---------- 2 files changed, 31 insertions(+), 35 deletions(-) diff --git a/db/routines/util/procedures/log_clean.sql b/db/routines/util/procedures/log_clean.sql index 850b26612..765d5dcbc 100644 --- a/db/routines/util/procedures/log_clean.sql +++ b/db/routines/util/procedures/log_clean.sql @@ -8,6 +8,7 @@ BEGIN DECLARE vSchemaName VARCHAR(65); DECLARE vTableName VARCHAR(65); DECLARE vRetentionDays INT; + DECLARE vStarted DATETIME; DECLARE vDated DATE; DECLARE vDone BOOL; @@ -23,28 +24,23 @@ BEGIN SET vDone = FALSE; FETCH vQueue INTO vSchemaName, vTableName, vRetentionDays; + IF vDone THEN + LEAVE l; + END IF; + IF vRetentionDays THEN - - UPDATE logCleanMultiConfig - SET `started` = util.VN_NOW() - WHERE schemaName = vSchemaName - AND tableName = vTableName; - - SET vSchemaName = util.quoteIdentifier(vSchemaName); - SET vTableName = util.quoteIdentifier(vTableName); + SET vStarted = util.VN_NOW(); SET vDated = VN_CURDATE() - INTERVAL vRetentionDays DAY; - IF vDone THEN - LEAVE l; - END IF; - CALL util.exec(CONCAT( - 'DELETE FROM ', vSchemaName , '.', vTableName, + 'DELETE FROM ', util.quoteIdentifier(vSchemaName), + '.', util.quoteIdentifier(vTableName), " WHERE creationDate < '", vDated, "'" )); UPDATE logCleanMultiConfig - SET `finished` = util.VN_NOW() + SET `started` = vStarted, + `finished` = VN_NOW() WHERE schemaName = vSchemaName AND tableName = vTableName; END IF; diff --git a/db/versions/11107-pinkAspidistra/00-firstScript.sql b/db/versions/11107-pinkAspidistra/00-firstScript.sql index a1c4bb82f..3ed3df526 100644 --- a/db/versions/11107-pinkAspidistra/00-firstScript.sql +++ b/db/versions/11107-pinkAspidistra/00-firstScript.sql @@ -8,25 +8,25 @@ CREATE OR REPLACE TABLE `util`.`logCleanMultiConfig` ( PRIMARY KEY (`schemaName`,`tableName`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; -INSERT INTO `util`.`logCleanMultiConfig` (`schemaName`, `tableName`, `retentionDays`, `order`) +INSERT INTO `util`.`logCleanMultiConfig` (`schemaName`, `tableName`) VALUES - ('account', 'roleLog', 'xxx', NULL), - ('account', 'userLog', 'xxx', NULL), - ('vn', 'entryLog', 'xxx', NULL), - ('vn', 'clientLog', 'xxx', NULL), - ('vn', 'itemLog', 'xxx', NULL), - ('vn', 'shelvingLog', 'xxx', NULL), - ('vn', 'workerLog', 'xxx', NULL), - ('vn', 'deviceProductionLog', 'xxx', NULL), - ('vn', 'zoneLog', 'xxx', NULL), - ('vn', 'rateLog', 'xxx', NULL), - ('vn', 'ticketLog', 'xxx', NULL), - ('vn', 'agencyLog', 'xxx', NULL), - ('vn', 'userLog', 'xxx', NULL), - ('vn', 'routeLog', 'xxx', NULL), - ('vn', 'claimLog', 'xxx', NULL), - ('vn', 'supplierLog', 'xxx', NULL), - ('vn', 'invoiceInLog', 'xxx', NULL), - ('vn', 'travelLog', 'xxx', NULL), - ('vn', 'packingSiteDeviceLog', 'xxx', NULL), - ('vn', 'parkingLog', 'xxx', NULL); + ('account', 'roleLog' ), + ('account', 'userLog' ), + ('vn', 'entryLog' ), + ('vn', 'clientLog' ), + ('vn', 'itemLog' ), + ('vn', 'shelvingLog' ), + ('vn', 'workerLog' ), + ('vn', 'deviceProductionLog' ), + ('vn', 'zoneLog' ), + ('vn', 'rateLog' ), + ('vn', 'ticketLog' ), + ('vn', 'agencyLog' ), + ('vn', 'userLog' ), + ('vn', 'routeLog' ), + ('vn', 'claimLog' ), + ('vn', 'supplierLog' ), + ('vn', 'invoiceInLog' ), + ('vn', 'travelLog' ), + ('vn', 'packingSiteDeviceLog' ), + ('vn', 'parkingLog' ); From 11337506298dbd92f92b452ecc0d78e6a6e9bab7 Mon Sep 17 00:00:00 2001 From: guillermo Date: Fri, 19 Jul 2024 09:29:15 +0200 Subject: [PATCH 4/7] feat: #6727 Requested changes --- db/routines/util/procedures/log_clean.sql | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/db/routines/util/procedures/log_clean.sql b/db/routines/util/procedures/log_clean.sql index 765d5dcbc..d490165a4 100644 --- a/db/routines/util/procedures/log_clean.sql +++ b/db/routines/util/procedures/log_clean.sql @@ -6,7 +6,9 @@ BEGIN * dejando únicamente los días de retención configurados. */ DECLARE vSchemaName VARCHAR(65); + DECLARE vSchemaNameQuoted VARCHAR(65); DECLARE vTableName VARCHAR(65); + DECLARE vTableNameQuoted VARCHAR(65); DECLARE vRetentionDays INT; DECLARE vStarted DATETIME; DECLARE vDated DATE; @@ -30,13 +32,15 @@ BEGIN IF vRetentionDays THEN SET vStarted = util.VN_NOW(); + SET vSchemaNameQuoted = util.quoteIdentifier(vSchemaName); + SET vTableNameQuoted = util.quoteIdentifier(vTableName); SET vDated = VN_CURDATE() - INTERVAL vRetentionDays DAY; - CALL util.exec(CONCAT( - 'DELETE FROM ', util.quoteIdentifier(vSchemaName), - '.', util.quoteIdentifier(vTableName), + EXECUTE IMMEDIATE CONCAT( + 'DELETE FROM ', vSchemaNameQuoted, + '.', vTableNameQuoted, " WHERE creationDate < '", vDated, "'" - )); + ); UPDATE logCleanMultiConfig SET `started` = vStarted, From c94ca96226efc19101d07625ec9bf00cb2697125 Mon Sep 17 00:00:00 2001 From: guillermo Date: Fri, 19 Jul 2024 09:29:42 +0200 Subject: [PATCH 5/7] feat: #6727 Minor changes --- db/routines/util/procedures/log_clean.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/db/routines/util/procedures/log_clean.sql b/db/routines/util/procedures/log_clean.sql index d490165a4..aeed9dc44 100644 --- a/db/routines/util/procedures/log_clean.sql +++ b/db/routines/util/procedures/log_clean.sql @@ -31,9 +31,9 @@ BEGIN END IF; IF vRetentionDays THEN - SET vStarted = util.VN_NOW(); - SET vSchemaNameQuoted = util.quoteIdentifier(vSchemaName); - SET vTableNameQuoted = util.quoteIdentifier(vTableName); + SET vStarted = VN_NOW(); + SET vSchemaNameQuoted = quoteIdentifier(vSchemaName); + SET vTableNameQuoted = quoteIdentifier(vTableName); SET vDated = VN_CURDATE() - INTERVAL vRetentionDays DAY; EXECUTE IMMEDIATE CONCAT( From 56eb3e093d8058b5e71eb31d54ba51ee61023709 Mon Sep 17 00:00:00 2001 From: guillermo Date: Mon, 9 Sep 2024 09:39:10 +0200 Subject: [PATCH 6/7] feat: refs #6727 Added indexes in creationDate --- .../11107-pinkAspidistra/00-firstScript.sql | 23 ++----------------- .../11107-pinkAspidistra/01-firstScript.sql | 1 + .../11107-pinkAspidistra/02-firstScript.sql | 1 + .../11107-pinkAspidistra/03-firstScript.sql | 1 + .../11107-pinkAspidistra/04-firstScript.sql | 1 + .../11107-pinkAspidistra/05-firstScript.sql | 1 + .../11107-pinkAspidistra/06-firstScript.sql | 1 + .../11107-pinkAspidistra/07-firstScript.sql | 1 + .../11107-pinkAspidistra/08-firstScript.sql | 1 + .../11107-pinkAspidistra/09-firstScript.sql | 1 + .../11107-pinkAspidistra/10-firstScript.sql | 1 + .../11107-pinkAspidistra/11-firstScript.sql | 1 + .../11107-pinkAspidistra/12-firstScript.sql | 1 + .../11107-pinkAspidistra/13-firstScript.sql | 1 + .../11107-pinkAspidistra/14-firstScript.sql | 1 + .../11107-pinkAspidistra/15-firstScript.sql | 1 + .../11107-pinkAspidistra/16-firstScript.sql | 1 + .../11107-pinkAspidistra/17-firstScript.sql | 1 + .../11107-pinkAspidistra/18-firstScript.sql | 1 + .../11107-pinkAspidistra/19-firstScript.sql | 1 + .../11107-pinkAspidistra/20-firstScript.sql | 1 + .../11107-pinkAspidistra/21-firstScript.sql | 1 + .../11107-pinkAspidistra/22-firstScript.sql | 1 + .../11107-pinkAspidistra/23-firstScript.sql | 1 + .../11107-pinkAspidistra/24-firstScript.sql | 1 + 25 files changed, 26 insertions(+), 21 deletions(-) create mode 100644 db/versions/11107-pinkAspidistra/01-firstScript.sql create mode 100644 db/versions/11107-pinkAspidistra/02-firstScript.sql create mode 100644 db/versions/11107-pinkAspidistra/03-firstScript.sql create mode 100644 db/versions/11107-pinkAspidistra/04-firstScript.sql create mode 100644 db/versions/11107-pinkAspidistra/05-firstScript.sql create mode 100644 db/versions/11107-pinkAspidistra/06-firstScript.sql create mode 100644 db/versions/11107-pinkAspidistra/07-firstScript.sql create mode 100644 db/versions/11107-pinkAspidistra/08-firstScript.sql create mode 100644 db/versions/11107-pinkAspidistra/09-firstScript.sql create mode 100644 db/versions/11107-pinkAspidistra/10-firstScript.sql create mode 100644 db/versions/11107-pinkAspidistra/11-firstScript.sql create mode 100644 db/versions/11107-pinkAspidistra/12-firstScript.sql create mode 100644 db/versions/11107-pinkAspidistra/13-firstScript.sql create mode 100644 db/versions/11107-pinkAspidistra/14-firstScript.sql create mode 100644 db/versions/11107-pinkAspidistra/15-firstScript.sql create mode 100644 db/versions/11107-pinkAspidistra/16-firstScript.sql create mode 100644 db/versions/11107-pinkAspidistra/17-firstScript.sql create mode 100644 db/versions/11107-pinkAspidistra/18-firstScript.sql create mode 100644 db/versions/11107-pinkAspidistra/19-firstScript.sql create mode 100644 db/versions/11107-pinkAspidistra/20-firstScript.sql create mode 100644 db/versions/11107-pinkAspidistra/21-firstScript.sql create mode 100644 db/versions/11107-pinkAspidistra/22-firstScript.sql create mode 100644 db/versions/11107-pinkAspidistra/23-firstScript.sql create mode 100644 db/versions/11107-pinkAspidistra/24-firstScript.sql diff --git a/db/versions/11107-pinkAspidistra/00-firstScript.sql b/db/versions/11107-pinkAspidistra/00-firstScript.sql index 3ed3df526..62af9c306 100644 --- a/db/versions/11107-pinkAspidistra/00-firstScript.sql +++ b/db/versions/11107-pinkAspidistra/00-firstScript.sql @@ -9,24 +9,5 @@ CREATE OR REPLACE TABLE `util`.`logCleanMultiConfig` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; INSERT INTO `util`.`logCleanMultiConfig` (`schemaName`, `tableName`) - VALUES - ('account', 'roleLog' ), - ('account', 'userLog' ), - ('vn', 'entryLog' ), - ('vn', 'clientLog' ), - ('vn', 'itemLog' ), - ('vn', 'shelvingLog' ), - ('vn', 'workerLog' ), - ('vn', 'deviceProductionLog' ), - ('vn', 'zoneLog' ), - ('vn', 'rateLog' ), - ('vn', 'ticketLog' ), - ('vn', 'agencyLog' ), - ('vn', 'userLog' ), - ('vn', 'routeLog' ), - ('vn', 'claimLog' ), - ('vn', 'supplierLog' ), - ('vn', 'invoiceInLog' ), - ('vn', 'travelLog' ), - ('vn', 'packingSiteDeviceLog' ), - ('vn', 'parkingLog' ); + SELECT TABLE_SCHEMA, TABLE_NAME FROM information_schema.`COLUMNS` + WHERE COLUMN_NAME IN ('newInstance', 'newInstance'); diff --git a/db/versions/11107-pinkAspidistra/01-firstScript.sql b/db/versions/11107-pinkAspidistra/01-firstScript.sql new file mode 100644 index 000000000..426fcc5b8 --- /dev/null +++ b/db/versions/11107-pinkAspidistra/01-firstScript.sql @@ -0,0 +1 @@ +CREATE INDEX userLog_creationDate_IDX USING BTREE ON account.userLog (creationDate DESC); diff --git a/db/versions/11107-pinkAspidistra/02-firstScript.sql b/db/versions/11107-pinkAspidistra/02-firstScript.sql new file mode 100644 index 000000000..e916754e3 --- /dev/null +++ b/db/versions/11107-pinkAspidistra/02-firstScript.sql @@ -0,0 +1 @@ +CREATE INDEX roleLog_creationDate_IDX USING BTREE ON account.roleLog (creationDate DESC); \ No newline at end of file diff --git a/db/versions/11107-pinkAspidistra/03-firstScript.sql b/db/versions/11107-pinkAspidistra/03-firstScript.sql new file mode 100644 index 000000000..f7400c866 --- /dev/null +++ b/db/versions/11107-pinkAspidistra/03-firstScript.sql @@ -0,0 +1 @@ +CREATE INDEX ACLLog_creationDate_IDX USING BTREE ON salix.ACLLog (creationDate DESC); \ No newline at end of file diff --git a/db/versions/11107-pinkAspidistra/04-firstScript.sql b/db/versions/11107-pinkAspidistra/04-firstScript.sql new file mode 100644 index 000000000..0c118284e --- /dev/null +++ b/db/versions/11107-pinkAspidistra/04-firstScript.sql @@ -0,0 +1 @@ +CREATE INDEX supplierLog_creationDate_IDX USING BTREE ON vn.supplierLog (creationDate DESC); \ No newline at end of file diff --git a/db/versions/11107-pinkAspidistra/05-firstScript.sql b/db/versions/11107-pinkAspidistra/05-firstScript.sql new file mode 100644 index 000000000..5cb4070bb --- /dev/null +++ b/db/versions/11107-pinkAspidistra/05-firstScript.sql @@ -0,0 +1 @@ +CREATE INDEX deviceProductionLog_creationDate_IDX USING BTREE ON vn.deviceProductionLog (creationDate DESC); \ No newline at end of file diff --git a/db/versions/11107-pinkAspidistra/06-firstScript.sql b/db/versions/11107-pinkAspidistra/06-firstScript.sql new file mode 100644 index 000000000..332b8a60a --- /dev/null +++ b/db/versions/11107-pinkAspidistra/06-firstScript.sql @@ -0,0 +1 @@ +CREATE INDEX routeLog_creationDate_IDX USING BTREE ON vn.routeLog (creationDate DESC); \ No newline at end of file diff --git a/db/versions/11107-pinkAspidistra/07-firstScript.sql b/db/versions/11107-pinkAspidistra/07-firstScript.sql new file mode 100644 index 000000000..b80f8b75f --- /dev/null +++ b/db/versions/11107-pinkAspidistra/07-firstScript.sql @@ -0,0 +1 @@ +CREATE INDEX itemLog_creationDate_IDX USING BTREE ON vn.itemLog (creationDate DESC); \ No newline at end of file diff --git a/db/versions/11107-pinkAspidistra/08-firstScript.sql b/db/versions/11107-pinkAspidistra/08-firstScript.sql new file mode 100644 index 000000000..315f9b256 --- /dev/null +++ b/db/versions/11107-pinkAspidistra/08-firstScript.sql @@ -0,0 +1 @@ +CREATE INDEX userLog_creationDate_IDX USING BTREE ON vn.userLog (creationDate DESC); \ No newline at end of file diff --git a/db/versions/11107-pinkAspidistra/09-firstScript.sql b/db/versions/11107-pinkAspidistra/09-firstScript.sql new file mode 100644 index 000000000..7bb604915 --- /dev/null +++ b/db/versions/11107-pinkAspidistra/09-firstScript.sql @@ -0,0 +1 @@ +CREATE INDEX invoiceInLog_creationDate_IDX USING BTREE ON vn.invoiceInLog (creationDate DESC); \ No newline at end of file diff --git a/db/versions/11107-pinkAspidistra/10-firstScript.sql b/db/versions/11107-pinkAspidistra/10-firstScript.sql new file mode 100644 index 000000000..06e186e0e --- /dev/null +++ b/db/versions/11107-pinkAspidistra/10-firstScript.sql @@ -0,0 +1 @@ +CREATE INDEX zoneLog_creationDate_IDX USING BTREE ON vn.zoneLog (creationDate DESC); \ No newline at end of file diff --git a/db/versions/11107-pinkAspidistra/11-firstScript.sql b/db/versions/11107-pinkAspidistra/11-firstScript.sql new file mode 100644 index 000000000..be539e7b0 --- /dev/null +++ b/db/versions/11107-pinkAspidistra/11-firstScript.sql @@ -0,0 +1 @@ +CREATE INDEX clientLog_creationDate_IDX USING BTREE ON vn.clientLog (creationDate DESC); \ No newline at end of file diff --git a/db/versions/11107-pinkAspidistra/12-firstScript.sql b/db/versions/11107-pinkAspidistra/12-firstScript.sql new file mode 100644 index 000000000..4abc284b6 --- /dev/null +++ b/db/versions/11107-pinkAspidistra/12-firstScript.sql @@ -0,0 +1 @@ +CREATE INDEX workerLog_creationDate_IDX USING BTREE ON vn.workerLog (creationDate DESC); \ No newline at end of file diff --git a/db/versions/11107-pinkAspidistra/13-firstScript.sql b/db/versions/11107-pinkAspidistra/13-firstScript.sql new file mode 100644 index 000000000..cc901e13c --- /dev/null +++ b/db/versions/11107-pinkAspidistra/13-firstScript.sql @@ -0,0 +1 @@ +CREATE INDEX ticketLog_creationDate_IDX USING BTREE ON vn.ticketLog (creationDate DESC); \ No newline at end of file diff --git a/db/versions/11107-pinkAspidistra/14-firstScript.sql b/db/versions/11107-pinkAspidistra/14-firstScript.sql new file mode 100644 index 000000000..02d2a37b0 --- /dev/null +++ b/db/versions/11107-pinkAspidistra/14-firstScript.sql @@ -0,0 +1 @@ +CREATE INDEX rateLog_creationDate_IDX USING BTREE ON vn.rateLog (creationDate DESC); \ No newline at end of file diff --git a/db/versions/11107-pinkAspidistra/15-firstScript.sql b/db/versions/11107-pinkAspidistra/15-firstScript.sql new file mode 100644 index 000000000..ad75ff6d0 --- /dev/null +++ b/db/versions/11107-pinkAspidistra/15-firstScript.sql @@ -0,0 +1 @@ +CREATE INDEX claimLog_creationDate_IDX USING BTREE ON vn.claimLog (creationDate DESC); \ No newline at end of file diff --git a/db/versions/11107-pinkAspidistra/16-firstScript.sql b/db/versions/11107-pinkAspidistra/16-firstScript.sql new file mode 100644 index 000000000..50c7b61a8 --- /dev/null +++ b/db/versions/11107-pinkAspidistra/16-firstScript.sql @@ -0,0 +1 @@ +CREATE INDEX saleGroupLog_creationDate_IDX USING BTREE ON vn.saleGroupLog (creationDate DESC); \ No newline at end of file diff --git a/db/versions/11107-pinkAspidistra/17-firstScript.sql b/db/versions/11107-pinkAspidistra/17-firstScript.sql new file mode 100644 index 000000000..3de084bcf --- /dev/null +++ b/db/versions/11107-pinkAspidistra/17-firstScript.sql @@ -0,0 +1 @@ +CREATE INDEX packingSiteDeviceLog_creationDate_IDX USING BTREE ON vn.packingSiteDeviceLog (creationDate DESC); \ No newline at end of file diff --git a/db/versions/11107-pinkAspidistra/18-firstScript.sql b/db/versions/11107-pinkAspidistra/18-firstScript.sql new file mode 100644 index 000000000..1181f8263 --- /dev/null +++ b/db/versions/11107-pinkAspidistra/18-firstScript.sql @@ -0,0 +1 @@ +CREATE INDEX travelLog_creationDate_IDX USING BTREE ON vn.travelLog (creationDate DESC); \ No newline at end of file diff --git a/db/versions/11107-pinkAspidistra/19-firstScript.sql b/db/versions/11107-pinkAspidistra/19-firstScript.sql new file mode 100644 index 000000000..e95f93031 --- /dev/null +++ b/db/versions/11107-pinkAspidistra/19-firstScript.sql @@ -0,0 +1 @@ +CREATE INDEX shelvingLog_creationDate_IDX USING BTREE ON vn.shelvingLog (creationDate DESC); \ No newline at end of file diff --git a/db/versions/11107-pinkAspidistra/20-firstScript.sql b/db/versions/11107-pinkAspidistra/20-firstScript.sql new file mode 100644 index 000000000..d3598466d --- /dev/null +++ b/db/versions/11107-pinkAspidistra/20-firstScript.sql @@ -0,0 +1 @@ +CREATE INDEX productionConfigLog_creationDate_IDX USING BTREE ON vn.productionConfigLog (creationDate DESC); \ No newline at end of file diff --git a/db/versions/11107-pinkAspidistra/21-firstScript.sql b/db/versions/11107-pinkAspidistra/21-firstScript.sql new file mode 100644 index 000000000..5db8d3c63 --- /dev/null +++ b/db/versions/11107-pinkAspidistra/21-firstScript.sql @@ -0,0 +1 @@ +CREATE INDEX entryLog_creationDate_IDX USING BTREE ON vn.entryLog (creationDate DESC); \ No newline at end of file diff --git a/db/versions/11107-pinkAspidistra/22-firstScript.sql b/db/versions/11107-pinkAspidistra/22-firstScript.sql new file mode 100644 index 000000000..91e68c43b --- /dev/null +++ b/db/versions/11107-pinkAspidistra/22-firstScript.sql @@ -0,0 +1 @@ +CREATE INDEX agencyLog_creationDate_IDX USING BTREE ON vn.agencyLog (creationDate DESC); \ No newline at end of file diff --git a/db/versions/11107-pinkAspidistra/23-firstScript.sql b/db/versions/11107-pinkAspidistra/23-firstScript.sql new file mode 100644 index 000000000..edd79473e --- /dev/null +++ b/db/versions/11107-pinkAspidistra/23-firstScript.sql @@ -0,0 +1 @@ +CREATE INDEX parkingLog_creationDate_IDX USING BTREE ON vn.parkingLog (creationDate DESC); \ No newline at end of file diff --git a/db/versions/11107-pinkAspidistra/24-firstScript.sql b/db/versions/11107-pinkAspidistra/24-firstScript.sql new file mode 100644 index 000000000..81e84c405 --- /dev/null +++ b/db/versions/11107-pinkAspidistra/24-firstScript.sql @@ -0,0 +1 @@ +CREATE INDEX bufferLog_creationDate_IDX USING BTREE ON srt.bufferLog (creationDate DESC); \ No newline at end of file From 261bebbc3bad07ed317bccbf457d80764efe61d3 Mon Sep 17 00:00:00 2001 From: guillermo Date: Mon, 9 Sep 2024 09:41:40 +0200 Subject: [PATCH 7/7] feat: refs #6727 Deleted duplicated indexes --- db/versions/11107-pinkAspidistra/13-firstScript.sql | 1 - .../00-firstScript.sql} | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 db/versions/11107-pinkAspidistra/13-firstScript.sql rename db/versions/{11107-pinkAspidistra/16-firstScript.sql => 11219-goldenCataractarum/00-firstScript.sql} (67%) diff --git a/db/versions/11107-pinkAspidistra/13-firstScript.sql b/db/versions/11107-pinkAspidistra/13-firstScript.sql deleted file mode 100644 index cc901e13c..000000000 --- a/db/versions/11107-pinkAspidistra/13-firstScript.sql +++ /dev/null @@ -1 +0,0 @@ -CREATE INDEX ticketLog_creationDate_IDX USING BTREE ON vn.ticketLog (creationDate DESC); \ No newline at end of file diff --git a/db/versions/11107-pinkAspidistra/16-firstScript.sql b/db/versions/11219-goldenCataractarum/00-firstScript.sql similarity index 67% rename from db/versions/11107-pinkAspidistra/16-firstScript.sql rename to db/versions/11219-goldenCataractarum/00-firstScript.sql index 50c7b61a8..4c4b9eac5 100644 --- a/db/versions/11107-pinkAspidistra/16-firstScript.sql +++ b/db/versions/11219-goldenCataractarum/00-firstScript.sql @@ -1 +1 @@ -CREATE INDEX saleGroupLog_creationDate_IDX USING BTREE ON vn.saleGroupLog (creationDate DESC); \ No newline at end of file +CREATE INDEX saleGroupLog_creationDate_IDX USING BTREE ON vn.saleGroupLog (creationDate DESC);