summaryrefslogtreecommitdiff
path: root/tko/migrations/029_ensure_invalidated_label_exists.py
blob: 7eed133a00d8eb487dc108bd6a42fee2fc2f400f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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