Skip to content

Commit

Permalink
Move revokedCertificates and replacementOrders into db (#7639)
Browse files Browse the repository at this point in the history
These database schema changes were applied in prod in IN-9706 and
IN-10081.
  • Loading branch information
aarongable authored Aug 1, 2024
1 parent 7b6935d commit a61aadc
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 41 deletions.
21 changes: 0 additions & 21 deletions sa/db-next/boulder_sa/20230919000000_RevokedCertificates.sql

This file was deleted.

20 changes: 0 additions & 20 deletions sa/db-next/boulder_sa/20240119000000_ReplacementOrders.sql

This file was deleted.

1 change: 1 addition & 0 deletions sa/db-next/boulder_sa/20240119000000_ReplacementOrders.sql
21 changes: 21 additions & 0 deletions sa/db/boulder_sa/20230919000000_RevokedCertificates.sql
Original file line number Diff line number Diff line change
@@ -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`;
20 changes: 20 additions & 0 deletions sa/db/boulder_sa/20240119000000_ReplacementOrders.sql
Original file line number Diff line number Diff line change
@@ -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`;

0 comments on commit a61aadc

Please sign in to comment.