Move revokedCertificates and replacementOrders into db (#7639)

These database schema changes were applied in prod in IN-9706 and
IN-10081.
This commit is contained in:
Aaron Gable 2024-08-01 10:01:59 -07:00 committed by GitHub
parent 7b6935d223
commit a61aadc9e4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 43 additions and 41 deletions

View File

@ -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`;

View File

@ -0,0 +1 @@
../../db/boulder_sa/20230919000000_RevokedCertificates.sql

View File

@ -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`;

View File

@ -0,0 +1 @@
../../db/boulder_sa/20240119000000_ReplacementOrders.sql

View File

@ -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`;

View File

@ -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`;