-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Support for MySQL's MyISAM and other non-InnoDB engines in SchemaTool #865
Conversation
Hello, thank you for creating this pull request. I have automatically opened an issue http://www.doctrine-project.org/jira/browse/DDC-2828 We use Jira to track the state of pull requests and the versions they got |
Existing MySQL tests fixed, new test for this feature added, branch rebased. Still some PostgreSQL tests to fix. |
Everything should be OK. Can anyone review this PR? |
@Ocramius @guilhermeblanco any update? |
We cant support this imho, the PR is way to complex to support something that is MySQL specific and using a seldomly used feature. You can fix this problem in generation by providing your own Listener to the "postGenerateSchema" event and fix the schema for your cases. However in general we cannot support all the possiblities and constraints that exist in DDL modelling as this is just way to complex for us to maintain. |
Sorry to be this strict on the issue, using a Listener in your project will help you achieve the same though. |
@beberlei There is a related issue in DBAL which we cannot support either, then. |
@beberlei this patch is not so complex and has nothing MySQL specific (the PR in DBAL is MySQL specific). It's mainly a code cleanup. The complex part (line 301 to 338) is already in the code base. It has been introduced by #440 and I've just refactored it a bit. This the same algorithm and mostly the same implementation. The fact is that my patch is even proper than the current implementation of foreign key addition by the ORM Schema generator. In the current implementation, the foreign table is passed as a string in parameter of I fully agree that Doctrine should not support all features of all supported DBMS. But MySQL is probably the more popular DBMS used with Doctrine and the It's strange to only have partial support of table engines. The Please reconsider this PR: it's not that complex and should be easy to maintain (we talk about 50 lines of production code that is fully tested) and it can be very useful. |
MySQL allows foreign keys only between tables using the InnoDB engine (MyISAM, memory and other engines don't support foreign keys).
This PR delay foreign keys generation after the hydration of all
Table
objects. It enables DBAL to check tables engines before adding foreign keys.This PR is related to doctrine/dbal#437