|
@ -45,8 +45,6 @@ def update_schema( **kwargs ): |
|
|
try: |
|
|
try: |
|
|
stmt = scriptfile.read() |
|
|
stmt = scriptfile.read() |
|
|
cursor.execute( stmt ) |
|
|
cursor.execute( stmt ) |
|
|
if "postgresql" in settings.DATABASE_ENGINE: |
|
|
|
|
|
transaction.commit() |
|
|
|
|
|
|
|
|
|
|
|
except IOError, err: |
|
|
except IOError, err: |
|
|
print "Error reading file '%s':" % filename |
|
|
print "Error reading file '%s':" % filename |
|
@ -55,8 +53,6 @@ def update_schema( **kwargs ): |
|
|
except cursor.db.connection.Error, err: |
|
|
except cursor.db.connection.Error, err: |
|
|
print "Error executing file '%s':" % filename |
|
|
print "Error executing file '%s':" % filename |
|
|
print err |
|
|
print err |
|
|
if "postgresql" in settings.DATABASE_ENGINE: |
|
|
|
|
|
transaction.rollback() |
|
|
|
|
|
|
|
|
|
|
|
finally: |
|
|
finally: |
|
|
scriptfile.close() |
|
|
scriptfile.close() |
|
|