Skip to content
Permalink
Browse files

Don't generate `COMMENT ''` in MySQL when creating tables.

Refs #4031
  • Loading branch information...
markstory committed Jul 21, 2014
1 parent c09e2b9 commit 9f49d17c9ade7d7b0ea1a045748dc3c91b78ee97
Showing with 5 additions and 2 deletions.
  1. +1 −1 src/Database/Schema/MysqlSchema.php
  2. +4 −1 tests/TestCase/Database/Schema/MysqlSchemaTest.php
@@ -323,7 +323,7 @@ public function columnSql(Table $table, $name) {
) {
$out .= ' DEFAULT CURRENT_TIMESTAMP';
}
if (isset($data['comment'])) {
if (isset($data['comment']) && $data['comment'] !== '') {
$out .= ' COMMENT ' . $this->_driver->schemaValue($data['comment']);
}
return $out;
@@ -700,7 +700,10 @@ public function testCreateSql() {
'null' => false,
'comment' => 'The title'
])
->addColumn('body', ['type' => 'text'])
->addColumn('body', [
'type' => 'text',
'comment' => ''
])
->addColumn('created', 'datetime')
->addConstraint('primary', [
'type' => 'primary',

0 comments on commit 9f49d17

Please sign in to comment.
You can’t perform that action at this time.