summaryrefslogtreecommitdiff
path: root/migrate/versioning
diff options
context:
space:
mode:
authoriElectric <unknown>2010-04-24 21:40:16 +0200
committeriElectric <unknown>2010-04-24 21:40:16 +0200
commite4868841d5922f6313821ff49d3e70426816d4fb (patch)
tree76d8c2f33abffa261f665d2c18affdf6d8a3e4c6 /migrate/versioning
parent42ab0ba79630b0820c55d9f2cbe85492b307f160 (diff)
downloadsqalchemy-migrate-e4868841d5922f6313821ff49d3e70426816d4fb.tar.gz
partly fix SA0.6 tests on postgres
Diffstat (limited to 'migrate/versioning')
-rw-r--r--migrate/versioning/genmodel.py8
-rw-r--r--migrate/versioning/schema.py4
2 files changed, 5 insertions, 7 deletions
diff --git a/migrate/versioning/genmodel.py b/migrate/versioning/genmodel.py
index 1715175..066e0c9 100644
--- a/migrate/versioning/genmodel.py
+++ b/migrate/versioning/genmodel.py
@@ -9,9 +9,11 @@
import sys
import logging
-import migrate
import sqlalchemy
+import migrate
+import migrate.changeset
+
log = logging.getLogger(__name__)
HEADER = """
@@ -37,7 +39,6 @@ class ModelGenerator(object):
self.diff = diff
self.declarative = declarative
-
def column_repr(self, col):
kwarg = []
if col.key != col.name:
@@ -174,9 +175,6 @@ class ModelGenerator(object):
def applyModel(self):
"""Apply model to current database."""
- # Yuck! We have to import from changeset to apply the
- # monkey-patch to allow column adding/dropping.
- from migrate.changeset import schema
def dbCanHandleThisChange(missingInDatabase, missingInModel, diffDecl):
if missingInDatabase and not missingInModel and not diffDecl:
diff --git a/migrate/versioning/schema.py b/migrate/versioning/schema.py
index 8014bcb..eb3beba 100644
--- a/migrate/versioning/schema.py
+++ b/migrate/versioning/schema.py
@@ -45,9 +45,9 @@ class ControlledSchema(object):
self.table.c.repository_id == str(self.repository.id)))
data = list(result)[0]
- except Exception:
+ except:
cls, exc, tb = sys.exc_info()
- raise exceptions.DatabaseNotControlledError, exc.message, tb
+ raise exceptions.DatabaseNotControlledError, exc.__str__(), tb
self.version = data['version']
return data