server/migractions.py
branchstable
changeset 5399 03c641ae00a6
parent 5293 72e102a06709
child 5408 120db445c179
child 5421 8167de96c523
equal deleted inserted replaced
5395:e0ab7433e640 5399:03c641ae00a6
   114                     sqlexec(open(migrscript).read(), self.session.system_sql)
   114                     sqlexec(open(migrscript).read(), self.session.system_sql)
   115             elif migrscript.endswith('.py') or migrscript.endswith('.txt'):
   115             elif migrscript.endswith('.py') or migrscript.endswith('.txt'):
   116                 return super(ServerMigrationHelper, self).cmd_process_script(
   116                 return super(ServerMigrationHelper, self).cmd_process_script(
   117                     migrscript, funcname, *args, **kwargs)
   117                     migrscript, funcname, *args, **kwargs)
   118             else:
   118             else:
   119                 print
   119                 print >> sys.stderr
   120                 print ('-> ignoring %s, only .py .sql and .txt scripts are considered' %
   120                 print >> sys.stderr, ('-> ignoring %s, only .py .sql and .txt scripts are considered' %
   121                        migrscript)
   121                        migrscript)
   122                 print
   122                 print >> sys.stderr
   123             self.commit()
   123             self.commit()
   124         except:
   124         except:
   125             self.rollback()
   125             self.rollback()
   126             raise
   126             raise
   127 
   127