summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/testlib/schema.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/testlib/schema.py b/test/testlib/schema.py
index 152660380..7f6370482 100644
--- a/test/testlib/schema.py
+++ b/test/testlib/schema.py
@@ -1,4 +1,5 @@
from testlib import testing
+import itertools
schema = None
__all__ = 'Table', 'Column',
@@ -54,6 +55,8 @@ def Table(*args, **kw):
return schema.Table(*args, **kw)
+generic_counter = itertools.count()
+
def Column(*args, **kw):
"""A schema.Column wrapper/hook for dialect-specific tweaks."""
@@ -61,6 +64,8 @@ def Column(*args, **kw):
if schema is None:
from sqlalchemy import schema
- # TODO: a Column that creates a Sequence automatically for PK columns,
- # which would help Oracle tests
+ if testing.against('oracle'):
+ if kw.get('primary_key') == True and kw.get('default') == None:
+ kw['default'] = generic_counter.next
+
return schema.Column(*args, **kw)