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
c2a40708
Commit
c2a40708
authored
Nov 13, 2011
by
Benjamin Eberlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reformulate table creation logic
parent
53ffb05e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
19 deletions
+20
-19
TypeConversionTest.php
tests/Doctrine/Tests/DBAL/Functional/TypeConversionTest.php
+20
-19
No files found.
tests/Doctrine/Tests/DBAL/Functional/TypeConversionTest.php
View file @
c2a40708
...
...
@@ -17,28 +17,29 @@ class TypeConversionTest extends \Doctrine\Tests\DbalFunctionalTestCase
/* @var $sm \Doctrine\DBAL\Schema\AbstractSchemaManager */
$sm
=
$this
->
_conn
->
getSchemaManager
();
if
(
!
$sm
->
tablesExist
(
array
(
'type_conversion'
)))
{
$table
=
new
\Doctrine\DBAL\Schema\Table
(
"type_conversion"
);
$table
->
addColumn
(
'id'
,
'integer'
,
array
(
'notnull'
=>
false
));
$table
->
addColumn
(
'test_string'
,
'string'
,
array
(
'notnull'
=>
false
));
$table
->
addColumn
(
'test_boolean'
,
'boolean'
,
array
(
'notnull'
=>
false
));
$table
->
addColumn
(
'test_bigint'
,
'bigint'
,
array
(
'notnull'
=>
false
));
$table
->
addColumn
(
'test_smallint'
,
'bigint'
,
array
(
'notnull'
=>
false
));
$table
->
addColumn
(
'test_datetime'
,
'datetime'
,
array
(
'notnull'
=>
false
));
$table
->
addColumn
(
'test_datetimetz'
,
'datetimetz'
,
array
(
'notnull'
=>
false
));
$table
->
addColumn
(
'test_date'
,
'date'
,
array
(
'notnull'
=>
false
));
$table
->
addColumn
(
'test_time'
,
'time'
,
array
(
'notnull'
=>
false
));
$table
->
addColumn
(
'test_text'
,
'text'
,
array
(
'notnull'
=>
false
));
$table
->
addColumn
(
'test_array'
,
'array'
,
array
(
'notnull'
=>
false
));
$table
->
addColumn
(
'test_object'
,
'object'
,
array
(
'notnull'
=>
false
));
$table
->
addColumn
(
'test_float'
,
'float'
,
array
(
'notnull'
=>
false
));
$table
->
addColumn
(
'test_decimal'
,
'decimal'
,
array
(
'notnull'
=>
false
,
'scale'
=>
2
,
'precision'
=>
10
));
$table
->
setPrimaryKey
(
array
(
'id'
));
$table
=
new
\Doctrine\DBAL\Schema\Table
(
"type_conversion"
);
$table
->
addColumn
(
'id'
,
'integer'
,
array
(
'notnull'
=>
false
));
$table
->
addColumn
(
'test_string'
,
'string'
,
array
(
'notnull'
=>
false
));
$table
->
addColumn
(
'test_boolean'
,
'boolean'
,
array
(
'notnull'
=>
false
));
$table
->
addColumn
(
'test_bigint'
,
'bigint'
,
array
(
'notnull'
=>
false
));
$table
->
addColumn
(
'test_smallint'
,
'bigint'
,
array
(
'notnull'
=>
false
));
$table
->
addColumn
(
'test_datetime'
,
'datetime'
,
array
(
'notnull'
=>
false
));
$table
->
addColumn
(
'test_datetimetz'
,
'datetimetz'
,
array
(
'notnull'
=>
false
));
$table
->
addColumn
(
'test_date'
,
'date'
,
array
(
'notnull'
=>
false
));
$table
->
addColumn
(
'test_time'
,
'time'
,
array
(
'notnull'
=>
false
));
$table
->
addColumn
(
'test_text'
,
'text'
,
array
(
'notnull'
=>
false
));
$table
->
addColumn
(
'test_array'
,
'array'
,
array
(
'notnull'
=>
false
));
$table
->
addColumn
(
'test_object'
,
'object'
,
array
(
'notnull'
=>
false
));
$table
->
addColumn
(
'test_float'
,
'float'
,
array
(
'notnull'
=>
false
));
$table
->
addColumn
(
'test_decimal'
,
'decimal'
,
array
(
'notnull'
=>
false
,
'scale'
=>
2
,
'precision'
=>
10
));
$table
->
setPrimaryKey
(
array
(
'id'
));
try
{
foreach
(
$this
->
_conn
->
getDatabasePlatform
()
->
getCreateTableSQL
(
$table
)
AS
$sql
)
{
$this
->
_conn
->
executeQuery
(
$sql
);
}
}
catch
(
\Exception
$e
)
{
}
}
...
...
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