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
4ecfa1d6
Commit
4ecfa1d6
authored
10 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Clean corrupted data for categories
Conflicts: htdocs/install/mysql/migration/repair.sql
parent
69683046
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/repair.sql
+12
-0
12 additions, 0 deletions
htdocs/install/mysql/migration/repair.sql
with
12 additions
and
0 deletions
htdocs/install/mysql/migration/repair.sql
+
12
−
0
View file @
4ecfa1d6
...
...
@@ -55,6 +55,18 @@ delete from llx_product_extrafields where fk_object not in (select rowid from ll
--delete from llx_societe_commerciaux where fk_soc not in (select rowid from llx_societe);
-- Fix: delete category child with no category parent.
drop
table
tmp_categorie
;
create
table
tmp_categorie
as
select
*
from
llx_categorie
;
-- select * from llx_categorie where fk_parent not in (select rowid from tmp_categorie) and fk_parent is not null and fk_parent <> 0;
delete
from
llx_categorie
where
fk_parent
not
in
(
select
rowid
from
tmp_categorie
)
and
fk_parent
is
not
null
and
fk_parent
<>
0
;
drop
table
tmp_categorie
;
-- Fix: delete orphelin category.
delete
from
llx_categorie_product
where
fk_categorie
not
in
(
select
rowid
from
llx_categorie
where
type
=
0
);
delete
from
llx_categorie_societe
where
fk_categorie
not
in
(
select
rowid
from
llx_categorie
where
type
in
(
1
,
2
));
delete
from
llx_categorie_member
where
fk_categorie
not
in
(
select
rowid
from
llx_categorie
where
type
=
3
);
-- Fix: delete orphelin deliveries. Note: deliveries are linked to shipment by llx_element_element only. No other links.
delete
from
llx_livraisondet
where
fk_livraison
not
in
(
select
fk_target
from
llx_element_element
where
targettype
=
'delivery'
)
AND
fk_livraison
not
in
(
select
fk_source
from
llx_element_element
where
sourcetype
=
'delivery'
);
delete
from
llx_livraison
where
rowid
not
in
(
select
fk_target
from
llx_element_element
where
targettype
=
'delivery'
)
AND
rowid
not
in
(
select
fk_source
from
llx_element_element
where
sourcetype
=
'delivery'
);
...
...
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