Skip to content

Commit

Permalink
Stop using LockCol in registrations table (#7935)
Browse files Browse the repository at this point in the history
Alter the `LockCol` column to have a default value, so we can omit it
from `INSERT`s.

Part of #7934
  • Loading branch information
jprenken authored Jan 17, 2025
1 parent dfdf554 commit 6f4eb5a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 0 additions & 1 deletion sa/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ func (log *SQLLogger) Printf(format string, v ...interface{}) {
func initTables(dbMap *borp.DbMap) {
regTable := dbMap.AddTableWithName(regModel{}, "registrations").SetKeys(true, "ID")

regTable.SetVersionCol("LockCol")
regTable.ColMap("Key").SetNotNull(true)
regTable.ColMap("KeySHA256").SetNotNull(true).SetUnique(true)
dbMap.AddTableWithName(issuedNameModel{}, "issuedNames").SetKeys(true, "ID")
Expand Down
10 changes: 10 additions & 0 deletions sa/db-next/boulder_sa/20250110000000_NullRegistrationsLockCol.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

-- +migrate Up
-- SQL in section 'Up' is executed when this migration is applied

ALTER TABLE `registrations` ALTER COLUMN `LockCol` SET DEFAULT 0;

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

ALTER TABLE `registrations` ALTER COLUMN `LockCol` DROP DEFAULT;

0 comments on commit 6f4eb5a

Please sign in to comment.