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
8a7b6229
Commit
8a7b6229
authored
Dec 31, 2013
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'DBAL-583' into 2.4
parents
27a65ac0
bcb68434
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
1 deletion
+29
-1
OraclePlatform.php
lib/Doctrine/DBAL/Platforms/OraclePlatform.php
+7
-1
OraclePlatformTest.php
tests/Doctrine/Tests/DBAL/Platforms/OraclePlatformTest.php
+22
-0
No files found.
lib/Doctrine/DBAL/Platforms/OraclePlatform.php
View file @
8a7b6229
...
@@ -614,7 +614,13 @@ LEFT JOIN user_cons_columns r_cols
...
@@ -614,7 +614,13 @@ LEFT JOIN user_cons_columns r_cols
* Do not add query part if only comment has changed
* Do not add query part if only comment has changed
*/
*/
if
(
!
(
$columnHasChangedComment
&&
count
(
$columnDiff
->
changedProperties
)
===
1
))
{
if
(
!
(
$columnHasChangedComment
&&
count
(
$columnDiff
->
changedProperties
)
===
1
))
{
$fields
[]
=
$column
->
getQuotedName
(
$this
)
.
' '
.
$this
->
getColumnDeclarationSQL
(
''
,
$column
->
toArray
());
$columnInfo
=
$column
->
toArray
();
if
(
!
$columnDiff
->
hasChanged
(
'notnull'
))
{
$columnInfo
[
'notnull'
]
=
false
;
}
$fields
[]
=
$column
->
getQuotedName
(
$this
)
.
' '
.
$this
->
getColumnDeclarationSQL
(
''
,
$columnInfo
);
}
}
if
(
$columnHasChangedComment
)
{
if
(
$columnHasChangedComment
)
{
...
...
tests/Doctrine/Tests/DBAL/Platforms/OraclePlatformTest.php
View file @
8a7b6229
...
@@ -308,4 +308,26 @@ class OraclePlatformTest extends AbstractPlatformTestCase
...
@@ -308,4 +308,26 @@ class OraclePlatformTest extends AbstractPlatformTestCase
'ALTER TABLE "quoted" ADD CONSTRAINT FK_WITH_INTENDED_QUOTATION FOREIGN KEY ("create", foo, "bar") REFERENCES "foo-bar" ("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")'
,
);
);
}
}
public
function
testAlterTableNotNULL
()
{
$tableDiff
=
new
\Doctrine\DBAL\Schema\TableDiff
(
'mytable'
);
$tableDiff
->
changedColumns
[
'foo'
]
=
new
\Doctrine\DBAL\Schema\ColumnDiff
(
'foo'
,
new
\Doctrine\DBAL\Schema\Column
(
'foo'
,
\Doctrine\DBAL\Types\Type
::
getType
(
'string'
),
array
(
'default'
=>
'bla'
,
'notnull'
=>
true
)
),
array
(
'type'
)
);
$tableDiff
->
changedColumns
[
'bar'
]
=
new
\Doctrine\DBAL\Schema\ColumnDiff
(
'bar'
,
new
\Doctrine\DBAL\Schema\Column
(
'baz'
,
\Doctrine\DBAL\Types\Type
::
getType
(
'string'
),
array
(
'default'
=>
'bla'
,
'notnull'
=>
true
)
),
array
(
'type'
,
'notnull'
)
);
$expectedSql
=
array
(
"ALTER TABLE mytable MODIFY (foo VARCHAR2(255) DEFAULT 'bla', baz VARCHAR2(255) DEFAULT 'bla' NOT NULL)"
,
);
$this
->
assertEquals
(
$expectedSql
,
$this
->
_platform
->
getAlterTableSQL
(
$tableDiff
));
}
}
}
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