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
64eef9f8
Commit
64eef9f8
authored
7 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Fix compatibility with pgsql
parent
06c7cb5d
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
+1
-1
1 addition, 1 deletion
htdocs/install/mysql/migration/repair.sql
with
1 addition
and
1 deletion
htdocs/install/mysql/migration/repair.sql
+
1
−
1
View file @
64eef9f8
...
...
@@ -100,7 +100,7 @@ DELETE FROM llx_product_stock WHERE reel = 0 AND rowid NOT IN (SELECT fk_product
DROP
TABLE
tmp_llx_product_batch
;
DROP
TABLE
tmp_llx_product_batch2
;
CREATE
TABLE
tmp_llx_product_batch
AS
select
fk_product_stock
,
eatby
,
sellby
,
batch
,
SUM
(
qty
)
as
qty
,
COUNT
(
rowid
)
as
nb
FROM
llx_product_batch
GROUP
BY
fk_product_stock
,
eatby
,
sellby
,
batch
HAVING
COUNT
(
rowid
)
>
1
;
CREATE
TABLE
tmp_llx_product_batch2
AS
select
pb
.
rowid
,
pb
.
fk_product_stock
,
pb
.
eatby
,
pb
.
sellby
,
pb
.
batch
,
pb
.
qty
from
llx_product_batch
as
pb
,
tmp_llx_product_batch
as
tpb
where
pb
.
fk_product_stock
=
tpb
.
fk_product_stock
and
COALESCE
(
pb
.
eatby
,
''
)
=
COALESCE
(
tpb
.
eatby
,
''
)
and
COALESCE
(
pb
.
sellby
,
''
)
=
COALESCE
(
tpb
.
sellby
,
''
)
and
pb
.
batch
=
tpb
.
batch
;
CREATE
TABLE
tmp_llx_product_batch2
AS
select
pb
.
rowid
,
pb
.
fk_product_stock
,
pb
.
eatby
,
pb
.
sellby
,
pb
.
batch
,
pb
.
qty
from
llx_product_batch
as
pb
,
tmp_llx_product_batch
as
tpb
where
pb
.
fk_product_stock
=
tpb
.
fk_product_stock
and
COALESCE
(
pb
.
eatby
,
'
2000-01-01
'
)
=
COALESCE
(
tpb
.
eatby
,
'
2000-01-01
'
)
and
COALESCE
(
pb
.
sellby
,
'
2000-01-01
'
)
=
COALESCE
(
tpb
.
sellby
,
'
2000-01-01
'
)
and
pb
.
batch
=
tpb
.
batch
;
--select * from tmp_llx_product_batch;
--select * from tmp_llx_product_batch2;
DELETE
FROM
llx_product_batch
WHERE
rowid
IN
(
select
rowid
FROM
tmp_llx_product_batch2
);
...
...
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