Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mysql doesnt' reflect RESTRICT #321

Closed
sqlalchemy-bot opened this issue Aug 25, 2015 · 3 comments
Closed

mysql doesnt' reflect RESTRICT #321

sqlalchemy-bot opened this issue Aug 25, 2015 · 3 comments

Comments

@sqlalchemy-bot
Copy link

@sqlalchemy-bot sqlalchemy-bot commented Aug 25, 2015

Migrated issue, originally created by Michael Bayer (@zzzeek)

diff --git a/tests/test_autogen_fks.py b/tests/test_autogen_fks.py
index 90ca908..9e2b8e5 100644
--- a/tests/test_autogen_fks.py
+++ b/tests/test_autogen_fks.py
@@ -623,6 +623,22 @@ class AutogenerateFKOptionsTest(AutogenFixtureTest, TestBase):
         )
         eq_(diffs, [])
 
+    def test_nochange_ondelete_restrict(self):
+        """test the RESTRICT option which MySQL doesn't report on"""
+
+        diffs = self._fk_opts_fixture(
+            {"ondelete": "restrict"}, {"ondelete": "restrict"}
+        )
+        eq_(diffs, [])
+
+    def test_nochange_onupdate_restrict(self):
+        """test the RESTRICT option which MySQL doesn't report on"""
+
+        diffs = self._fk_opts_fixture(
+            {"onupdate": "restrict"}, {"onupdate": "restrict"}
+        )
+        eq_(diffs, [])
+
     def test_ondelete_onupdate_combo(self):
         diffs = self._fk_opts_fixture(
             {"onupdate": "cascade", "ondelete": "set null"},

@sqlalchemy-bot
Copy link
Author

@sqlalchemy-bot sqlalchemy-bot commented Aug 25, 2015

Michael Bayer (@zzzeek) wrote:

  • Added workaround in new foreign key option detection feature for
    MySQL's consideration of the "RESTRICT" option being the default,
    for which no value is reported from the database; the MySQL impl now
    corrects for when the model reports RESTRICT but the database reports
    nothing. A similar rule is in the default FK comparison to accommodate
    for the default "NO ACTION" setting being present in the model but not
    necessarily reported by the database, or vice versa.
    fixes #321

b8752d5

@sqlalchemy-bot
Copy link
Author

@sqlalchemy-bot sqlalchemy-bot commented Aug 25, 2015

Changes by Michael Bayer (@zzzeek):

  • changed status to closed
@sqlalchemy-bot
Copy link
Author

@sqlalchemy-bot sqlalchemy-bot commented Aug 25, 2015

Changes by Michael Bayer (@zzzeek):

  • edited description
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.