[Doctrine] #1603: Can't make rootColumnName within NestedSet a reference to id of another table

1 view
Skip to first unread message

Doctrine

unread,
Oct 23, 2008, 7:06:57 AM10/23/08
to doctri...@googlegroups.com
#1603: Can't make rootColumnName within NestedSet a reference to id of another
table
-----------------------------------+----------------------------------------
Reporter: dream0r | Owner: jwage
Type: enhancement | Status: new
Priority: minor | Milestone: Unknown
Component: Behaviors | Version: 1.0.3
Keywords: | Has_test: 0
Mystatus: Pending Core Response | Has_patch: 0
-----------------------------------+----------------------------------------
I would like to use a NestedSet table together with another table. I tried
to create a reference on menu_id (the rootColumnName) to the Menu table.
This table allows me to save different trees as different 'menus'. YAML:

----

{{{
detect_relations: true

Menu:
columns:
title:
type: string(255)
MenuItem:
actAs:
NestedSet:
hasManyRoots: true
rootColumnName: menu_id
columns:
title:
type: string(255)
menu_id:
}}}

----

Above fails because NestedSet template creates a int root column with 4
bytes size instead of 8 bytes. The columns don't match cause of their
length.

'''Solution: let the nestedset template create a root column with a 8
bytes size.'''

--
Ticket URL: <http://trac.phpdoctrine.org/ticket/1603>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper

Doctrine

unread,
Oct 23, 2008, 4:45:28 PM10/23/08
to doctri...@googlegroups.com
#1603: Can't make rootColumnName within NestedSet a reference to id of another
table
--------------------------+-------------------------------------------------
Reporter: dream0r | Owner: jwage
Type: enhancement | Status: new
Priority: minor | Milestone: 1.1.0
Component: Behaviors | Version: 1.0.3
Resolution: | Keywords:
Has_test: 0 | Mystatus: Pending Core Response
Has_patch: 0 |
--------------------------+-------------------------------------------------
Changes (by jwage):

* milestone: Unknown => 1.1.0

Comment:

You need to set the primary key of the Menu model to match the behavior.

{{{
detect_relations: true

Menu:
columns:
id:
type: integer(4)
primary: true
autoincrement: true
title:
type: string(255)
MenuItem:
actAs:
NestedSet:
hasManyRoots: true
rootColumnName: menu_id
columns:
title:
type: string(255)
menu_id:
}}}

I will change the Searchable behavior in Doctrine 1.1 to default to the
same length as the auto added primary key.

--
Ticket URL: <http://trac.doctrine-project.org/ticket/1603#comment:1>

Doctrine

unread,
Dec 1, 2008, 3:30:19 PM12/1/08
to doctri...@googlegroups.com
#1603: Can't make rootColumnName within NestedSet a reference to id of another
table
--------------------------+-------------------------------------------------
Reporter: dream0r | Owner: jwage
Type: enhancement | Status: closed
Priority: minor | Milestone: 1.1.0
Component: Behaviors | Version: 1.0.3
Resolution: fixed | Keywords:
Has_test: 0 | Mystatus: Pending Core Response
Has_patch: 0 |
--------------------------+-------------------------------------------------
Changes (by jwage):

* status: new => closed
* resolution: => fixed


Old description:

New description:

--

Comment:

In r5227 this was fixed.

--
Ticket URL: <http://trac.doctrine-project.org/ticket/1603#comment:2>

Reply all
Reply to author
Forward
0 new messages