-
-
Notifications
You must be signed in to change notification settings - Fork 635
vitess: add vschemas with vindexes #8634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
4672219
vitess: add vschemas with vindexes
jsha 3c1f1de
Update BOULDER_VTCOMBOSERVER_TAG
jsha a263b10
Fix SQL schemas
jsha e55465a
Install trigger for both DBs
jsha f5869e3
Revert diff between schemas
jsha bf9d76b
Reduce duplication of schemas
jsha 95a5619
Automatically create Vitess SQL
jsha b65f903
Merge remote-tracking branch 'origin/main' into vschemas-and-vindexes
jsha db3edd6
Bump vtcomboserver tag
jsha 0baaad5
Rename ql->sql
jsha e2c0210
02-26a
jsha 6a2fa1e
Change limitEnum_bucketKey to a PRIMARY KEY
jsha 60063b3
Review feedback
jsha 02d7180
invert-match
jsha 71c4a99
bump tag
jsha 5ce8741
integration: make TestRevocation less parallel
jsha 36b9eb3
Review feedback
jsha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
sa/db-next/boulder_sa/20230419000001_DropCertStatusSubscriberApproved.sql
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
sa/db-next/boulder_sa/20230419000002_DropCertStatusLockCol.sql
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
sa/db-next/boulder_sa/20250708000000_DropRegistrationsLockCol.sql
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
sa/db-next/boulder_sa/20251002000000_AddRevokedSerialsIndex.sql
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| CREATE DATABASE boulder_sa; | ||
| CREATE DATABASE incidents_sa; | ||
| CREATE DATABASE boulder_sa_next; | ||
| CREATE DATABASE incidents_sa_next; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,240 @@ | ||
| USE boulder_sa; | ||
|
|
||
| CREATE TABLE `authz2` ( | ||
| `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, | ||
| `identifierType` tinyint(4) NOT NULL, | ||
| `identifierValue` varchar(255) NOT NULL, | ||
| `registrationID` bigint(20) NOT NULL, | ||
| `status` tinyint(4) NOT NULL, | ||
| `expires` datetime NOT NULL, | ||
| `challenges` tinyint(4) NOT NULL, | ||
| `attempted` tinyint(4) DEFAULT NULL, | ||
| `attemptedAt` datetime DEFAULT NULL, | ||
| `token` binary(32) NOT NULL, | ||
| `validationError` mediumblob DEFAULT NULL, | ||
| `validationRecord` mediumblob DEFAULT NULL, | ||
| `certificateProfileName` varchar(32) DEFAULT NULL, | ||
| `created` datetime DEFAULT current_timestamp(), | ||
| PRIMARY KEY (`id`), | ||
| KEY `regID_expires_idx` (`registrationID`,`status`,`expires`), | ||
| KEY `regID_identifier_status_expires_idx` (`registrationID`,`identifierType`,`identifierValue`,`status`,`expires`), | ||
| KEY `expires_idx` (`expires`) | ||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; | ||
|
|
||
| CREATE TABLE `blockedKeys` ( | ||
| `id` bigint(20) NOT NULL AUTO_INCREMENT, | ||
| `keyHash` binary(32) NOT NULL, | ||
| `added` datetime NOT NULL, | ||
| `source` tinyint(4) NOT NULL, | ||
| `comment` varchar(255) DEFAULT NULL, | ||
| `revokedBy` bigint(20) DEFAULT 0, | ||
| `extantCertificatesChecked` tinyint(1) DEFAULT 0, | ||
| PRIMARY KEY (`id`), | ||
| UNIQUE KEY `keyHash` (`keyHash`), | ||
| KEY `extantCertificatesChecked_idx` (`extantCertificatesChecked`) | ||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; | ||
|
|
||
| CREATE TABLE `certificateStatus` ( | ||
| `id` bigint(20) NOT NULL AUTO_INCREMENT, | ||
| `serial` varchar(255) NOT NULL, | ||
| `subscriberApproved` tinyint(1) DEFAULT 0, | ||
| `status` varchar(255) NOT NULL, | ||
| `ocspLastUpdated` datetime NOT NULL, | ||
| `revokedDate` datetime NOT NULL, | ||
| `revokedReason` int(11) NOT NULL, | ||
| `lastExpirationNagSent` datetime NOT NULL, | ||
| `LockCol` bigint(20) DEFAULT 0, | ||
| `ocspResponse` blob DEFAULT NULL, | ||
| `notAfter` datetime DEFAULT NULL, | ||
| `isExpired` tinyint(1) DEFAULT 0, | ||
| `issuerID` bigint(20) DEFAULT NULL, | ||
| PRIMARY KEY (`id`), | ||
| KEY `isExpired_ocspLastUpdated_idx` (`isExpired`,`ocspLastUpdated`), | ||
| KEY `notAfter_idx` (`notAfter`), | ||
| KEY `serial` (`serial`) | ||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; | ||
|
|
||
| CREATE TABLE `certificates` ( | ||
| `id` bigint(20) NOT NULL AUTO_INCREMENT, | ||
| `registrationID` bigint(20) NOT NULL, | ||
| `serial` varchar(255) NOT NULL, | ||
| `digest` varchar(255) NOT NULL, | ||
| `der` mediumblob NOT NULL, | ||
| `issued` datetime NOT NULL, | ||
| `expires` datetime NOT NULL, | ||
| PRIMARY KEY (`id`), | ||
| KEY `regId_certificates_idx` (`registrationID`) COMMENT 'Common lookup', | ||
| KEY `issued_idx` (`issued`), | ||
| KEY `serial` (`serial`) | ||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; | ||
|
|
||
| CREATE TABLE `crlShards` ( | ||
| `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, | ||
| `issuerID` bigint(20) NOT NULL, | ||
| `idx` int(10) unsigned NOT NULL, | ||
| `thisUpdate` datetime DEFAULT NULL, | ||
| `nextUpdate` datetime DEFAULT NULL, | ||
| `leasedUntil` datetime NOT NULL, | ||
| PRIMARY KEY (`id`), | ||
| UNIQUE KEY `shardID` (`issuerID`,`idx`) | ||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; | ||
|
|
||
| CREATE TABLE `crls` ( | ||
| `serial` varchar(255) NOT NULL, | ||
| `createdAt` datetime NOT NULL, | ||
| `crl` varchar(255) NOT NULL, | ||
| PRIMARY KEY (`serial`) | ||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; | ||
|
|
||
| CREATE TABLE `fqdnSets` ( | ||
| `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, | ||
| `setHash` binary(32) NOT NULL, | ||
| `serial` varchar(255) NOT NULL, | ||
| `issued` datetime NOT NULL, | ||
| `expires` datetime NOT NULL, | ||
| PRIMARY KEY (`id`), | ||
| KEY `setHash_issued_idx` (`setHash`,`issued`), | ||
| KEY `serial` (`serial`) | ||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; | ||
|
|
||
| CREATE TABLE `incidents` ( | ||
| `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, | ||
| `serialTable` varchar(128) NOT NULL, | ||
| `url` varchar(1024) NOT NULL, | ||
| `renewBy` datetime NOT NULL, | ||
| `enabled` tinyint(1) DEFAULT 0, | ||
| PRIMARY KEY (`id`) | ||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; | ||
|
|
||
| CREATE TABLE `issuedNames` ( | ||
| `id` bigint(20) NOT NULL AUTO_INCREMENT, | ||
| `reversedName` varchar(640) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL, | ||
| `notBefore` datetime NOT NULL, | ||
| `serial` varchar(255) NOT NULL, | ||
| `renewal` tinyint(1) NOT NULL DEFAULT 0, | ||
| PRIMARY KEY (`id`), | ||
| KEY `reversedName_notBefore_Idx` (`reversedName`,`notBefore`) | ||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; | ||
|
|
||
| CREATE TABLE `keyHashToSerial` ( | ||
| `id` bigint(20) NOT NULL AUTO_INCREMENT, | ||
| `keyHash` binary(32) NOT NULL, | ||
| `certNotAfter` datetime NOT NULL, | ||
| `certSerial` varchar(255) NOT NULL, | ||
| PRIMARY KEY (`id`), | ||
| UNIQUE KEY `unique_keyHash_certserial` (`keyHash`,`certSerial`), | ||
| KEY `keyHash_certNotAfter` (`keyHash`,`certNotAfter`) | ||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; | ||
|
|
||
| CREATE TABLE `orderFqdnSets` ( | ||
| `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, | ||
| `setHash` binary(32) NOT NULL, | ||
| `orderID` bigint(20) NOT NULL, | ||
| `registrationID` bigint(20) NOT NULL, | ||
| `expires` datetime NOT NULL, | ||
| `created` datetime DEFAULT current_timestamp(), | ||
| PRIMARY KEY (`id`), | ||
| KEY `setHash_expires_idx` (`setHash`,`expires`), | ||
| KEY `orderID_idx` (`orderID`), | ||
| KEY `orderFqdnSets_registrationID_registrations` (`registrationID`) | ||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; | ||
|
|
||
| CREATE TABLE `orders` ( | ||
| `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, | ||
| `registrationID` bigint(20) NOT NULL, | ||
| `expires` datetime NOT NULL, | ||
| `error` mediumblob DEFAULT NULL, | ||
| `certificateSerial` varchar(255) DEFAULT NULL, | ||
| `beganProcessing` tinyint(1) NOT NULL DEFAULT 0, | ||
| `created` datetime NOT NULL, | ||
| `certificateProfileName` varchar(32) DEFAULT NULL, | ||
| `replaces` varchar(255) DEFAULT NULL, | ||
| `authzs` blob DEFAULT NULL, | ||
| PRIMARY KEY (`id`), | ||
| KEY `reg_expires` (`registrationID`,`expires`), | ||
| KEY `regID_created_idx` (`registrationID`,`created`) | ||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; | ||
|
|
||
| CREATE TABLE `overrides` ( | ||
| `limitEnum` tinyint(4) unsigned NOT NULL, | ||
| `bucketKey` varchar(255) NOT NULL, | ||
| `comment` varchar(255) NOT NULL, | ||
| `periodNS` bigint(20) unsigned NOT NULL, | ||
| `count` int(10) unsigned NOT NULL, | ||
| `burst` int(10) unsigned NOT NULL, | ||
| `updatedAt` datetime NOT NULL, | ||
| `enabled` tinyint(1) NOT NULL DEFAULT 0, | ||
| PRIMARY KEY `limitEnum_bucketKey` (`limitEnum`,`bucketKey`), | ||
| KEY `idx_enabled` (`enabled`) | ||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; | ||
|
|
||
| CREATE TABLE `paused` ( | ||
| `registrationID` bigint(20) unsigned NOT NULL, | ||
| `identifierType` tinyint(4) NOT NULL, | ||
| `identifierValue` varchar(255) NOT NULL, | ||
| `pausedAt` datetime NOT NULL, | ||
| `unpausedAt` datetime DEFAULT NULL, | ||
| PRIMARY KEY (`registrationID`,`identifierValue`,`identifierType`) | ||
| ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci; | ||
|
|
||
| -- Note: This table's name is a historical artifact and it is now | ||
| -- used to store linting certificates, not precertificates. | ||
| -- See #6807. | ||
| CREATE TABLE `precertificates` ( | ||
| `id` bigint(20) NOT NULL AUTO_INCREMENT, | ||
| `registrationID` bigint(20) NOT NULL, | ||
| `serial` varchar(255) NOT NULL, | ||
| `der` mediumblob NOT NULL, | ||
| `issued` datetime NOT NULL, | ||
| `expires` datetime NOT NULL, | ||
| PRIMARY KEY (`id`), | ||
| KEY `regId_precertificates_idx` (`registrationID`), | ||
| KEY `issued_precertificates_idx` (`issued`), | ||
| KEY `serial` (`serial`) | ||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; | ||
|
|
||
| CREATE TABLE `registrations` ( | ||
| `id` bigint(20) NOT NULL AUTO_INCREMENT, | ||
| `jwk` mediumblob NOT NULL, | ||
| `jwk_sha256` varchar(255) NOT NULL, | ||
| `agreement` varchar(255) NOT NULL, | ||
| `LockCol` bigint(20) NOT NULL DEFAULT 0, | ||
| `createdAt` datetime NOT NULL, | ||
| `status` varchar(255) NOT NULL DEFAULT 'valid', | ||
| PRIMARY KEY (`id`), | ||
| UNIQUE KEY `jwk_sha256` (`jwk_sha256`) | ||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; | ||
|
|
||
| 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` tinyint(1) DEFAULT 0, | ||
| PRIMARY KEY (`id`), | ||
| KEY `serial_idx` (`serial`), | ||
| KEY `orderID_idx` (`orderID`) | ||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; | ||
|
|
||
| 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 COLLATE=utf8mb4_general_ci; | ||
|
|
||
| CREATE TABLE `serials` ( | ||
| `id` bigint(20) NOT NULL AUTO_INCREMENT, | ||
| `registrationID` bigint(20) NOT NULL, | ||
| `serial` varchar(255) NOT NULL, | ||
| `created` datetime NOT NULL, | ||
| `expires` datetime NOT NULL, | ||
| PRIMARY KEY (`id`), | ||
| UNIQUE KEY `serial` (`serial`), | ||
| KEY `regId_serials_idx` (`registrationID`) | ||
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.