Skip to content

Commit

Permalink
Stop using LockCol in registrations table
Browse files Browse the repository at this point in the history
Alter the `LockCol` column to be nullable, so that we can stop using it.
  • Loading branch information
jprenken committed Jan 11, 2025
1 parent 7209bc2 commit e366dcc
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` BIGINT(20) DEFAULT 0;

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

ALTER TABLE `registrations` ALTER COLUMN `LockCol` BIGINT(20) NOT NULL;

0 comments on commit e366dcc

Please sign in to comment.