Changes between Initial Version and Version 1 of Ticket #11484, comment 19


Ignore:
Timestamp:
Jan 8, 2014, 11:16:03 PM (10 years ago)
Author:
falkb
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #11484, comment 19

    initial v1  
    77Index: simplemultiprojectplugin/trunk/simplemultiproject/environmentSetup.py
    88===================================================================
    9 --- simplemultiprojectplugin/trunk/simplemultiproject/environmentSetup.py       (revision 13549)
     9--- simplemultiprojectplugin/trunk/simplemultiproject/environmentSetup.py       (revision 13559)
    1010+++ simplemultiprojectplugin/trunk/simplemultiproject/environmentSetup.py       (working copy)
    1111@@ -14,7 +14,7 @@
     
    1818 tables = [
    1919     Table('smp_project', key = 'id_project') [
    20 @@ -157,3 +157,23 @@
     20@@ -157,3 +157,25 @@
    2121             sqlInsertVersion = """UPDATE system SET value=%s WHERE name=%s"""
    2222             cursor.execute(sqlInsertVersion, [db_version, db_version_key])
     
    2727+            # (see TH:#11484)
    2828+
    29 +            # Insert new column
    3029+            cursor.execute("""PRAGMA table_info(smp_project)""")
    3130+            column_names = cursor.fetchall()
    32 +            self.log.debug(column_names)
     31+
     32+            # find out if the column is existing
    3333+            has_restrict_column = False
    3434+            for entry in column_names:
    3535+                if 'restrict' in entry[1]:
    3636+                    has_restrict_column = True
     37+
     38+            # Insert new column depending on if the column does not exist
    3739+            if not has_restrict_column:
    3840+                cursor.execute("""ALTER TABLE smp_project ADD %s text"""