Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
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
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
65b049fd
Commit
65b049fd
authored
9 years ago
by
Regis Houssin
Browse files
Options
Downloads
Patches
Plain Diff
Fix: Drop foreign key for avoid Mysql crash
parent
51399543
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
htdocs/install/mysql/migration/3.6.0-3.7.0.sql
+4
-0
4 additions, 0 deletions
htdocs/install/mysql/migration/3.6.0-3.7.0.sql
with
4 additions
and
0 deletions
htdocs/install/mysql/migration/3.6.0-3.7.0.sql
+
4
−
0
View file @
65b049fd
...
...
@@ -208,10 +208,14 @@ UPDATE llx_product SET fk_barcode_type = NULL WHERE fk_barcode_type NOT IN (SELE
ALTER
TABLE
llx_product_price
ADD
INDEX
idx_product_price_fk_user_author
(
fk_user_author
);
UPDATE
llx_product_price
set
fk_user_author
=
null
where
fk_user_author
=
0
;
UPDATE
llx_product_price
set
fk_user_author
=
null
where
fk_user_author
not
in
(
select
rowid
from
llx_user
);
-- drop foreign key for avoid a mysql crash
ALTER
TABLE
llx_product_price
DROP
FOREIGN
KEY
fk_product_price_user_author
;
ALTER
TABLE
llx_product_price
ADD
CONSTRAINT
fk_product_price_user_author
FOREIGN
KEY
(
fk_user_author
)
REFERENCES
llx_user
(
rowid
);
-- fk_product
ALTER
TABLE
llx_product_price
ADD
INDEX
idx_product_price_fk_product
(
fk_product
);
DELETE
from
llx_product_price
where
fk_product
NOT
IN
(
SELECT
rowid
from
llx_product
);
-- drop foreign key for avoid a mysql crash
ALTER
TABLE
llx_product_price
DROP
FOREIGN
KEY
fk_product_price_product
;
ALTER
TABLE
llx_product_price
ADD
CONSTRAINT
fk_product_price_product
FOREIGN
KEY
(
fk_product
)
REFERENCES
llx_product
(
rowid
);
ALTER
TABLE
llx_commande_fournisseur
MODIFY
COLUMN
date_livraison
datetime
;
...
...
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