Changeset 4779 for branches/1.0

Show
Ignore:
Timestamp:
08/19/08 02:44:07 (5 months ago)
Author:
guilhermeblanco
Message:

fixed #1266. Thanks for the information!
Also I removed the comments I added previously in JoinConditionTestCase?.php

Location:
branches/1.0
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • branches/1.0/lib/Doctrine/Export.php

    r4778 r4779  
    716716                    ' ' . $this->getCollationFieldDeclaration($field['collation']) : ''; 
    717717 
    718         $notnull   = (isset($field['notnull']) && $field['notnull']) ? ' NOT NULL' : ''; 
     718        $notnull   = $this->getNotNullFieldDeclaration($field); 
    719719 
    720720        $unique    = (isset($field['unique']) && $field['unique']) ? 
     
    774774        return $default; 
    775775    } 
     776     
     777 
     778    /** 
     779     * getDefaultDeclaration 
     780     * Obtain DBMS specific SQL code portion needed to set a NOT NULL 
     781     * declaration to be used in statements like CREATE TABLE. 
     782     * 
     783     * @param array $field      field definition array 
     784     * @return string           DBMS specific SQL code portion needed to set a default value 
     785     */ 
     786    public function getNotNullFieldDeclaration(array $definition) 
     787    { 
     788        return (isset($field['notnull']) && $field['notnull']) ? ' NOT NULL' : ''; 
     789    } 
     790     
    776791 
    777792    /** 
  • branches/1.0/lib/Doctrine/Export/Mssql.php

    r4775 r4779  
    254254        return 'DROP TABLE ' . $sequenceName; 
    255255    } 
     256     
     257     
     258    /** 
     259     * getDefaultDeclaration 
     260     * Obtain DBMS specific SQL code portion needed to set a NOT NULL 
     261     * declaration to be used in statements like CREATE TABLE. 
     262     * 
     263     * @param array $field      field definition array 
     264     * @return string           DBMS specific SQL code portion needed to set a default value 
     265     */ 
     266    public function getNotNullFieldDeclaration(array $definition) 
     267    { 
     268        return (isset($field['notnull']) && $field['notnull']) ? ' NOT NULL' : ' NULL'; 
     269    } 
    256270} 
  • branches/1.0/tests/Query/JoinConditionTestCase.php

    r4777 r4779  
    3939    { } 
    4040 
    41     /*public function testJoinConditionsAreSupportedForOneToManyLeftJoins() 
     41    public function testJoinConditionsAreSupportedForOneToManyLeftJoins() 
    4242    { 
    4343        $q = new Doctrine_Query(); 
     
    8282 
    8383        $this->assertEqual($q->getQuery(), "SELECT e.id AS e__id, e.name AS e__name, p.id AS p__id FROM entity e LEFT JOIN phonenumber p ON e.name = p.phonenumber WHERE (e.type = 0)"); 
    84     }*/ 
    85      
     84    } 
     85 
    8686    public function testJoinWithConditionAndNotInClause() 
    8787    {