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
ade10e9a
Commit
ade10e9a
authored
Jun 06, 2010
by
beberlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix to support DDC-133 in the DBAL
parent
e0e599f9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
AbstractAsset.php
lib/Doctrine/DBAL/Schema/AbstractAsset.php
+5
-1
TableTest.php
tests/Doctrine/Tests/DBAL/Schema/TableTest.php
+12
-0
No files found.
lib/Doctrine/DBAL/Schema/AbstractAsset.php
View file @
ade10e9a
...
@@ -81,6 +81,10 @@ abstract class AbstractAsset
...
@@ -81,6 +81,10 @@ abstract class AbstractAsset
},
$columnNames
);
},
$columnNames
);
$parts
[]
=
$postfix
;
$parts
[]
=
$postfix
;
return
trim
(
implode
(
"_"
,
$parts
),
'_'
);
$identifier
=
trim
(
implode
(
"_"
,
$parts
),
'_'
);
// using implicit schema support of DB2 and Postgres there might be dots in the auto-generated
// identifier names which can easily be replaced by underscores.
$identifier
=
str_replace
(
"."
,
"_"
,
$identifier
);
return
$identifier
;
}
}
}
}
\ No newline at end of file
tests/Doctrine/Tests/DBAL/Schema/TableTest.php
View file @
ade10e9a
...
@@ -359,4 +359,16 @@ class TableTest extends \PHPUnit_Framework_TestCase
...
@@ -359,4 +359,16 @@ class TableTest extends \PHPUnit_Framework_TestCase
$this
->
assertTrue
(
$column
->
getNotnull
());
$this
->
assertTrue
(
$column
->
getNotnull
());
}
}
/**
* @group DDC-133
*/
public
function
testAllowImplicitSchemaTableInAutogeneratedIndexNames
()
{
$table
=
new
Table
(
"foo.bar"
);
$table
->
addColumn
(
'baz'
,
'integer'
,
array
());
$table
->
addIndex
(
array
(
'baz'
));
$this
->
assertTrue
(
$table
->
hasIndex
(
'foo_bar_baz_idx'
));
}
}
}
\ No newline at end of file
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