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