#1443: Doctrine_Template_Versionable->setUp() has errors
--------------------------------------+-------------------------------------
 Reporter:  nodkz                     |       Owner:  jwage
     Type:  defect                    |      Status:  new  
 Priority:  major                     |   Milestone:  1.0.2
Component:  Versionable               |     Version:  1.0  
 Keywords:  setup, hascolumn, bigint  |    Has_test:  0    
 Mystatus:  Pending Core Response     |   Has_patch:  0    
--------------------------------------+-------------------------------------
 Let's look on Doctrine_Template_Versionable->setUp() function

 {{{
 class Doctrine_Template_Versionable extends Doctrine_Template
 {
     public function setUp()
     {
         if ($this->_plugin->getOption('auditLog')) {
             $this->_plugin->initialize($this->_table);
         }

         $this->hasColumn('version', 'integer', 8);    // <--- THIS LINE OF
 CODE MUST BE A BIT COMPLEX

         $this->addListener(new
 Doctrine_AuditLog_Listener($this->_plugin));
     }
 }
 }}}

 $this->hasColumn('version', 'integer', 8); overwrite my Model definition
 for column version.
 In my model I write that length of column 'version' is 4 byte (INT for
 MySQL).

 But when in BaseModel->setUp() function was called
 $this->actAs($versionable0) it calls
 Doctrine_Template_Versionable->setUp() and after that my VERSION column
 become 8 byte length (BIGINT for MySQL). That's no gooooood :(

 -------
 Also it produce an error, if we would give another name of VERSION column.
 {{{
 $this->actAs('Versionable', array('versionColumn' => 'news_version'));
 }}}

 So in DB we will have collumns:

 :   news_version   INT      -    this from BaseModel->setTableDefinition()

 :   version        BIGINT   -    this from
 Doctrine_Template_Versionable->setUp()

-- 
Ticket URL: <http://trac.doctrine-project.org/ticket/1443>
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