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
100192c6
Commit
100192c6
authored
Dec 04, 2012
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.3' of github.com:doctrine/dbal into 2.3
parents
9a10bd67
22a30c9c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
6 deletions
+34
-6
doctrine-dbal.php
bin/doctrine-dbal.php
+3
-3
SQLServerPlatform.php
lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
+28
-0
SQLServerPlatformTest.php
...s/Doctrine/Tests/DBAL/Platforms/SQLServerPlatformTest.php
+3
-3
No files found.
bin/doctrine-dbal.php
View file @
100192c6
...
@@ -5,7 +5,7 @@ require_once 'Doctrine/Common/ClassLoader.php';
...
@@ -5,7 +5,7 @@ require_once 'Doctrine/Common/ClassLoader.php';
$classLoader
=
new
\Doctrine\Common\ClassLoader
(
'Doctrine'
);
$classLoader
=
new
\Doctrine\Common\ClassLoader
(
'Doctrine'
);
$classLoader
->
register
();
$classLoader
->
register
();
$classLoader
=
new
\Doctrine\Common\ClassLoader
(
'Symfony'
,
'Doctrine'
);
$classLoader
=
new
\Doctrine\Common\ClassLoader
(
'Symfony'
);
$classLoader
->
register
();
$classLoader
->
register
();
$configFile
=
getcwd
()
.
DIRECTORY_SEPARATOR
.
'cli-config.php'
;
$configFile
=
getcwd
()
.
DIRECTORY_SEPARATOR
.
'cli-config.php'
;
...
...
lib/Doctrine/DBAL/Platforms/SQLServerPlatform.php
View file @
100192c6
...
@@ -896,4 +896,32 @@ class SQLServerPlatform extends AbstractPlatform
...
@@ -896,4 +896,32 @@ class SQLServerPlatform extends AbstractPlatform
{
{
return
'VARBINARY(MAX)'
;
return
'VARBINARY(MAX)'
;
}
}
/**
* {@inheritDoc}
*/
public
function
getDefaultValueDeclarationSQL
(
$field
)
{
if
(
!
isset
(
$field
[
'default'
]))
{
return
empty
(
$field
[
'notnull'
])
?
' NULL'
:
''
;
}
if
(
!
isset
(
$field
[
'type'
]))
{
return
" DEFAULT '"
.
$field
[
'default'
]
.
"'"
;
}
if
(
in_array
((
string
)
$field
[
'type'
],
array
(
'Integer'
,
'BigInteger'
,
'SmallInteger'
)))
{
return
" DEFAULT "
.
$field
[
'default'
];
}
if
((
string
)
$field
[
'type'
]
==
'DateTime'
&&
$field
[
'default'
]
==
$this
->
getCurrentTimestampSQL
())
{
return
" DEFAULT "
.
$this
->
getCurrentTimestampSQL
();
}
if
((
string
)
$field
[
'type'
]
==
'Boolean'
)
{
return
" DEFAULT '"
.
$this
->
convertBooleans
(
$field
[
'default'
])
.
"'"
;
}
return
" DEFAULT '"
.
$field
[
'default'
]
.
"'"
;
}
}
}
tests/Doctrine/Tests/DBAL/Platforms/SQLServerPlatformTest.php
View file @
100192c6
...
@@ -14,13 +14,13 @@ class SQLServerPlatformTest extends AbstractPlatformTestCase
...
@@ -14,13 +14,13 @@ class SQLServerPlatformTest extends AbstractPlatformTestCase
public
function
getGenerateTableSql
()
public
function
getGenerateTableSql
()
{
{
return
'CREATE TABLE test (id INT IDENTITY NOT NULL, test NVARCHAR(255)
DEFAULT
NULL, PRIMARY KEY (id))'
;
return
'CREATE TABLE test (id INT IDENTITY NOT NULL, test NVARCHAR(255) NULL, PRIMARY KEY (id))'
;
}
}
public
function
getGenerateTableWithMultiColumnUniqueIndexSql
()
public
function
getGenerateTableWithMultiColumnUniqueIndexSql
()
{
{
return
array
(
return
array
(
'CREATE TABLE test (foo NVARCHAR(255)
DEFAULT NULL, bar NVARCHAR(255) DEFAULT
NULL)'
,
'CREATE TABLE test (foo NVARCHAR(255)
NULL, bar NVARCHAR(255)
NULL)'
,
'CREATE UNIQUE INDEX UNIQ_D87F7E0C8C73652176FF8CAA ON test (foo, bar) WHERE foo IS NOT NULL AND bar IS NOT NULL'
'CREATE UNIQUE INDEX UNIQ_D87F7E0C8C73652176FF8CAA ON test (foo, bar) WHERE foo IS NOT NULL AND bar IS NOT NULL'
);
);
}
}
...
@@ -28,7 +28,7 @@ class SQLServerPlatformTest extends AbstractPlatformTestCase
...
@@ -28,7 +28,7 @@ class SQLServerPlatformTest extends AbstractPlatformTestCase
public
function
getGenerateAlterTableSql
()
public
function
getGenerateAlterTableSql
()
{
{
return
array
(
return
array
(
'ALTER TABLE mytable ADD quota INT
DEFAULT
NULL'
,
'ALTER TABLE mytable ADD quota INT 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'
,
...
...
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