Private GIT
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
centreon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vlbox
centreon
Commits
fdbd44a5
Commit
fdbd44a5
authored
Oct 9, 2017
by
Kevin Duret
Committed by
Matthieu Kermagoret
Oct 10, 2017
Browse files
Options
Downloads
Patches
Plain Diff
fix(upgrade): fix foregin key upgrade of traps_group table
parent
05015314
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
www/install/php/Update-2.8.14_to_2.8.15.php
+14
-0
14 additions, 0 deletions
www/install/php/Update-2.8.14_to_2.8.15.php
with
14 additions
and
0 deletions
www/install/php/Update-2.8.14_to_2.8.15.php
+
14
−
0
View file @
fdbd44a5
...
@@ -37,17 +37,31 @@ if (isset($pearDB)) {
...
@@ -37,17 +37,31 @@ if (isset($pearDB)) {
"SHOW INDEXES FROM `traps_group` WHERE key_name = 'PRIMARY'"
"SHOW INDEXES FROM `traps_group` WHERE key_name = 'PRIMARY'"
);
);
if
(
$res
->
numRows
()
<=
0
)
{
if
(
$res
->
numRows
()
<=
0
)
{
$pearDB
->
query
(
"ALTER TABLE `traps_group_relation` "
.
"DROP FOREIGN KEY `traps_group_relation_ibfk_2`"
);
$pearDB
->
query
(
$pearDB
->
query
(
"ALTER TABLE `traps_group` "
.
"ALTER TABLE `traps_group` "
.
" CHANGE COLUMN `traps_group_id` "
.
" CHANGE COLUMN `traps_group_id` "
.
" `traps_group_id` INT NOT NULL AUTO_INCREMENT"
" `traps_group_id` INT NOT NULL AUTO_INCREMENT"
);
);
$pearDB
->
query
(
"ALTER TABLE `traps_group_relation` "
.
"ADD CONSTRAINT `traps_group_relation_ibfk_2` "
.
"FOREIGN KEY (`traps_group_id`) REFERENCES `traps_group` (`traps_group_id`) ON DELETE CASCADE"
);
$pearDB
->
query
(
$pearDB
->
query
(
"ALTER TABLE `traps_group` ADD PRIMARY KEY (`traps_group_id`)"
"ALTER TABLE `traps_group` ADD PRIMARY KEY (`traps_group_id`)"
);
);
$pearDB
->
query
(
$pearDB
->
query
(
"ALTER TABLE `traps_group` "
.
"ALTER TABLE `traps_group` "
.
" DROP KEY `traps_group_id`"
" DROP KEY `traps_group_id`"
);
);
}
}
}
}
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