~mounir-bsaibes/launchpad-work-items-tracker/mb-wgs-changes

« back to all changes in this revision

Viewing changes to lpworkitems/database.py

  • Committer: James Westby
  • Date: 2011-06-24 19:09:26 UTC
  • Revision ID: james.westby@linaro.org-20110624190926-pycnlc2jqgkcrfhd
Remove the code to detect empty dbs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
import os
2
2
 
3
 
from pysqlite2.dbapi2 import OperationalError
4
3
from storm.locals import create_database, Store
5
4
 
6
5
 
94
93
 
95
94
def upgrade_if_needed(store):
96
95
    # upgrade DB layout
97
 
    try:
98
 
        result = store.execute('SELECT db_layout_ref FROM version')
99
 
    except OperationalError:
100
 
        create_tables(store)
101
 
        return
 
96
    result = store.execute('SELECT db_layout_ref FROM version')
102
97
    ver = result.get_one()[0]
103
98
 
104
99
    if ver == 1: