Changeset 4267


Ignore:
Timestamp:
Sep 11, 2008, 2:05:13 PM (16 years ago)
Author:
Russ Tyndall
Message:

removed some excess installer

File:
1 edited

Legend:

Unmodified
Added
Removed
  • timingandestimationplugin/branches/trac0.11-Permissions/timingandestimationplugin/api.py

    r4266 r4267  
    8383
    8484
    85             print "Creating report_version table"
    86             sql = """
    87             CREATE TABLE report_version (
    88             report integer,
    89             version integer,
    90             UNIQUE (report, version)
    91             );
    92             """
    93             dbhelper.execute_non_query(self, sql)
    94 
    95         if self.db_installed_version < 4:
    96             print "Upgrading report_version table to v4"
    97             sql ="""
    98             ALTER TABLE report_version ADD COLUMN tags varchar(1024) null;
    99             """
    100             dbhelper.execute_non_query(self, sql)
    101 
    10285        if self.db_installed_version < 5:
    103             # In this version we convert to using reportmanager.py
    104             # The easiest migration path is to remove all the reports!!
    105             # They will be added back in later but all custom reports will be lost (deleted)
    106             print "Dropping report_version table"
    107             sql = "DELETE FROM report " \
    108                   "WHERE author=%s AND id IN (SELECT report FROM report_version)"
    109             dbhelper.execute_non_query(self, sql, 'Timing and Estimation Plugin')
    110 
    111             sql = "DROP TABLE report_version"
    112             dbhelper.execute_non_query(self, sql)
     86            if dbhelper.db_table_exists(self, 'report_version'):
     87                print "Dropping report_version table"
     88                sql = "DELETE FROM report " \
     89                    "WHERE author=%s AND id IN (SELECT report FROM report_version)"
     90                dbhelper.execute_non_query(self, sql, 'Timing and Estimation Plugin')
     91
     92                sql = "DROP TABLE report_version"
     93                dbhelper.execute_non_query(self, sql)
    11394
    11495        #version 6 upgraded reports
Note: See TracChangeset for help on using the changeset viewer.