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
7284d6f3
Commit
7284d6f3
authored
May 04, 2013
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[DBAL-511] Strip ::type syntax from default column definition to make it comparable.
parent
ac0c0630
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 @
7284d6f3
...
@@ -258,6 +258,10 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
...
@@ -258,6 +258,10 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
$autoincrement
=
true
;
$autoincrement
=
true
;
}
}
if
(
preg_match
(
"/^'(.*)'::.*$/"
,
$tableColumn
[
'default'
],
$matches
))
{
$tableColumn
[
'default'
]
=
$matches
[
1
];
}
if
(
stripos
(
$tableColumn
[
'default'
],
'NULL'
)
===
0
)
{
if
(
stripos
(
$tableColumn
[
'default'
],
'NULL'
)
===
0
)
{
$tableColumn
[
'default'
]
=
null
;
$tableColumn
[
'default'
]
=
null
;
}
}
...
...
tests/Doctrine/Tests/DBAL/Functional/Schema/PostgreSqlSchemaManagerTest.php
View file @
7284d6f3
...
@@ -244,6 +244,23 @@ class PostgreSqlSchemaManagerTest extends SchemaManagerFunctionalTestCase
...
@@ -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
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