Double index in nested_set behavior #345

Closed
eymeric opened this Issue Apr 27, 2012 · 4 comments

Comments

Projects
None yet
3 participants

eymeric commented Apr 27, 2012

I'm following the example in the documentation

<table name="post">
  <column name="id" required="true" primaryKey="true" autoIncrement="true" type="INTEGER" />
  <column name="body" type="VARCHAR" required="true" primaryString="true" />
  <behavior name="nested_set">
    <parameter name="use_scope" value="true" />
    <parameter name="scope_column" value="thread_id" />
  </behavior>
  <foreign-key foreignTable="thread" onDelete="cascade">
    <reference local="thread_id" foreign="id" />
  </foreign-key>
</table>

here http://www.propelorm.org/behaviors/nested-set.html

If i don't declare the scope column in my schema, it generates two indexes in my SQL, one empty

PRIMARY KEY (  `id` ) ,
INDEX  `ressource_label_groups_FI_1` (  `` ) ,
INDEX  `ressource_label_groups_FI_1` (  `thread_id` ) ,

Is there a documentation or a propel sql generation matter ?

Thanks !

Member

fzaninotto commented Apr 30, 2012

Which version of Propel do you use?

eymeric commented Apr 30, 2012

I'm on 1.6.5 version

Owner

willdurand commented May 7, 2012

I can confirm the bug, but I think it's not related to the behavior.

Owner

willdurand commented May 7, 2012

Ok so here is a fix: #353
But I'm not sure if it's "normal" or not, @fzaninotto what is your opinion?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment