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
954b2770
Commit
954b2770
authored
Jan 05, 2016
by
Steve Müller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix string column type declarations with whitespace on SQLite
fixes #1339 closes #921
parent
1789f01c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
1 deletion
+30
-1
SqliteSchemaManager.php
lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php
+1
-1
SqliteSchemaManagerTest.php
.../Tests/DBAL/Functional/Schema/SqliteSchemaManagerTest.php
+29
-0
No files found.
lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php
View file @
954b2770
...
...
@@ -269,7 +269,7 @@ class SqliteSchemaManager extends AbstractSchemaManager
protected
function
_getPortableTableColumnDefinition
(
$tableColumn
)
{
$parts
=
explode
(
'('
,
$tableColumn
[
'type'
]);
$tableColumn
[
'type'
]
=
$parts
[
0
]
;
$tableColumn
[
'type'
]
=
trim
(
$parts
[
0
])
;
if
(
isset
(
$parts
[
1
]))
{
$length
=
trim
(
$parts
[
1
],
')'
);
$tableColumn
[
'length'
]
=
$length
;
...
...
tests/Doctrine/Tests/DBAL/Functional/Schema/SqliteSchemaManagerTest.php
View file @
954b2770
...
...
@@ -3,6 +3,7 @@
namespace
Doctrine\Tests\DBAL\Functional\Schema
;
use
Doctrine\DBAL\Schema
;
use
Doctrine\DBAL\Types\Type
;
class
SqliteSchemaManagerTest
extends
SchemaManagerFunctionalTestCase
{
...
...
@@ -156,6 +157,34 @@ EOS
$this
->
assertEquals
(
array
(
'other_id'
,
'id'
),
array_map
(
'strtolower'
,
$tableIndexes
[
'primary'
]
->
getColumns
()));
}
/**
* @group DBAL-1779
*/
public
function
testListTableColumnsWithWhitespacesInTypeDeclarations
()
{
$sql
=
<<<SQL
CREATE TABLE dbal_1779 (
foo VARCHAR (64) ,
bar TEXT (100)
)
SQL;
$this
->
_conn
->
executeQuery
(
$sql
);
$columns
=
$this
->
_sm
->
listTableColumns
(
'dbal_1779'
);
$this
->
assertCount
(
2
,
$columns
);
$this
->
assertArrayHasKey
(
'foo'
,
$columns
);
$this
->
assertArrayHasKey
(
'bar'
,
$columns
);
$this
->
assertSame
(
Type
::
getType
(
Type
::
STRING
),
$columns
[
'foo'
]
->
getType
());
$this
->
assertSame
(
Type
::
getType
(
Type
::
TEXT
),
$columns
[
'bar'
]
->
getType
());
$this
->
assertSame
(
64
,
$columns
[
'foo'
]
->
getLength
());
$this
->
assertSame
(
100
,
$columns
[
'bar'
]
->
getLength
());
}
/**
* @dataProvider getDiffListIntegerAutoincrementTableColumnsData
* @group DBAL-924
...
...
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