Changeset 898
- Timestamp:
- 09/11/07 16:39:14 (1 year ago)
- Files:
-
- trunk/src/main/php/net/stubbles/rdbms/querybuilder/stubDatabaseMySQLQueryBuilder.php (modified) (3 diffs)
- trunk/src/main/php/net/stubbles/rdbms/querybuilder/stubDatabaseTableDescription.php (modified) (2 diffs)
- trunk/src/test/php/net/stubbles/rdbms/querybuilder/stubDatabaseTableDescriptionTestCase.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/main/php/net/stubbles/rdbms/querybuilder/stubDatabaseMySQLQueryBuilder.php
r655 r898 232 232 $query .= ' DEFAULT NULL'; 233 233 } else { 234 if ($column->isNullable() == false) {234 if ($column->isNullable() === false) { 235 235 $query .= ' NOT NULL'; 236 236 } … … 242 242 243 243 if ($column->isPrimaryKey() == true) { 244 if ($this->isNumericColumn($column->getType()) == true) {244 if ($this->isNumericColumn($column->getType()) === true) { 245 245 $query .= ' AUTO_INCREMENT'; 246 246 } … … 264 264 } 265 265 266 $query .= "\n) ENGINE = " . $tableDescription->getType(); 267 if ($tableDescription->hasCharacterSet() == true) { 266 $query .= "\n)"; 267 if ($tableDescription->hasType() === true) { 268 $query .= ' ENGINE = ' . $tableDescription->getType(); 269 } 270 271 if ($tableDescription->hasCharacterSet() === true) { 268 272 $query .= ' CHARACTER SET ' . $tableDescription->getCharacterSet(); 269 273 } 270 274 271 if ($tableDescription->hasCollation() == true) {275 if ($tableDescription->hasCollation() === true) { 272 276 $query .= ' COLLATE ' . $tableDescription->getCollation(); 273 277 } 274 278 275 if ($tableDescription->hasComment() == true) {279 if ($tableDescription->hasComment() === true) { 276 280 $query .= " COMMENT = '" . $tableDescription->getComment() . "'"; 277 281 } trunk/src/main/php/net/stubbles/rdbms/querybuilder/stubDatabaseTableDescription.php
r482 r898 29 29 * @var string 30 30 */ 31 protected $type = '';31 protected $type; 32 32 /** 33 33 * character set of the table … … 95 95 { 96 96 $this->type = $type; 97 } 98 99 /** 100 * check whether the table has a type 101 * 102 * @return bool 103 */ 104 public function hasType() 105 { 106 return (null != $this->type); 97 107 } 98 108 trunk/src/test/php/net/stubbles/rdbms/querybuilder/stubDatabaseTableDescriptionTestCase.php
r482 r898 46 46 public function testType() 47 47 { 48 $this->assertEqual($this->tableDescription->getType(), ''); 48 $this->assertNull($this->tableDescription->getType()); 49 $this->assertFalse($this->tableDescription->hasType()); 49 50 $this->tableDescription->setType('foo'); 50 51 $this->assertEqual($this->tableDescription->getType(), 'foo'); 52 $this->assertTrue($this->tableDescription->hasType()); 51 53 } 52 54
