hooks/syncschema.py
branchstable
changeset 8533 73469aa94afe
parent 8216 99ff746e8de8
child 8534 6ed331fd4347
equal deleted inserted replaced
8532:28a346df670e 8533:73469aa94afe
   753         table = '%s%s' % (prefix, self.entity.type)
   753         table = '%s%s' % (prefix, self.entity.type)
   754         dbhelper= session.cnxset.source('system').dbhelper
   754         dbhelper= session.cnxset.source('system').dbhelper
   755         cols = ['%s%s' % (prefix, c) for c in self.cols]
   755         cols = ['%s%s' % (prefix, c) for c in self.cols]
   756         sqls = dbhelper.sqls_drop_multicol_unique_index(table, cols)
   756         sqls = dbhelper.sqls_drop_multicol_unique_index(table, cols)
   757         for sql in sqls:
   757         for sql in sqls:
   758             session.system_sql(sql)
   758             try:
       
   759                 session.system_sql(sql)
       
   760             except Exception: # should be ProgrammingError
       
   761                 if sql.startswith('DROP'):
       
   762                     self.critical('execute of `%s` failed', sql)
       
   763                     continue
       
   764                 raise
   759 
   765 
   760     # XXX revertprecommit_event
   766     # XXX revertprecommit_event
   761 
   767 
   762     def postcommit_event(self):
   768     def postcommit_event(self):
   763         eschema = self.session.vreg.schema.schema_by_eid(self.entity.eid)
   769         eschema = self.session.vreg.schema.schema_by_eid(self.entity.eid)