diff options
author | showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> | 2009-08-31 18:33:41 +0000 |
---|---|---|
committer | showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> | 2009-08-31 18:33:41 +0000 |
commit | 02c9f75613019ebdb94dbdf9ff3e8197d53140e5 (patch) | |
tree | 6a80511bf5cfa1ee9fbab3e4f5dafa7d9c1324f1 /tko | |
parent | bd80d5b3ff8bea5876d00b9b707227659abd7296 (diff) |
TKO migration to ensure the "invalidated" label exists.
Signed-off-by: Steve Howard <showard@google.com>
git-svn-id: svn://test.kernel.org/autotest/trunk@3629 592f7852-d20e-0410-864c-8624ca9c26a4
Diffstat (limited to 'tko')
-rw-r--r-- | tko/migrations/029_ensure_invalidated_label_exists.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tko/migrations/029_ensure_invalidated_label_exists.py b/tko/migrations/029_ensure_invalidated_label_exists.py new file mode 100644 index 00000000..7eed133a --- /dev/null +++ b/tko/migrations/029_ensure_invalidated_label_exists.py @@ -0,0 +1,15 @@ +# the "invalidated" test label is used implicitly by TKO for (you guessed it) +# invalidating test results. if it doesn't exist in the DB, errors will show +# up. + +def migrate_up(manager): + rows = manager.execute( + 'SELECT * FROM test_labels WHERE name = "invalidated"') + if not rows: + manager.execute('INSERT INTO test_labels SET name = "invalidated", ' + 'description = "Used by TKO to invalidate tests"') + + +def migrate_down(manager): + # no need to remove the label + pass |