Add downgrade support to migrate. This is really necessary for doing real migration development. Modified all existing migrations to support it.
Signed-off-by: Steve Howard <[email protected]>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@1336 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/frontend/migrations/002_cleanup_fields.py b/frontend/migrations/002_cleanup_fields.py
index ccd8c1c..a3656ca 100644
--- a/frontend/migrations/002_cleanup_fields.py
+++ b/frontend/migrations/002_cleanup_fields.py
@@ -3,3 +3,10 @@
manager.execute('ALTER TABLE jobs DROP kernel_url, DROP status, '
'DROP submitted_on')
manager.execute('ALTER TABLE host_queue_entries DROP created_on')
+
+def migrate_down(manager):
+ manager.execute('ALTER TABLE autotests ADD params VARCHAR(255)')
+ manager.execute('ALTER TABLE jobs ADD kernel_url VARCHAR(255), '
+ 'ADD status VARCHAR(255), ADD submitted_on datetime')
+ manager.execute('ALTER TABLE host_queue_entries ADD created_on '
+ 'datetime')