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:
parent
dfdf554f76
commit
6f4eb5a2e1
|
|
@ -265,7 +265,6 @@ func (log *SQLLogger) Printf(format string, v ...interface{}) {
|
||||||
func initTables(dbMap *borp.DbMap) {
|
func initTables(dbMap *borp.DbMap) {
|
||||||
regTable := dbMap.AddTableWithName(regModel{}, "registrations").SetKeys(true, "ID")
|
regTable := dbMap.AddTableWithName(regModel{}, "registrations").SetKeys(true, "ID")
|
||||||
|
|
||||||
regTable.SetVersionCol("LockCol")
|
|
||||||
regTable.ColMap("Key").SetNotNull(true)
|
regTable.ColMap("Key").SetNotNull(true)
|
||||||
regTable.ColMap("KeySHA256").SetNotNull(true).SetUnique(true)
|
regTable.ColMap("KeySHA256").SetNotNull(true).SetUnique(true)
|
||||||
dbMap.AddTableWithName(issuedNameModel{}, "issuedNames").SetKeys(true, "ID")
|
dbMap.AddTableWithName(issuedNameModel{}, "issuedNames").SetKeys(true, "ID")
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
Loading…
Reference in New Issue