hooks/syncschema.py
changeset 10074 ab956b780d4e
parent 10025 7b72ecc3f4d2
parent 10035 c5bcdece77fb
child 10200 cceb2c7c02f4
child 10640 17bdc485c5b2
equal deleted inserted replaced
10068:1b0cb3c6c95e 10074:ab956b780d4e
   474         column = SQL_PREFIX + rdefdef.name
   474         column = SQL_PREFIX + rdefdef.name
   475         try:
   475         try:
   476             cnx.system_sql(str('ALTER TABLE %s ADD %s %s'
   476             cnx.system_sql(str('ALTER TABLE %s ADD %s %s'
   477                                % (table, column, attrtype)),
   477                                % (table, column, attrtype)),
   478                            rollback_on_failure=False)
   478                            rollback_on_failure=False)
   479             self.info('added column %s to table %s', table, column)
   479             self.info('added column %s to table %s', column, table)
   480         except Exception as ex:
   480         except Exception as ex:
   481             # the column probably already exists. this occurs when
   481             # the column probably already exists. this occurs when
   482             # the entity's type has just been added or if the column
   482             # the entity's type has just been added or if the column
   483             # has not been previously dropped
   483             # has not been previously dropped
   484             self.error('error while altering table %s: %s', table, ex)
   484             self.error('error while altering table %s: %s', table, ex)