Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
9c042ee8
Commit
9c042ee8
authored
Oct 09, 2013
by
Steve Müller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rebase platform and tests
parent
9f6a405e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
12 deletions
+10
-12
SQLAnywherePlatform.php
lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php
+5
-5
SQLAnywherePlatformTest.php
...Doctrine/Tests/DBAL/Platforms/SQLAnywherePlatformTest.php
+5
-7
No files found.
lib/Doctrine/DBAL/Platforms/SQLAnywherePlatform.php
View file @
9c042ee8
...
@@ -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
->
get
LocalColumns
(
);
$localColumns
=
$foreignKey
->
get
QuotedLocalColumns
(
$this
);
$foreignColumns
=
$foreignKey
->
get
ForeignColumns
(
);
$foreignColumns
=
$foreignKey
->
get
QuotedForeignColumns
(
$this
);
$foreignTableName
=
$foreignKey
->
get
ForeignTableName
(
);
$foreignTableName
=
$foreignKey
->
get
QuotedForeignTableName
(
$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
->
get
Columns
(
);
$indexColumns
=
$index
->
get
QuotedColumns
(
$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
->
get
Columns
(
);
$indexColumns
=
$index
->
get
QuotedColumns
(
$this
);
if
(
empty
(
$indexColumns
))
{
if
(
empty
(
$indexColumns
))
{
throw
new
\InvalidArgumentException
(
"Incomplete definition. 'columns' required."
);
throw
new
\InvalidArgumentException
(
"Incomplete definition. 'columns' required."
);
...
...
tests/Doctrine/Tests/DBAL/Platforms/SQLAnywherePlatformTest.php
View file @
9c042ee8
...
@@ -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_22660D028
A90ABA9 ON "quoted" ("key
")'
'CREATE INDEX IDX_22660D028
FD6E0FB 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'"
,
);
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment