Skip to content

Commit 16cfacd

Browse files
authored
Add current datetime column to orderFqdnSets and authz2 tables (#8512)
The new "created" column is always populated by the current time, indicating when the row was created. We do this directly inside the database, rather than in the Go data model, because Boulder doesn't actually care when these rows were created. Instead, we care about the creation timestamp for the purpose of creating and dropping partitions to manage our total data size. Previously we've been partitioning these tables based on their `expires` column. But that column is no longer a good proxy for when the row was created, because not all certificates/orders/authzs have the same lifetime anymore. Example after an integration test run: ```mysql MariaDB [boulder_sa_integration]> select id,created,expires from orderFqdnSets limit 5; +----+---------------------+---------------------+ | id | created | expires | +----+---------------------+---------------------+ | 1 | 2025-12-04 00:49:10 | 2025-12-11 00:49:10 | | 3 | 2025-12-04 00:49:12 | 2025-12-11 00:49:12 | | 6 | 2025-12-04 00:49:17 | 2025-12-11 00:49:17 | | 9 | 2025-12-04 00:49:23 | 2025-12-11 00:49:23 | | 10 | 2025-12-04 00:49:24 | 2025-12-11 00:49:24 | +----+---------------------+---------------------+ 5 rows in set (0.000 sec) ``` IN-12028 tracks the corresponding SRE-side changes
1 parent 978877a commit 16cfacd

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
-- +migrate Up
2+
-- SQL in section 'Up' is executed when this migration is applied
3+
4+
ALTER TABLE `authz2` ADD COLUMN `created` datetime DEFAULT CURRENT_TIMESTAMP;
5+
ALTER TABLE `orderFqdnSets` ADD COLUMN `created` datetime DEFAULT CURRENT_TIMESTAMP;
6+
7+
-- +migrate Down
8+
-- SQL section 'Down' is executed when this migration is rolled back
9+
10+
ALTER TABLE `authz2` DROP COLUMN `created`;
11+
ALTER TABLE `orderFqdnSets` DROP COLUMN `created`;

0 commit comments

Comments
 (0)