Skip to content

Commit 20c1087

Browse files
committed
update the fk_names req
This is not a limitation this is just a bug in sqlalchemy, being fixed by #12954. we dont have a system in place to cross-check gerrits right now so just merge this and then merge the SQLAlchemy fix Change-Id: I9c074c0edb9f55d2400e59a9b2b02603458e8f0b
1 parent df8d89f commit 20c1087

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

alembic/testing/suite/test_autogen_fks.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ def test_no_change_composite_fk(self):
199199

200200
eq_(diffs, [])
201201

202+
@config.requirements.fk_names
202203
def test_casing_convention_changed_so_put_drops_first(self):
203204
m1 = MetaData()
204205
m2 = MetaData()
@@ -247,7 +248,7 @@ def test_casing_convention_changed_so_put_drops_first(self):
247248
["test2"],
248249
"some_table",
249250
["test"],
250-
name="MyFK" if config.requirements.fk_names.enabled else None,
251+
name="MyFK",
251252
)
252253

253254
self._assert_fk_diff(

tests/requirements.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,13 @@ def unnamed_constraints(self):
6262

6363
@property
6464
def fk_names(self):
65-
"""foreign key constraints always have names in the DB"""
66-
return exclusions.fails_on("sqlite")
65+
"""backend can reflect foreign key names"""
66+
67+
# issue here was fixed in SQLAlchemy #12954 for sqlite, 2.0
68+
# release
69+
return exclusions.fails_if(
70+
lambda config: not sqla_compat.sqla_2 and config.against("sqlite")
71+
)
6772

6873
@property
6974
def reflects_fk_options(self):

0 commit comments

Comments
 (0)