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
4dd8a6d2
Commit
4dd8a6d2
authored
Jul 16, 2012
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix SQLServer Rename Table Tests and implementation
parent
00ac50c0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
SQLServerPlatform.php
lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
+4
-4
SQLServerPlatformTest.php
...s/Doctrine/Tests/DBAL/Platforms/SQLServerPlatformTest.php
+1
-1
No files found.
lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
View file @
4dd8a6d2
...
@@ -317,10 +317,6 @@ class SQLServerPlatform extends AbstractPlatform
...
@@ -317,10 +317,6 @@ class SQLServerPlatform extends AbstractPlatform
$sql
=
array
();
$sql
=
array
();
$columnSql
=
array
();
$columnSql
=
array
();
if
(
$diff
->
newName
!==
false
)
{
$queryParts
[]
=
"sp_RENAME '"
.
$diff
->
name
.
"', '"
.
$diff
->
newName
.
"'"
;
}
foreach
(
$diff
->
addedColumns
as
$column
)
{
foreach
(
$diff
->
addedColumns
as
$column
)
{
if
(
$this
->
onSchemaAlterTableAddColumn
(
$column
,
$diff
,
$columnSql
))
{
if
(
$this
->
onSchemaAlterTableAddColumn
(
$column
,
$diff
,
$columnSql
))
{
continue
;
continue
;
...
@@ -370,6 +366,10 @@ class SQLServerPlatform extends AbstractPlatform
...
@@ -370,6 +366,10 @@ class SQLServerPlatform extends AbstractPlatform
$sql
=
array_merge
(
$sql
,
$this
->
_getAlterTableIndexForeignKeySQL
(
$diff
));
$sql
=
array_merge
(
$sql
,
$this
->
_getAlterTableIndexForeignKeySQL
(
$diff
));
if
(
$diff
->
newName
!==
false
)
{
$sql
[]
=
"sp_RENAME '"
.
$diff
->
name
.
"', '"
.
$diff
->
newName
.
"'"
;
}
return
array_merge
(
$sql
,
$tableSql
,
$columnSql
);
return
array_merge
(
$sql
,
$tableSql
,
$columnSql
);
}
}
...
...
tests/Doctrine/Tests/DBAL/Platforms/SQLServerPlatformTest.php
View file @
4dd8a6d2
...
@@ -28,11 +28,11 @@ class SQLServerPlatformTest extends AbstractPlatformTestCase
...
@@ -28,11 +28,11 @@ class SQLServerPlatformTest extends AbstractPlatformTestCase
public
function
getGenerateAlterTableSql
()
public
function
getGenerateAlterTableSql
()
{
{
return
array
(
return
array
(
'ALTER TABLE mytable RENAME TO userlist'
,
'ALTER TABLE mytable ADD quota INT DEFAULT NULL'
,
'ALTER TABLE mytable ADD quota INT DEFAULT NULL'
,
'ALTER TABLE mytable DROP COLUMN foo'
,
'ALTER TABLE mytable DROP COLUMN foo'
,
'ALTER TABLE mytable ALTER COLUMN baz NVARCHAR(255) DEFAULT \'def\' NOT NULL'
,
'ALTER TABLE mytable ALTER COLUMN baz NVARCHAR(255) DEFAULT \'def\' NOT NULL'
,
'ALTER TABLE mytable ALTER COLUMN bloo BIT DEFAULT \'0\' NOT NULL'
,
'ALTER TABLE mytable ALTER COLUMN bloo BIT DEFAULT \'0\' NOT NULL'
,
"sp_RENAME 'mytable', 'userlist'"
,
);
);
}
}
...
...
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