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
7a993d2e
Commit
7a993d2e
authored
May 04, 2013
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'DBAL-511' into 2.3
parents
ac0c0630
7284d6f3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
PostgreSqlSchemaManager.php
lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php
+4
-0
PostgreSqlSchemaManagerTest.php
...ts/DBAL/Functional/Schema/PostgreSqlSchemaManagerTest.php
+17
-0
No files found.
lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php
View file @
7a993d2e
...
...
@@ -258,6 +258,10 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
$autoincrement
=
true
;
}
if
(
preg_match
(
"/^'(.*)'::.*$/"
,
$tableColumn
[
'default'
],
$matches
))
{
$tableColumn
[
'default'
]
=
$matches
[
1
];
}
if
(
stripos
(
$tableColumn
[
'default'
],
'NULL'
)
===
0
)
{
$tableColumn
[
'default'
]
=
null
;
}
...
...
tests/Doctrine/Tests/DBAL/Functional/Schema/PostgreSqlSchemaManagerTest.php
View file @
7a993d2e
...
...
@@ -244,6 +244,23 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
}
}
}
/**
* @group DBAL-511
*/
public
function
testDefaultValueCharacterVarying
()
{
$testTable
=
new
\Doctrine\DBAL\Schema\Table
(
'dbal511_default'
);
$testTable
->
addColumn
(
'id'
,
'integer'
);
$testTable
->
addColumn
(
'def'
,
'string'
,
array
(
'default'
=>
'foo'
));
$testTable
->
setPrimaryKey
(
array
(
'id'
));
$this
->
_sm
->
createTable
(
$testTable
);
$databaseTable
=
$this
->
_sm
->
listTableDetails
(
$testTable
->
getName
());
print_r
(
$databaseTable
);
}
}
class
MoneyType
extends
Type
...
...
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