#1403: Exporting Doctrine_Search table on I18n - missing search index columns
----------------------------+-----------------------------------------------
  Reporter:  eXtreme        |       Owner:  jwage                     
      Type:  defect         |      Status:  new                       
  Priority:  blocker        |   Milestone:  2.0.0                     
 Component:  Import/Export  |     Version:  1.0.0                     
Resolution:                 |    Keywords:  search, yaml, export, i18n
  Has_test:  0              |    Mystatus:  Pending Core Response     
 Has_patch:  0              |  
----------------------------+-----------------------------------------------
Old description:

> I decided to export all "virtual" plugin tables into files in my
> Symfony+Doctrine. My previous related ticket #1355 is fixed now - OK.
> I18n exported correctly, Versionable (or AuditLog) exported correctly,
> Searchable... yea, here's a problem.
>
> Searchable is a child of I18n. Below example schema is created for
> testing:
>
> {{{
> ---
> options:
>     type: MyISAM
>     buildTables: &buildTables
>         generateFiles: yes
>         generatePath: <?php echo
> (dirname(dirname(__FILE__)).DIRECTORY_SEPARATOR.'models')."
> " ?>
>
> Table:
>     actAs:
>         I18n:
>             <<: *buildTables
>             fields: [name]
>             actAs:
>                 Searchable:
>                     <<: *buildTables
>                     fields: [name]
>     columns:
>         id:
>             primary: true
>             autoincrement: true
>             type: integer(10)
>         name:
>             type: string(100)
> }}}
>
> (MyISAM forced here because of ticket #1351; and BTW. I've found nice way
> to share export options - using YAML references ;))
>
> When I'm trying to export Searchable table it does not export
> doctrine_search columns (keyword, field, position) to php class and even
> to database. There are only ID and LANG columns (in DB and .php file):
>
> {{{
> abstract class BaseTableTranslationIndex extends Doctrine_Record
> {
>   public function setTableDefinition()
>   {
>     $this->setTableName('table_translation_index');
>     $this->hasColumn('id', 'integer', 10, array('type' => 'integer',
> 'length' => 10, 'primary' => true));
>     $this->hasColumn('lang', 'string', 2, array('fixed' => true, 'type'
> => 'string', 'length' => 2, 'primary' => true));
>   }
> }
> }}}
>
> I think it is an issue of I18n - as you can see, there is column named
> "lang" which is not specified in schema (in key "fields"). When
> generating tables without exporting - it correctly creates in DB table
> with fields: id, lang, keyword, field and position.
>
> What is more, when Searchable is not a child of I18n Doctrine can export
> correctly its table (to DB and to file with fields: id, keyword, field
> and position) so it must be something with this i18n and "lang" column.

New description:

 I decided to export all "virtual" plugin tables into files in my
 Symfony+Doctrine. My previous related ticket #1355 is fixed now - OK. I18n
 exported correctly, Versionable (or AuditLog) exported correctly,
 Searchable... yea, here's a problem.

 Searchable is a child of I18n. Below example schema is created for
 testing:

 {{{
 ---
 options:
     type: MyISAM
     buildTables: &buildTables
         generateFiles: yes
         generatePath: <?php echo
 (dirname(dirname(__FILE__)).DIRECTORY_SEPARATOR.'models')."
 " ?>

 Table:
     actAs:
         I18n:
             <<: *buildTables
             fields: [name]
             actAs:
                 Searchable:
                     <<: *buildTables
                     fields: [name]
     columns:
         id:
             primary: true
             autoincrement: true
             type: integer(10)
         name:
             type: string(100)
 }}}

 (MyISAM forced here because of ticket #1351; and BTW. I've found nice way
 to share export options - using YAML references ;))

 When I'm trying to export Searchable table it does not export
 doctrine_search columns (keyword, field, position) to php class and even
 to database. There are only ID and LANG columns (in DB and .php file):

 {{{
 abstract class BaseTableTranslationIndex extends Doctrine_Record
 {
   public function setTableDefinition()
   {
     $this->setTableName('table_translation_index');
     $this->hasColumn('id', 'integer', 10, array('type' => 'integer',
 'length' => 10, 'primary' => true));
     $this->hasColumn('lang', 'string', 2, array('fixed' => true, 'type' =>
 'string', 'length' => 2, 'primary' => true));
   }
 }
 }}}

 I think it is an issue of I18n - as you can see, there is column named
 "lang" which is not specified in schema (in key "fields"). When generating
 tables without exporting - it correctly creates in DB table with fields:
 id, lang, keyword, field and position.

 What is more, when Searchable is not a child of I18n Doctrine can export
 correctly its table (to DB and to file with fields: id, keyword, field and
 position) so it must be something with this i18n and "lang" column.

Comment (by eXtreme):

 No response? "Won't fix" until 2.0? So how can I do this export?

-- 
Ticket URL: <http://trac.doctrine-project.org/ticket/1403#comment:3>
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