Changeset 3769
- Timestamp:
- 02/14/08 12:49:20 (17 months ago)
- Location:
- branches/0.9
- Files:
-
- 3 modified
-
lib/Doctrine/Connection/Pgsql.php (modified) (1 diff)
-
lib/Doctrine/Export.php (modified) (1 diff)
-
tests/Export/PgsqlTestCase.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/0.9/lib/Doctrine/Connection/Pgsql.php
r2963 r3769 107 107 if (is_array($item)) { 108 108 foreach ($item as $key => $value) { 109 if (is_bool($value) ) {109 if (is_bool($value) || is_numeric($item)) { 110 110 $item[$key] = ($value) ? 'true' : 'false'; 111 111 } 112 112 } 113 113 } else { 114 if (is_bool($item) ) {114 if (is_bool($item) || is_numeric($item)) { 115 115 $item = ($item) ? 'true' : 'false'; 116 116 } -
branches/0.9/lib/Doctrine/Export.php
r3131 r3769 744 744 745 745 if ($field['type'] === 'boolean') { 746 $field s['default'] = $this->conn->convertBooleans($field['default']);746 $field['default'] = $this->conn->convertBooleans($field['default']); 747 747 } 748 748 $default = ' DEFAULT ' . $this->conn->quote($field['default'], $field['type']); -
branches/0.9/tests/Export/PgsqlTestCase.php
r2675 r3769 105 105 $name = 'mytable'; 106 106 $fields = array('name' => array('type' => 'char', 'length' => 10, 'default' => 'def'), 107 'type' => array('type' => 'integer', 'length' => 3, 'default' => 12) 107 'type' => array('type' => 'integer', 'length' => 3, 'default' => 12), 108 'is_active' => array('type' => 'boolean', 'default'=>'0'), 109 'is_admin' => array('type' => 'boolean', 'default'=>'true'), 108 110 ); 109 111 … … 111 113 $this->export->createTable($name, $fields, $options); 112 114 113 $this->assertEqual($this->adapter->pop(), 'CREATE TABLE mytable (name CHAR(10) DEFAULT \'def\', type INT DEFAULT 12, PRIMARY KEY(name, type))');115 $this->assertEqual($this->adapter->pop(), 'CREATE TABLE mytable (name CHAR(10) DEFAULT \'def\', type INT DEFAULT 12, is_active BOOLEAN DEFAULT false, is_admin BOOLEAN DEFAULT true, PRIMARY KEY(name, type))'); 114 116 } 115 117 public function testCreateTableSupportsMultiplePks()