@@ -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
}}
}
@@ -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
- }}
-}
@@ -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
@@ -40,7 +40,7 @@ type upgrade struct {
fn upgradeFunc
-const NumberOfUpgrades = 47
+const NumberOfUpgrades = 46
var upgrades [NumberOfUpgrades]upgrade