- fix list comprehension so we are using correct fk name (py3k picked it up for us ! )
*[schema.Column(n, NULLTYPE) for n in remote_cols])
f = schema.ForeignKeyConstraint(local_cols,
- ["%s.%s" % (referent, name)
- for name in remote_cols],
+ ["%s.%s" % (referent, n)
+ for n in remote_cols],
name=name
)
t1.append_constraint(f)
def _sqlite_testing_config():
cfg = _testing_config()
dir_ = os.path.join(staging_directory, 'scripts')
- file(cfg.config_file_name, 'w').write("""
+ open(cfg.config_file_name, 'w').write("""
[alembic]
script_location = %s
sqlalchemy.url = sqlite:///%s/foo.db
['foo', 'bar'], ['bat', 'hoho'])
assert_compiled(
AddConstraint(fk),
- "ALTER TABLE t1 ADD CONSTRAINT hoho FOREIGN KEY(foo, bar) "
+ "ALTER TABLE t1 ADD CONSTRAINT fk_test FOREIGN KEY(foo, bar) "
"REFERENCES t2 (bat, hoho)"
)