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
899c98d0
Commit
899c98d0
authored
Sep 30, 2013
by
Guilherme Blanco
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #375 from flip111/patch-1
Update SQLServerPlatform.php by adding methods related to schema.
parents
e0ffc8a9
f8760697
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
0 deletions
+35
-0
SQLServerPlatform.php
lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
+16
-0
SQLServerPlatformTest.php
...s/Doctrine/Tests/DBAL/Platforms/SQLServerPlatformTest.php
+19
-0
No files found.
lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
View file @
899c98d0
...
...
@@ -163,6 +163,22 @@ class SQLServerPlatform extends AbstractPlatform
return
false
;
}
/**
* {@inheritDoc}
*/
public
function
getCreateSchemaSQL
(
$schemaName
)
{
return
'CREATE SCHEMA '
.
$schemaName
;
}
/**
* {@inheritDoc}
*/
public
function
schemaNeedsCreation
(
$schemaName
)
{
return
$schemaName
!==
'dbo'
;
}
/**
* {@inheritDoc}
*/
...
...
tests/Doctrine/Tests/DBAL/Platforms/SQLServerPlatformTest.php
View file @
899c98d0
...
...
@@ -317,4 +317,23 @@ class SQLServerPlatformTest extends AbstractPlatformTestCase
'ALTER TABLE [quoted] ADD CONSTRAINT FK_WITH_INTENDED_QUOTATION FOREIGN KEY ([create], foo, [bar]) REFERENCES [foo-bar] ([create], bar, [foo-bar])'
,
);
}
public
function
testGetCreateSchemaSQL
()
{
$schemaName
=
'schema'
;
$sql
=
$this
->
_platform
->
getCreateSchemaSQL
(
$schemaName
);
$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
);
}
}
}
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