Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
db2d1f68
Commit
db2d1f68
authored
12 years ago
by
Brice Maron
Browse files
Options
Downloads
Patches
Plain Diff
Fix migration problems for postgresql with MDB2 fix owncloud/apps#21
Ref of MDB2 bug is 19676
parent
1888ac0d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
3rdparty/MDB2/Driver/Manager/pgsql.php
+10
-1
10 additions, 1 deletion
3rdparty/MDB2/Driver/Manager/pgsql.php
with
10 additions
and
1 deletion
3rdparty/MDB2/Driver/Manager/pgsql.php
+
10
−
1
View file @
db2d1f68
...
...
@@ -363,6 +363,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
return
MDB2_OK
;
}
$unquoted_name
=
$name
;
$name
=
$db
->
quoteIdentifier
(
$name
,
true
);
if
(
!
empty
(
$changes
[
'remove'
])
&&
is_array
(
$changes
[
'remove'
]))
{
...
...
@@ -398,6 +399,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
if
(
!
empty
(
$changes
[
'change'
])
&&
is_array
(
$changes
[
'change'
]))
{
foreach
(
$changes
[
'change'
]
as
$field_name
=>
$field
)
{
$unquoted_field_name
=
$field_name
;
$field_name
=
$db
->
quoteIdentifier
(
$field_name
,
true
);
if
(
!
empty
(
$field
[
'definition'
][
'type'
]))
{
$server_info
=
$db
->
getServerVersion
();
...
...
@@ -419,7 +421,14 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
return
$result
;
}
}
if
(
array_key_exists
(
'default'
,
$field
[
'definition'
]))
{
if
(
array_key_exists
(
'autoincrement'
,
$field
[
'definition'
]))
{
$query
=
"ALTER
$field_name
SET DEFAULT nextval("
.
$db
->
quote
(
$unquoted_name
.
'_'
.
$unquoted_field_name
.
'_seq'
,
'text'
)
.
")"
;
$result
=
$db
->
exec
(
"ALTER TABLE
$name
$query
"
);
if
(
PEAR
::
isError
(
$result
))
{
return
$result
;
}
}
elseif
(
array_key_exists
(
'default'
,
$field
[
'definition'
]))
{
$query
=
"ALTER
$field_name
SET DEFAULT "
.
$db
->
quote
(
$field
[
'definition'
][
'default'
],
$field
[
'definition'
][
'type'
]);
$result
=
$db
->
exec
(
"ALTER TABLE
$name
$query
"
);
if
(
PEAR
::
isError
(
$result
))
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment