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
488183a8
Commit
488183a8
authored
Jan 20, 2016
by
Steve Müller
Committed by
Marco Pivetta
Sep 09, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add test case for adding non autoincrement column to primary key with autoincrement column on MySQL
parent
d1929749
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
AbstractMySQLPlatformTestCase.php
...ne/Tests/DBAL/Platforms/AbstractMySQLPlatformTestCase.php
+27
-0
No files found.
tests/Doctrine/Tests/DBAL/Platforms/AbstractMySQLPlatformTestCase.php
View file @
488183a8
...
@@ -411,6 +411,33 @@ abstract class AbstractMySQLPlatformTestCase extends AbstractPlatformTestCase
...
@@ -411,6 +411,33 @@ abstract class AbstractMySQLPlatformTestCase extends AbstractPlatformTestCase
);
);
}
}
/**
* @group DBAL-2302
*/
public
function
testAddNonAutoincrementColumnToPrimaryKeyWithAutoincrementColumn
()
{
$table
=
new
Table
(
"tbl"
);
$table
->
addColumn
(
'id'
,
'integer'
,
array
(
'autoincrement'
=>
true
));
$table
->
addColumn
(
'foo'
,
'integer'
);
$table
->
addColumn
(
'bar'
,
'integer'
);
$table
->
setPrimaryKey
(
array
(
'id'
));
$comparator
=
new
Comparator
();
$diffTable
=
clone
$table
;
$diffTable
->
dropPrimaryKey
();
$diffTable
->
setPrimaryKey
(
array
(
'id'
,
'foo'
));
$this
->
assertSame
(
array
(
'ALTER TABLE tbl MODIFY id INT NOT NULL'
,
'ALTER TABLE tbl DROP PRIMARY KEY'
,
'ALTER TABLE tbl ADD PRIMARY KEY (id, foo)'
,
),
$this
->
_platform
->
getAlterTableSQL
(
$comparator
->
diffTable
(
$table
,
$diffTable
))
);
}
/**
/**
* @group DBAL-586
* @group DBAL-586
*/
*/
...
...
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