database: combine backfill queue upgrades together

This commit is contained in:
Sumner Evans 2022-05-16 17:09:47 -06:00
parent df46ca99f9
commit 54f3e8a439
No known key found for this signature in database
GPG key ID: 8904527AB50022FD
4 changed files with 11 additions and 18 deletions

View file

@ -20,6 +20,15 @@ func init() {
UPDATE backfill_queue
SET dispatch_time=completed_at
`)
if err != nil {
return err
}
// Remove time_end from the backfill queue
_, err = tx.Exec(`
ALTER TABLE backfill_queue
DROP COLUMN time_end
`)
return err
}}
}

View file

@ -1,16 +0,0 @@
package upgrades
import (
"database/sql"
)
func init() {
upgrades[45] = upgrade{"Add dispatch time to backfill queue", func(tx *sql.Tx, ctx context) error {
// First, add dispatch_time TIMESTAMP column
_, err := tx.Exec(`
ALTER TABLE backfill_queue
DROP COLUMN time_end
`)
return err
}}
}

View file

@ -5,7 +5,7 @@ import (
)
func init() {
upgrades[46] = upgrade{"Add inserted time to history sync message", func(tx *sql.Tx, ctx context) error {
upgrades[45] = upgrade{"Add inserted time to history sync message", func(tx *sql.Tx, ctx context) error {
// Add the inserted time TIMESTAMP column to history_sync_message
_, err := tx.Exec(`
ALTER TABLE history_sync_message

View file

@ -40,7 +40,7 @@ type upgrade struct {
fn upgradeFunc
}
const NumberOfUpgrades = 47
const NumberOfUpgrades = 46
var upgrades [NumberOfUpgrades]upgrade