[Solar-svn] Revision 2708

pmjones at solarphp.com pmjones at solarphp.com
Thu Aug 16 10:19:43 CDT 2007


Branch: Solar_Sql_Adapter: [FIX] Actually set default values when creating the table


Modified: branches/orm/Solar/Sql/Adapter.php
===================================================================
--- branches/orm/Solar/Sql/Adapter.php	2007-08-16 13:55:10 UTC (rev 2707)
+++ branches/orm/Solar/Sql/Adapter.php	2007-08-16 15:19:43 UTC (rev 2708)
@@ -1381,6 +1381,7 @@
     public function createTable($table, $cols)
     {
         $stmt = $this->_sqlCreateTable($table, $cols);
+        Solar::dump($stmt);
         $this->query($stmt);
     }
     
@@ -1785,6 +1786,11 @@
         // set the "NULL"/"NOT NULL" portion
         $coldef .= ($require) ? ' NOT NULL' : ' NULL';
         
+        // set the default value, if any
+        if ($default) {
+            $coldef .= ' DEFAULT ' . $this->quote($default);
+        }
+        
         // modify with auto-increment and primary-key portions
         $this->_modAutoincPrimary($coldef, $autoinc, $primary);
         




More information about the Solar-svn mailing list