set a dummy convoy for all blanks

This commit is contained in:
Ted Unangst 2019-10-12 23:36:43 -04:00
parent d357480a1f
commit 49a5b2ca8b
2 changed files with 5 additions and 2 deletions

View File

@ -269,7 +269,10 @@ func upgradedb() {
doordie(db, "update config set value = 24 where key = 'dbversion'") doordie(db, "update config set value = 24 where key = 'dbversion'")
fallthrough fallthrough
case 24: 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: default:
log.Fatalf("can't upgrade unknown version %d", dbversion) log.Fatalf("can't upgrade unknown version %d", dbversion)
} }

View File

@ -74,7 +74,7 @@ var alreadyopendb *sql.DB
var dbname = "honk.db" var dbname = "honk.db"
var blobdbname = "blob.db" var blobdbname = "blob.db"
var stmtConfig *sql.Stmt var stmtConfig *sql.Stmt
var myVersion = 24 var myVersion = 25
func initdb() { func initdb() {
schema, err := ioutil.ReadFile("schema.sql") schema, err := ioutil.ReadFile("schema.sql")