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

Fist steps to close DDC-2134 #5964

Closed
wants to merge 11 commits into from

Conversation

marcobuschini
Copy link

This pull request creates a new command deadentities that seeks for child entities that have no parent. This is for helping people getting to implement referential integrity on databases that didn't have it. It does it all by analyzing the database schema via Doctrine API, and then generating queries to seek for the "missing" data.
It still does not work with composite foreign keys, possibly due to my lack of knowledge of the Doctrine schema API, or query language.
Testing data should be inserted by hand in the database, as I do not know how I can violate foreign keys with Doctrine, but everything else should be database independent.

@Ocramius
Copy link
Member

Ocramius commented Sep 7, 2016

@marcobuschini this patch is not fit for core, in my opinion.

  1. consider moving it to a separate component
  2. split the logic that creates the SQL queries from the logic that runs the command
  3. make sure that you iterate over the results (do not dump an array, it will just kill your memory)
  4. use the symfony output helpers to make the output nicer

Closing here. I agree that this is a much needed tool, but it doesn't fit ORM core.

Also: this tool can be implemented without ORM (just use DBAL, look for foreign keys, repeat the same logic there ;-) )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants