From 49a5b2ca8bada38b55cbb8d6ea606edf4d11b8ca Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Sat, 12 Oct 2019 23:36:43 -0400 Subject: [PATCH] set a dummy convoy for all blanks --- upgradedb.go | 5 ++++- util.go | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/upgradedb.go b/upgradedb.go index f9d8165..268bc06 100644 --- a/upgradedb.go +++ b/upgradedb.go @@ -269,7 +269,10 @@ func upgradedb() { doordie(db, "update config set value = 24 where key = 'dbversion'") fallthrough case 24: - + doordie(db, "update honks set convoy = 'missing-' || abs(random() % 987654321) where convoy = ''") + doordie(db, "update config set value = 25 where key = 'dbversion'") + fallthrough + case 25: default: log.Fatalf("can't upgrade unknown version %d", dbversion) } diff --git a/util.go b/util.go index feed1d0..b140706 100644 --- a/util.go +++ b/util.go @@ -74,7 +74,7 @@ var alreadyopendb *sql.DB var dbname = "honk.db" var blobdbname = "blob.db" var stmtConfig *sql.Stmt -var myVersion = 24 +var myVersion = 25 func initdb() { schema, err := ioutil.ReadFile("schema.sql")