]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commitdiff
- fix drop_foreign_key to include that this only works with SQLite
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 1 Dec 2014 00:08:01 +0000 (19:08 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 1 Dec 2014 00:08:01 +0000 (19:08 -0500)
as stated

tests/requirements.py
tests/test_batch.py

index afacd00be26fdcb2a63969b30740ed9d36a3aeb5..47d8bc7e9e852b205539c5c667f9e220357367ee 100644 (file)
@@ -32,7 +32,15 @@ class DefaultRequirements(SuiteRequirements):
 
     @property
     def no_fk_names(self):
-        """foreign key constraints have no names in the DB"""
+        """foreign key constraints *never* have names in the DB"""
+        # TODO: add exclusion SQLAlchemy < 1.0 when
+        # https://bitbucket.org/zzzeek/sqlalchemy/issue/3261/sqlite-backend-ignores-names-on-reflected
+        # is fixed
+        return exclusions.only_on(['sqlite'])
+
+    @property
+    def unnamed_constraints(self):
+        """constraints without names are supported."""
         return exclusions.only_on(['sqlite'])
 
     @property
index bce262cc83eaf1f6bbc8efc37b3076a4398f76bc..b71e003f0ca6a28e480ac83188480ec944baa700 100644 (file)
@@ -675,6 +675,7 @@ class BatchRoundTripTest(TestBase):
             {"id": 5, "x": 9}
         ])
 
+    @config.requirements.unnamed_constraints
     def test_drop_foreign_key(self):
         bar = Table(
             'bar', self.metadata,