Stop using LockCol in registrations table (#7935)

Alter the `LockCol` column to have a default value, so we can omit it
from `INSERT`s.

Part of #7934
This commit is contained in:
James Renken 2025-01-17 12:41:11 -08:00 committed by GitHub
parent dfdf554f76
commit 6f4eb5a2e1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 1 deletions

View File

@ -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")

View File

@ -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;