Skip to content

Commit 827703c

Browse files
committed
Merge pull request #330 from symfony-cmf/fix-orm-index-naming-strategies
do not fail on non-default naming strategies
2 parents 92c6b4b + 52054fa commit 827703c

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
Changelog
22
=========
33

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

15+
1.3.0
16+
-----
17+
818
1.3.0-RC1
919
---------
1020

Resources/config/doctrine-model/Route.orm.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

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

910
<indexes>
10-
<index name="name_idx" columns="name"/>
1111
<index name="prefix_idx" columns="staticPrefix"/>
1212
</indexes>
1313
</mapped-superclass>

Resources/config/doctrine-orm/Route.orm.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,14 @@
88
<generator strategy="AUTO"/>
99
</id>
1010

11-
<field name="name" type="string" unique="true"/>
11+
<!-- we hardcode the column name to overwrite column naming strategies as we have to define the index on the column name -->
12+
<field name="name" type="string" unique="true" column="name"/>
1213
<field name="position" type="integer"/>
1314

15+
<indexes>
16+
<index name="name_idx" columns="name"/>
17+
</indexes>
18+
1419
</entity>
1520

1621
</doctrine-mapping>

0 commit comments

Comments
 (0)