Skip to content

Commit b7a43ad

Browse files
committed
hardcode column names that are used in index definitions to not fail on non-default naming strategies
1 parent 9c746de commit b7a43ad

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

CHANGELOG.md

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

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

12+
1.3.0
13+
-----
14+
815
1.3.0-RC1
916
---------
1017

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)