server/migractions.py
changeset 7479 b0603fc4ed6d
parent 7412 9179ae452159
child 7514 32081892850e
equal deleted inserted replaced
7478:9e213becdcf4 7479:b0603fc4ed6d
   371                 self.execscript_confirm = execscript_confirm
   371                 self.execscript_confirm = execscript_confirm
   372                 if self.config.free_wheel:
   372                 if self.config.free_wheel:
   373                     self.cmd_reactivate_verification_hooks()
   373                     self.cmd_reactivate_verification_hooks()
   374 
   374 
   375     def install_custom_sql_scripts(self, directory, driver):
   375     def install_custom_sql_scripts(self, directory, driver):
       
   376         sql_scripts = []
   376         for fpath in glob(osp.join(directory, '*.sql.%s' % driver)):
   377         for fpath in glob(osp.join(directory, '*.sql.%s' % driver)):
   377             newname = osp.basename(fpath).replace('.sql.%s' % driver,
   378             newname = osp.basename(fpath).replace('.sql.%s' % driver,
   378                                                   '.%s.sql' % driver)
   379                                                   '.%s.sql' % driver)
   379             warn('[3.5.6] rename %s into %s' % (fpath, newname),
   380             warn('[3.5.6] rename %s into %s' % (fpath, newname),
   380                  DeprecationWarning)
   381                  DeprecationWarning)
       
   382             sql_scripts.append(fpath)
       
   383         sql_scripts += glob(osp.join(directory, '*.%s.sql' % driver))
       
   384         for fpath in sql_scripts:
   381             print '-> installing', fpath
   385             print '-> installing', fpath
   382             sqlexec(open(fpath).read(), self.session.system_sql, False,
   386             try:
   383                     delimiter=';;')
   387                 sqlexec(open(fpath).read(), self.session.system_sql, False,
   384         for fpath in glob(osp.join(directory, '*.%s.sql' % driver)):
   388                         delimiter=';;')
   385             print '-> installing', fpath
   389             except Exception, exc:
   386             sqlexec(open(fpath).read(), self.session.system_sql, False,
   390                 print '-> ERROR:', exc, ', skipping', fpath
   387                     delimiter=';;')
       
   388 
   391 
   389     # schema synchronization internals ########################################
   392     # schema synchronization internals ########################################
   390 
   393 
   391     def _synchronize_permissions(self, erschema, teid):
   394     def _synchronize_permissions(self, erschema, teid):
   392         """permission synchronization for an entity or relation type"""
   395         """permission synchronization for an entity or relation type"""