2022-04-29-backfillqueue-type-order.go 372 B

1234567891011121314151617181920
  1. package upgrades
  2. import (
  3. "database/sql"
  4. )
  5. func init() {
  6. upgrades[41] = upgrade{"Update backfill queue tables to be sortable by priority", func(tx *sql.Tx, ctx context) error {
  7. _, err := tx.Exec(`
  8. UPDATE backfill_queue
  9. SET type=CASE
  10. WHEN type=1 THEN 200
  11. WHEN type=2 THEN 300
  12. ELSE type
  13. END
  14. WHERE type=1 OR type=2
  15. `)
  16. return err
  17. }}
  18. }