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
255c396d
Commit
255c396d
authored
Sep 23, 2014
by
Steve Müller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use identity sequence name for generating SQL to drop an autoincrement from a column
parent
e03569fa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
4 deletions
+45
-4
OraclePlatform.php
lib/Doctrine/DBAL/Platforms/OraclePlatform.php
+6
-4
OraclePlatformTest.php
tests/Doctrine/Tests/DBAL/Platforms/OraclePlatformTest.php
+39
-0
No files found.
lib/Doctrine/DBAL/Platforms/OraclePlatform.php
View file @
255c396d
...
...
@@ -533,14 +533,16 @@ END;';
public
function
getDropAutoincrementSql
(
$table
)
{
$table
=
$this
->
normalizeIdentifier
(
$table
);
$quotedTableName
=
$table
->
getQuotedName
(
$this
);
$unquotedTableName
=
$table
->
getName
();
$autoincrementIdentifierName
=
$this
->
getAutoincrementIdentifierName
(
$table
);
$identitySequenceName
=
$this
->
getIdentitySequenceName
(
$table
->
isQuoted
()
?
$table
->
getQuotedName
(
$this
)
:
$table
->
getName
(),
''
);
return
array
(
'DROP TRIGGER '
.
$autoincrementIdentifierName
,
$this
->
getDropSequenceSQL
(
$
unquotedTableName
.
'_SEQ'
),
// todo: needs to be fixed
$this
->
getDropConstraintSQL
(
$autoincrementIdentifierName
,
$
quotedTableName
),
$this
->
getDropSequenceSQL
(
$
identitySequenceName
),
$this
->
getDropConstraintSQL
(
$autoincrementIdentifierName
,
$
table
->
getQuotedName
(
$this
)
),
);
}
...
...
tests/Doctrine/Tests/DBAL/Platforms/OraclePlatformTest.php
View file @
255c396d
...
...
@@ -506,4 +506,43 @@ class OraclePlatformTest extends AbstractPlatformTestCase
'ALTER TABLE foo RENAME COLUMN bar TO baz'
,
);
}
/**
* @dataProvider getReturnsDropAutoincrementSQL
* @group DBAL-831
*/
public
function
testReturnsDropAutoincrementSQL
(
$table
,
$expectedSql
)
{
$this
->
assertSame
(
$expectedSql
,
$this
->
_platform
->
getDropAutoincrementSql
(
$table
));
}
public
function
getReturnsDropAutoincrementSQL
()
{
return
array
(
array
(
'myTable'
,
array
(
'DROP TRIGGER MYTABLE_AI_PK'
,
'DROP SEQUENCE MYTABLE_SEQ'
,
'ALTER TABLE MYTABLE DROP CONSTRAINT MYTABLE_AI_PK'
,
)
),
array
(
'"myTable"'
,
array
(
'DROP TRIGGER "myTable_AI_PK"'
,
'DROP SEQUENCE "myTable_SEQ"'
,
'ALTER TABLE "myTable" DROP CONSTRAINT "myTable_AI_PK"'
,
)
),
array
(
'table'
,
array
(
'DROP TRIGGER TABLE_AI_PK'
,
'DROP SEQUENCE TABLE_SEQ'
,
'ALTER TABLE "TABLE" DROP CONSTRAINT TABLE_AI_PK'
,
)
),
);
}
}
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