source: tagsplugin/trunk/tractags/upgrades/db3.py

Last change on this file was 15558, checked in by Ryan J Ollos, 7 years ago

0.9dev: Remove unused imports

File size: 697 bytes
Line 
1# -*- coding: utf-8 -*-
2#
3# Copyright (C) 2013 Steffen Hoffmann <hoff.st@web.de>
4#
5# This software is licensed as described in the file COPYING, which
6# you should have received as part of this distribution.
7#
8
9
10def do_upgrade(env, ver, cursor):
11    """Register tractags db schema in `system` db table."""
12
13    cursor.execute("""
14        SELECT COUNT(*)
15          FROM system
16         WHERE name='tags_version'
17    """)
18    exists = cursor.fetchone()
19    if not exists[0]:
20        # Play safe for upgrades from tags<0.7, that had no version entry.
21        cursor.execute("""
22            INSERT INTO system
23                   (name, value)
24            VALUES ('tags_version', '2')
25            """)
Note: See TracBrowser for help on using the repository browser.