Ticket #1105 (closed defect: fixed)
Sluggable and indexes
| Reported by: | lucassus | Owned by: | jwage |
|---|---|---|---|
| Priority: | minor | Milestone: | |
| Component: | Attributes | Version: | 0.11.0 |
| Severity: | Keywords: | ||
| Cc: | Has Test: | ||
| Status: | Has Patch: |
Description
Probably I found serious bug in Sluggable Listener:
in Doctrine_Template_Sluggable I've found:
$this->index('sluggable', array('fields' => $indexFields,
'type' => 'unique'));
It means that index name is hard coded. When I try add sluggable to more than one model, postgres throws error:
[2008-06-04 17:20:11.137 CEST] sigma_development LOG: statement: CREATE UNIQUE INDEX sluggable ON gallery.categories (slug) [2008-06-04 17:20:11.137 CEST] sigma_development ERROR: relation "sluggable" already exists
I'm using doctrine 0.10.4, bu I found the same error in 0.11.0.
Index name should be passed through options, eg.
$this->index($this->_options['index_name'], array('fields' => $indexFields,
'type' => 'unique'));
Change History
Note: See
TracTickets for help on using
tickets.