• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1def migrate_up(manager):
2    manager.execute('ALTER TABLE host_queue_entries '
3                    'ADD COLUMN `aborted` bool NOT NULL DEFAULT FALSE')
4    manager.execute("UPDATE host_queue_entries SET aborted = true WHERE "
5                    "status IN ('Abort', 'Aborting', 'Aborted')")
6
7
8def migrate_down(manager):
9    manager.execute("UPDATE host_queue_entries SET status = 'Abort' WHERE "
10                    "aborted AND status != 'Aborted'")
11    manager.execute('ALTER TABLE host_queue_entries DROP COLUMN `aborted`')
12