Skip to content

do not fail on non-default naming strategies #330

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

Merged
merged 2 commits into from
Jan 21, 2016

Conversation

dbu
Copy link
Member

@dbu dbu commented Jan 9, 2016

hardcode column names that are used in index definitions to not fail on non-default naming strategies.

as far as i can tell, this should be no BC break, as non-default naming strategies previously must have lead to an error as described in #309. if the user overwrote the mapping, they will not see the change we do here.

fix #309


<indexes>
<index name="name_idx" columns="name"/>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the name field is not defined in the Model class, only in the Doctrine\ORM class. moved it down - i hope it is possible to add indexes from several mapping files.

@dbu
Copy link
Member Author

dbu commented Jan 9, 2016

@Ocramius is this what you meant by "prefixing" in #309 (comment) ?

@dbu
Copy link
Member Author

dbu commented Jan 9, 2016

@Nielsb85 @steve-todorov does this look like it would fix the issue you described in #309?

@Ocramius
Copy link

Ocramius commented Jan 9, 2016

@dbu I sadly don't know this config format, and therefore can't answer your question :-(

@lsmith77 lsmith77 added review and removed wip/poc labels Jan 9, 2016
@dbu
Copy link
Member Author

dbu commented Jan 9, 2016

@Ocramius its the same for all mappings, e.g. annotations has this: https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Mapping/Index.php . they are all based on the column name and no way to specify the field of the entity and have the column looked up from the evaluated metadata.

@dbu
Copy link
Member Author

dbu commented Jan 21, 2016

@Nilsb85 would you mind checking if this fix works for you?

@Nielsb85
Copy link

@dbu will check asap. I hope somewhere beginning of next week.
thanks.

@dbu
Copy link
Member Author

dbu commented Jan 21, 2016

thanks. i merge this now so that we can tag RC1. looking forward to your feedback, we can still fix things until next week and then release a stable 1.4.0

dbu added a commit that referenced this pull request Jan 21, 2016
do not fail on non-default naming strategies
@dbu dbu merged commit 827703c into master Jan 21, 2016
@lsmith77 lsmith77 removed the review label Jan 21, 2016
@dbu dbu deleted the fix-orm-index-naming-strategies branch January 21, 2016 16:20
@Nielsb85
Copy link

@dbu the schema is updated successfully. There is a minor inconsistency now with the column name staticPrefix, which is the only column that is now in camel case while the rest is using underscore. But it does fix the problem I described.

@dbu
Copy link
Member Author

dbu commented Jan 22, 2016

thanks for the follow-up. yes, that can't be avoided without overwritting the mapping in your project, unfortunately. at least the configuration setting now does not break the application anymore.

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

Successfully merging this pull request may close these issues.

SchemaException when using symfony 2.7 and persistence.orm.enabled:tue
4 participants