[migration] commit only sql script migration stable
authorJulien Jehannet <julien.jehannet@logilab.fr>
Fri, 30 Jul 2010 11:11:08 +0200
branchstable
changeset 6042 df9cafb8062c
parent 6038 5c5d819e8e93
child 6043 bfe13118b5aa
[migration] commit only sql script migration
migration.py
server/migractions.py
--- a/migration.py	Fri Jul 30 09:52:46 2010 +0200
+++ b/migration.py	Fri Jul 30 11:11:08 2010 +0200
@@ -340,6 +340,7 @@
         elif script_mode == 'sql':
             from cubicweb.server.sqlutils import sqlexec
             sqlexec(open(migrscript).read(), self.session.system_sql)
+            self.commit()
         else: # script_mode == 'doctest'
             import doctest
             doctest.testfile(migrscript, module_relative=False,
--- a/server/migractions.py	Fri Jul 30 09:52:46 2010 +0200
+++ b/server/migractions.py	Fri Jul 30 11:11:08 2010 +0200
@@ -118,9 +118,8 @@
 
     def cmd_process_script(self, migrscript, funcname=None, *args, **kwargs):
         try:
-            super(ServerMigrationHelper, self).cmd_process_script(
+            return super(ServerMigrationHelper, self).cmd_process_script(
                   migrscript, funcname, *args, **kwargs)
-            self.commit()
         except ExecutionError, err:
             print >> sys.stderr, "-> %s" % err
         except: