From 63bab4111028136125c362906461350149c2c5e1 Mon Sep 17 00:00:00 2001 From: Aaron Gable Date: Wed, 31 Jul 2024 11:36:46 -0700 Subject: [PATCH] Move revokedCertificates and replacementOrders into db --- .../20230919000000_RevokedCertificates.sql | 22 +------------------ .../20240119000000_ReplacementOrders.sql | 21 +----------------- .../20230919000000_RevokedCertificates.sql | 21 ++++++++++++++++++ .../20240119000000_ReplacementOrders.sql | 20 +++++++++++++++++ 4 files changed, 43 insertions(+), 41 deletions(-) mode change 100644 => 120000 sa/db-next/boulder_sa/20230919000000_RevokedCertificates.sql mode change 100644 => 120000 sa/db-next/boulder_sa/20240119000000_ReplacementOrders.sql create mode 100644 sa/db/boulder_sa/20230919000000_RevokedCertificates.sql create mode 100644 sa/db/boulder_sa/20240119000000_ReplacementOrders.sql diff --git a/sa/db-next/boulder_sa/20230919000000_RevokedCertificates.sql b/sa/db-next/boulder_sa/20230919000000_RevokedCertificates.sql deleted file mode 100644 index fe86aa71b51..00000000000 --- a/sa/db-next/boulder_sa/20230919000000_RevokedCertificates.sql +++ /dev/null @@ -1,21 +0,0 @@ --- +migrate Up --- SQL in section 'Up' is executed when this migration is applied - -CREATE TABLE `revokedCertificates` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `issuerID` bigint(20) NOT NULL, - `serial` varchar(255) NOT NULL, - `notAfterHour` datetime NOT NULL, - `shardIdx` bigint(20) NOT NULL, - `revokedDate` datetime NOT NULL, - `revokedReason` int(11) NOT NULL, - PRIMARY KEY (`id`), - KEY `issuerID_shardIdx_notAfterHour_idx` (`issuerID`, `shardIdx`, `notAfterHour`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 - PARTITION BY RANGE(id) -(PARTITION p_start VALUES LESS THAN (MAXVALUE)); - --- +migrate Down --- SQL section 'Down' is executed when this migration is rolled back - -DROP TABLE `revokedCertificates`; diff --git a/sa/db-next/boulder_sa/20230919000000_RevokedCertificates.sql b/sa/db-next/boulder_sa/20230919000000_RevokedCertificates.sql new file mode 120000 index 00000000000..8d214007e84 --- /dev/null +++ b/sa/db-next/boulder_sa/20230919000000_RevokedCertificates.sql @@ -0,0 +1 @@ +../../db/boulder_sa/20230919000000_RevokedCertificates.sql \ No newline at end of file diff --git a/sa/db-next/boulder_sa/20240119000000_ReplacementOrders.sql b/sa/db-next/boulder_sa/20240119000000_ReplacementOrders.sql deleted file mode 100644 index c2bc65f9ce2..00000000000 --- a/sa/db-next/boulder_sa/20240119000000_ReplacementOrders.sql +++ /dev/null @@ -1,20 +0,0 @@ --- +migrate Up --- SQL in section 'Up' is executed when this migration is applied - -CREATE TABLE `replacementOrders` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `serial` varchar(255) NOT NULL, - `orderID` bigint(20) NOT NULL, - `orderExpires` datetime NOT NULL, - `replaced` boolean DEFAULT false, - PRIMARY KEY (`id`), - KEY `serial_idx` (`serial`), - KEY `orderID_idx` (`orderID`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 - PARTITION BY RANGE(id) -(PARTITION p_start VALUES LESS THAN (MAXVALUE)); - --- +migrate Down --- SQL section 'Down' is executed when this migration is rolled back - -DROP TABLE `replacementOrders`; diff --git a/sa/db-next/boulder_sa/20240119000000_ReplacementOrders.sql b/sa/db-next/boulder_sa/20240119000000_ReplacementOrders.sql new file mode 120000 index 00000000000..e15b2e6936e --- /dev/null +++ b/sa/db-next/boulder_sa/20240119000000_ReplacementOrders.sql @@ -0,0 +1 @@ +../../db/boulder_sa/20240119000000_ReplacementOrders.sql \ No newline at end of file diff --git a/sa/db/boulder_sa/20230919000000_RevokedCertificates.sql b/sa/db/boulder_sa/20230919000000_RevokedCertificates.sql new file mode 100644 index 00000000000..fe86aa71b51 --- /dev/null +++ b/sa/db/boulder_sa/20230919000000_RevokedCertificates.sql @@ -0,0 +1,21 @@ +-- +migrate Up +-- SQL in section 'Up' is executed when this migration is applied + +CREATE TABLE `revokedCertificates` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `issuerID` bigint(20) NOT NULL, + `serial` varchar(255) NOT NULL, + `notAfterHour` datetime NOT NULL, + `shardIdx` bigint(20) NOT NULL, + `revokedDate` datetime NOT NULL, + `revokedReason` int(11) NOT NULL, + PRIMARY KEY (`id`), + KEY `issuerID_shardIdx_notAfterHour_idx` (`issuerID`, `shardIdx`, `notAfterHour`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 + PARTITION BY RANGE(id) +(PARTITION p_start VALUES LESS THAN (MAXVALUE)); + +-- +migrate Down +-- SQL section 'Down' is executed when this migration is rolled back + +DROP TABLE `revokedCertificates`; diff --git a/sa/db/boulder_sa/20240119000000_ReplacementOrders.sql b/sa/db/boulder_sa/20240119000000_ReplacementOrders.sql new file mode 100644 index 00000000000..c2bc65f9ce2 --- /dev/null +++ b/sa/db/boulder_sa/20240119000000_ReplacementOrders.sql @@ -0,0 +1,20 @@ +-- +migrate Up +-- SQL in section 'Up' is executed when this migration is applied + +CREATE TABLE `replacementOrders` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `serial` varchar(255) NOT NULL, + `orderID` bigint(20) NOT NULL, + `orderExpires` datetime NOT NULL, + `replaced` boolean DEFAULT false, + PRIMARY KEY (`id`), + KEY `serial_idx` (`serial`), + KEY `orderID_idx` (`orderID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 + PARTITION BY RANGE(id) +(PARTITION p_start VALUES LESS THAN (MAXVALUE)); + +-- +migrate Down +-- SQL section 'Down' is executed when this migration is rolled back + +DROP TABLE `replacementOrders`;