Changes between Initial Version and Version 1 of Ticket #11484, comment 19
- Timestamp:
- Jan 8, 2014, 11:16:03 PM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #11484, comment 19
initial v1 7 7 Index: simplemultiprojectplugin/trunk/simplemultiproject/environmentSetup.py 8 8 =================================================================== 9 --- simplemultiprojectplugin/trunk/simplemultiproject/environmentSetup.py (revision 135 49)9 --- simplemultiprojectplugin/trunk/simplemultiproject/environmentSetup.py (revision 13559) 10 10 +++ simplemultiprojectplugin/trunk/simplemultiproject/environmentSetup.py (working copy) 11 11 @@ -14,7 +14,7 @@ … … 18 18 tables = [ 19 19 Table('smp_project', key = 'id_project') [ 20 @@ -157,3 +157,2 3@@20 @@ -157,3 +157,25 @@ 21 21 sqlInsertVersion = """UPDATE system SET value=%s WHERE name=%s""" 22 22 cursor.execute(sqlInsertVersion, [db_version, db_version_key]) … … 27 27 + # (see TH:#11484) 28 28 + 29 + # Insert new column30 29 + cursor.execute("""PRAGMA table_info(smp_project)""") 31 30 + column_names = cursor.fetchall() 32 + self.log.debug(column_names) 31 + 32 + # find out if the column is existing 33 33 + has_restrict_column = False 34 34 + for entry in column_names: 35 35 + if 'restrict' in entry[1]: 36 36 + has_restrict_column = True 37 + 38 + # Insert new column depending on if the column does not exist 37 39 + if not has_restrict_column: 38 40 + cursor.execute("""ALTER TABLE smp_project ADD %s text"""