Commit 9c042ee8 authored by Steve Müller's avatar Steve Müller

rebase platform and tests

parent 9f6a405e
......@@ -496,9 +496,9 @@ class SQLAnywherePlatform extends AbstractPlatform
{
$sql = '';
$foreignKeyName = $foreignKey->getName();
$localColumns = $foreignKey->getLocalColumns();
$foreignColumns = $foreignKey->getForeignColumns();
$foreignTableName = $foreignKey->getForeignTableName();
$localColumns = $foreignKey->getQuotedLocalColumns($this);
$foreignColumns = $foreignKey->getQuotedForeignColumns($this);
$foreignTableName = $foreignKey->getQuotedForeignTableName($this);
if ( ! empty($foreignKeyName)) {
$sql .= 'CONSTRAINT ' . $foreignKey->getQuotedName($this) . ' ';
......@@ -864,7 +864,7 @@ class SQLAnywherePlatform extends AbstractPlatform
*/
public function getPrimaryKeyDeclarationSQL(Index $index, $name = null)
{
$indexColumns = $index->getColumns();
$indexColumns = $index->getQuotedColumns($this);
if (empty($indexColumns)) {
throw new \InvalidArgumentException("Incomplete definition. 'columns' required.");
......@@ -1016,7 +1016,7 @@ class SQLAnywherePlatform extends AbstractPlatform
*/
public function getUniqueConstraintDeclarationSQL($name, Index $index)
{
$indexColumns = $index->getColumns();
$indexColumns = $index->getQuotedColumns($this);
if (empty($indexColumns)) {
throw new \InvalidArgumentException("Incomplete definition. 'columns' required.");
......
......@@ -64,25 +64,22 @@ class SQLAnywherePlatformTest extends AbstractPlatformTestCase
protected function getQuotedColumnInForeignKeySQL()
{
return array(
'CREATE TABLE "quoted" ("create" VARCHAR(255) NOT NULL, foo VARCHAR(255) NOT NULL, "bar" VARCHAR(255) NOT NULL)',
'ALTER TABLE "quoted" ADD CONSTRAINT FK_WITH_RESERVED_KEYWORD FOREIGN KEY ("create", foo, "bar") REFERENCES "foreign" ("create", bar, "foo-bar")',
'ALTER TABLE "quoted" ADD CONSTRAINT FK_WITH_NON_RESERVED_KEYWORD FOREIGN KEY ("create", foo, "bar") REFERENCES foo ("create", bar, "foo-bar")',
'ALTER TABLE "quoted" ADD CONSTRAINT FK_WITH_INTENDED_QUOTATION FOREIGN KEY ("create", foo, "bar") REFERENCES "foo-bar" ("create", bar, "foo-bar")',
'CREATE TABLE "quoted" ("create" VARCHAR(255) NOT NULL, foo VARCHAR(255) NOT NULL, "bar" VARCHAR(255) NOT NULL, CONSTRAINT FK_WITH_RESERVED_KEYWORD FOREIGN KEY ("create", foo, "bar") REFERENCES "foreign" ("create", bar, "foo-bar"), CONSTRAINT FK_WITH_NON_RESERVED_KEYWORD FOREIGN KEY ("create", foo, "bar") REFERENCES foo ("create", bar, "foo-bar"), CONSTRAINT FK_WITH_INTENDED_QUOTATION FOREIGN KEY ("create", foo, "bar") REFERENCES "foo-bar" ("create", bar, "foo-bar"))',
);
}
protected function getQuotedColumnInIndexSQL()
{
return array(
'CREATE TABLE "quoted" ("key" VARCHAR(255) NOT NULL)',
'CREATE INDEX IDX_22660D028A90ABA9 ON "quoted" ("key")'
'CREATE TABLE "quoted" ("create" VARCHAR(255) NOT NULL)',
'CREATE INDEX IDX_22660D028FD6E0FB ON "quoted" ("create")'
);
}
protected function getQuotedColumnInPrimaryKeySQL()
{
return array(
'CREATE TABLE "quoted" ("key" VARCHAR(255) NOT NULL, PRIMARY KEY ("key"))'
'CREATE TABLE "quoted" ("create" VARCHAR(255) NOT NULL, PRIMARY KEY ("create"))'
);
}
......@@ -99,6 +96,7 @@ class SQLAnywherePlatformTest extends AbstractPlatformTestCase
return array(
"ALTER TABLE mytable ADD quota INT NOT NULL",
"COMMENT ON COLUMN mytable.quota IS 'A comment'",
"COMMENT ON COLUMN mytable.foo IS NULL",
"COMMENT ON COLUMN mytable.baz IS 'B comment'",
);
}
......
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