diff mbox

[5/6] Migration script to add results comparison attributes table

Message ID 1246248177-6108-5-git-send-email-lmr@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Lucas Meneghel Rodrigues June 29, 2009, 4:02 a.m. UTC
A migration script was added to create the tests comparison
attributes table

Signed-off-by: Dror Russo <drusso@redhat.com>
---
 .../029_add_test_comparison_attributes.py          |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)
 create mode 100644 tko/migrations/029_add_test_comparison_attributes.py
diff mbox

Patch

diff --git a/tko/migrations/029_add_test_comparison_attributes.py b/tko/migrations/029_add_test_comparison_attributes.py
new file mode 100644
index 0000000..675ade1
--- /dev/null
+++ b/tko/migrations/029_add_test_comparison_attributes.py
@@ -0,0 +1,20 @@ 
+UP_SQL = """
+CREATE TABLE `test_comparison_attributes` (
+    `id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
+    `testname` varchar(255) NOT NULL,
+    `owner` varchar(80) NOT NULL,
+    `attributes` varchar(1024) NOT NULL,
+    `testset` varchar(1024) NOT NULL
+);
+"""
+
+DOWN_SQL = """
+DROP TABLE IF EXISTS `test_comparison_attributes`;
+"""
+
+def migrate_up(manager):
+    manager.execute(UP_SQL)
+
+
+def migrate_down(manager):
+    manager.execute(DOWN_SQL)