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
1625836c
Commit
1625836c
authored
Apr 02, 2014
by
Steve Müller
Committed by
Marco Pivetta
Aug 18, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
revert platform check for schemas needing creation
parent
54c67005
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
2 additions
and
68 deletions
+2
-68
AbstractPlatform.php
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
+0
-13
PostgreSqlPlatform.php
lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
+0
-8
SQLServerPlatform.php
lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
+0
-8
CreateSchemaSqlCollector.php
...Doctrine/DBAL/Schema/Visitor/CreateSchemaSqlCollector.php
+1
-1
AbstractPlatformTestCase.php
...octrine/Tests/DBAL/Platforms/AbstractPlatformTestCase.php
+0
-8
AbstractPostgreSqlPlatformTestCase.php
...sts/DBAL/Platforms/AbstractPostgreSqlPlatformTestCase.php
+0
-13
AbstractSQLServerPlatformTestCase.php
...ests/DBAL/Platforms/AbstractSQLServerPlatformTestCase.php
+0
-12
CreateSchemaSqlCollectorTest.php
...ests/DBAL/Schema/Visitor/CreateSchemaSqlCollectorTest.php
+1
-5
No files found.
lib/Doctrine/DBAL/Platforms/AbstractPlatform.php
View file @
1625836c
...
...
@@ -1788,19 +1788,6 @@ abstract class AbstractPlatform
throw
DBALException
::
notSupported
(
__METHOD__
);
}
/**
* Checks whether the schema $schemaName needs creating.
*
* @param string $schemaName
*
* @return boolean
* @throws \Doctrine\DBAL\DBALException If not supported on this platform.
*/
public
function
schemaNeedsCreation
(
$schemaName
)
{
throw
DBALException
::
notSupported
(
__METHOD__
);
}
/**
* Quotes a string so that it can be safely used as a table or column name,
* even if it is a reserved word of the platform. This also detects identifier
...
...
lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
View file @
1625836c
...
...
@@ -668,14 +668,6 @@ class PostgreSqlPlatform extends AbstractPlatform
return
'CREATE SCHEMA '
.
$schemaName
;
}
/**
* {@inheritDoc}
*/
public
function
schemaNeedsCreation
(
$schemaName
)
{
return
!
in_array
(
$schemaName
,
array
(
'default'
,
'public'
));
}
/**
* {@inheritDoc}
*/
...
...
lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
View file @
1625836c
...
...
@@ -155,14 +155,6 @@ class SQLServerPlatform extends AbstractPlatform
return
'CREATE SCHEMA '
.
$schemaName
;
}
/**
* {@inheritDoc}
*/
public
function
schemaNeedsCreation
(
$schemaName
)
{
return
$schemaName
!==
'dbo'
;
}
/**
* {@inheritDoc}
*/
...
...
lib/Doctrine/DBAL/Schema/Visitor/CreateSchemaSqlCollector.php
View file @
1625836c
...
...
@@ -140,7 +140,7 @@ class CreateSchemaSqlCollector extends AbstractVisitor
$sql
=
array
();
foreach
(
array_keys
(
$this
->
createTableQueries
)
as
$namespace
)
{
if
(
$this
->
platform
->
supportsSchemas
()
&&
$this
->
platform
->
schemaNeedsCreation
(
$namespace
)
)
{
if
(
$this
->
platform
->
supportsSchemas
())
{
$query
=
$this
->
platform
->
getCreateSchemaSQL
(
$namespace
);
$sql
[]
=
$query
;
}
...
...
tests/Doctrine/Tests/DBAL/Platforms/AbstractPlatformTestCase.php
View file @
1625836c
...
...
@@ -506,14 +506,6 @@ abstract class AbstractPlatformTestCase extends \Doctrine\Tests\DbalTestCase
$this
->
_platform
->
getCreateSchemaSQL
(
'schema'
);
}
/**
* @expectedException \Doctrine\DBAL\DBALException
*/
public
function
testSchemaNeedsCreation
()
{
$this
->
_platform
->
schemaNeedsCreation
(
'schema'
);
}
/**
* @group DBAL-585
*/
...
...
tests/Doctrine/Tests/DBAL/Platforms/AbstractPostgreSqlPlatformTestCase.php
View file @
1625836c
...
...
@@ -387,19 +387,6 @@ abstract class AbstractPostgreSqlPlatformTestCase extends AbstractPlatformTestCa
$this
->
assertEquals
(
'CREATE SCHEMA '
.
$schemaName
,
$sql
);
}
public
function
testSchemaNeedsCreation
()
{
$schemaNames
=
array
(
'default'
=>
false
,
'public'
=>
false
,
'schema'
=>
true
,
);
foreach
(
$schemaNames
as
$name
=>
$expected
)
{
$actual
=
$this
->
_platform
->
schemaNeedsCreation
(
$name
);
$this
->
assertEquals
(
$expected
,
$actual
);
}
}
public
function
testAlterDecimalPrecisionScale
()
{
...
...
tests/Doctrine/Tests/DBAL/Platforms/AbstractSQLServerPlatformTestCase.php
View file @
1625836c
...
...
@@ -472,18 +472,6 @@ abstract class AbstractSQLServerPlatformTestCase extends AbstractPlatformTestCas
$this
->
assertEquals
(
'CREATE SCHEMA '
.
$schemaName
,
$sql
);
}
public
function
testSchemaNeedsCreation
()
{
$schemaNames
=
array
(
'dbo'
=>
false
,
'schema'
=>
true
,
);
foreach
(
$schemaNames
as
$name
=>
$expected
)
{
$actual
=
$this
->
_platform
->
schemaNeedsCreation
(
$name
);
$this
->
assertEquals
(
$expected
,
$actual
);
}
}
/**
* @group DBAL-543
*/
...
...
tests/Doctrine/Tests/DBAL/Schema/Visitor/CreateSchemaSqlCollectorTest.php
View file @
1625836c
...
...
@@ -10,17 +10,13 @@ class CreateSchemaSqlCollectorTest extends \PHPUnit_Framework_TestCase
{
$platformMock
=
$this
->
getMock
(
'Doctrine\DBAL\Platforms\PostgreSqlPlatform'
,
array
(
'supportsSchemas'
,
'
schemaNeedsCreation'
,
'
getCreateTableSQL'
)
array
(
'supportsSchemas'
,
'getCreateTableSQL'
)
);
$platformMock
->
expects
(
$this
->
any
())
->
method
(
'supportsSchemas'
)
->
will
(
$this
->
returnValue
(
true
));
$platformMock
->
expects
(
$this
->
any
())
->
method
(
'schemaNeedsCreation'
)
->
will
(
$this
->
returnValue
(
true
));
$platformMock
->
expects
(
$this
->
any
())
->
method
(
'getCreateTableSQL'
)
->
will
(
$this
->
returnValue
(
array
(
'foo'
)));
...
...
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