#903: Sluggable with i18n
--------------------------+-------------------------------------------------
  Reporter:  Garfield-fr  |       Owner:  jwage                
      Type:  defect       |      Status:  new                  
  Priority:  minor        |   Milestone:  2.0.0                
 Component:  Sluggable    |     Version:  2.0-DEV              
Resolution:               |    Keywords:                       
  Has_test:  0            |    Mystatus:  Pending Core Response
 Has_patch:  0            |  
--------------------------+-------------------------------------------------
Changes (by esycat):

  * has_patch:  => 0
  * mystatus:  => Pending Core Response
  * has_test:  => 0

Old description:

> The sluggable field with actas i18n don't create on table translation. It
> is created on primary table.
>
> my schema:
> {{{
> Announcement:
>   tableName:  announcement
>   actAs:
>     Timestampable: ~
>     I18n:
>       fields: [title, summary]
>       className: %CLASS%_i18n
>     Sluggable:
>       fields: [title]
>   columns:
>     id:
>       type: integer(9)
>       primary:  true
>       autoincrement:  true
>     season:
>       type: string(2)
>     date_start:
>       type: date
>     date_end:
>       type: date
>     title:
>       type: string(120)
>       notnull:  true
>     summary:
>       type: string(4000)
>       notnull:  true
> }}}
> sql generate:
>
> {{{
> CREATE TABLE announcement_i18n (id BIGINT, title VARCHAR(120) NOT NULL,
> summary TEXT NOT NULL, lang CHAR(2), PRIMARY KEY(id, lang)) ENGINE =
> INNODB;
> CREATE TABLE announcement (id BIGINT AUTO_INCREMENT, season VARCHAR(2),
> date_start DATE, date_end DATE, created_at DATETIME, updated_at DATETIME,
> slug VARCHAR(255), UNIQUE INDEX sluggable_idx (slug), PRIMARY KEY(id))
> ENGINE = INNODB;
> ALTER TABLE announcement_i18n ADD FOREIGN KEY (id) REFERENCES
> announcement(id) ON UPDATE CASCADE ON DELETE CASCADE;
> }}}

New description:

 The sluggable field with actas i18n don't create on table translation. It
 is created on primary table.

 my schema:
 {{{
 Announcement:
   tableName:  announcement
   actAs:
     Timestampable: ~
     I18n:
       fields: [title, summary]
       className: %CLASS%_i18n
     Sluggable:
       fields: [title]
   columns:
     id:
       type: integer(9)
       primary:  true
       autoincrement:  true
     season:
       type: string(2)
     date_start:
       type: date
     date_end:
       type: date
     title:
       type: string(120)
       notnull:  true
     summary:
       type: string(4000)
       notnull:  true
 }}}
 sql generate:

 {{{
 CREATE TABLE announcement_i18n (id BIGINT, title VARCHAR(120) NOT NULL,
 summary TEXT NOT NULL, lang CHAR(2), PRIMARY KEY(id, lang)) ENGINE =
 INNODB;
 CREATE TABLE announcement (id BIGINT AUTO_INCREMENT, season VARCHAR(2),
 date_start DATE, date_end DATE, created_at DATETIME, updated_at DATETIME,
 slug VARCHAR(255), UNIQUE INDEX sluggable_idx (slug), PRIMARY KEY(id))
 ENGINE = INNODB;
 ALTER TABLE announcement_i18n ADD FOREIGN KEY (id) REFERENCES
 announcement(id) ON UPDATE CASCADE ON DELETE CASCADE;
 }}}

Comment:

 In my opinion, slug field serves as human-readable PK, therefore it cannot
 be translated.

-- 
Ticket URL: <http://trac.doctrine-project.org/ticket/903#comment:2>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"doctrine-svn" group.
 To post to this group, send email to [email protected]
 To unsubscribe from this group, send email to [EMAIL PROTECTED]
 For more options, visit this group at 
http://groups.google.co.uk/group/doctrine-svn?hl=en-GB
-~----------~----~----~----~------~----~------~--~---

Reply via email to