Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-- +migrate Up
-- SQL in section 'Up' is executed when this migration is applied

ALTER TABLE `revokedCertificates` ADD KEY `serial` (`serial`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: I'd expected to see ADD UNIQUE KEY. But, if I'm remembering correctly, with partitioning we can't use UNIQUE KEYs other than the primary one. So for instance certificateStatus has a KEY on serial but not a UNIQUE one.

For certificateStatus we deal with that by using an UPDATE. That code also protects revokedCertificates from having duplicates. As we switch to revokedCertificates we'll want to make sure that revocations open a transaction, do a SELECT to make sure the row doesn't yet exist, and then INSERT.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, and I'll do that handling in #8408


-- +migrate Down
-- SQL section 'Down' is executed when this migration is rolled back

ALTER TABLE `revokedCertificates` DROP KEY `serial`;