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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
Changelog
=========

1.4.0-RC1
---------

* **2016-01-09**: [ORM] Hardcoded some column names to match what we index on to avoid
issues with non-default `orm.naming_strategy`. It is now safe to use a non-default
naming strategy. If you did a workaround to use a naming strategy, you might need to
look into that.
* **2015-10-28**: Deprecated `cmf_routing.dynamic.persistence.phpcr.route_basepath`
setting and parameter in favor of `cmf_routing.dynamic.persistence.phpcr.route_basepaths`.
The old names will be kept for BC reasons and removed in 2.0.

1.3.0
-----

1.3.0-RC1
---------

Expand Down
4 changes: 2 additions & 2 deletions Resources/config/doctrine-model/Route.orm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

<mapped-superclass name="Symfony\Cmf\Bundle\RoutingBundle\Model\Route">
<field name="variablePattern" type="string" nullable="true"/>
<field name="staticPrefix" type="string" nullable="true"/>
<!-- we hardcode the column name to overwrite column naming strategies as we have to define the index on the column name -->
<field name="staticPrefix" type="string" nullable="true" column="staticPrefix"/>

<indexes>
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.

<index name="name_idx" columns="name"/>
<index name="prefix_idx" columns="staticPrefix"/>
</indexes>
</mapped-superclass>
Expand Down
7 changes: 6 additions & 1 deletion Resources/config/doctrine-orm/Route.orm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@
<generator strategy="AUTO"/>
</id>

<field name="name" type="string" unique="true"/>
<!-- we hardcode the column name to overwrite column naming strategies as we have to define the index on the column name -->
<field name="name" type="string" unique="true" column="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.

not sure what strategy could make this fail, but better be safe.

<field name="position" type="integer"/>

<indexes>
<index name="name_idx" columns="name"/>
</indexes>

</entity>

</doctrine-mapping>