Commit 93bacd3a authored by Fabio B. Silva's avatar Fabio B. Silva

test quoted primary key

parent 439d12ce
......@@ -131,4 +131,25 @@ class SqlitePlatformTest extends AbstractPlatformTestCase
{
$this->markTestSkipped('SQlite does not support ALTER Table.');
}
/**
* @group DDC-1845
*/
public function testGenerateTableSqlShouldNotAutoQuotePrimaryKey()
{
$table = new \Doctrine\DBAL\Schema\Table('test');
$table->addColumn('"like"', 'integer', array('notnull' => true, 'autoincrement' => true));
$table->setPrimaryKey(array('"like"'));
$createTableSQL = $this->_platform->getCreateTableSQL($table);
$this->assertEquals(
'CREATE TABLE test ("like" INTEGER NOT NULL, PRIMARY KEY("like"))',
$createTableSQL[0]
);
$this->assertEquals(
'ALTER TABLE test ADD PRIMARY KEY ("like")',
$this->_platform->getCreatePrimaryKeySQL($table->getIndex('primary'), 'test')
);
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment