1
|
Zur Info füge ich Ihnen den SQL-Text hier an:
|
2
|
|
3
|
-- 1. product_content_descriptions
|
4
|
SET SQL_SAFE_UPDATES = 0;
|
5
|
UPDATE
|
6
|
wernerscharinger_shopneu.product_content_descriptions a
|
7
|
JOIN wernerscharinger_shopneu.product_content_descriptions z ON a.product_content_ID=z.product_content_ID AND z.language_id=2
|
8
|
SET
|
9
|
a.title=z.title
|
10
|
WHERE
|
11
|
a.language_id <> 2 AND
|
12
|
a.title = ''
|
13
|
;
|
14
|
|
15
|
|
16
|
-- 2. product_content_resources
|
17
|
-- 2.1 Datensätze in product_content_resources vorhanden
|
18
|
SET SQL_SAFE_UPDATES = 0;
|
19
|
UPDATE
|
20
|
wernerscharinger_shopneu.product_content_resources target
|
21
|
JOIN
|
22
|
(
|
23
|
SELECT
|
24
|
r.product_content_description_id,
|
25
|
rs.resource
|
26
|
FROM
|
27
|
wernerscharinger_shopneu.product_content_descriptions d
|
28
|
JOIN wernerscharinger_shopneu.product_content_resources r ON d.id=r.product_content_description_id
|
29
|
JOIN wernerscharinger_shopneu.product_content_descriptions ds ON d.product_content_ID=ds.product_content_ID AND ds.language_id=2
|
30
|
JOIN wernerscharinger_shopneu.product_content_resources rs ON ds.id=rs.product_content_description_id
|
31
|
WHERE
|
32
|
r.resource='' AND d.language_id<>2
|
33
|
) source ON source.product_content_description_id = target.product_content_description_id
|
34
|
SET
|
35
|
target.resource=source.resource
|
36
|
;
|
37
|
|
38
|
|
39
|
-- 2.2 Keine Datensätze in product_content_resources
|
40
|
INSERT INTO wernerscharinger_shopneu.product_content_resources (
|
41
|
product_content_description_id,
|
42
|
product_content_types_id,
|
43
|
resource
|
44
|
)
|
45
|
SELECT
|
46
|
d.id AS product_content_description_id,
|
47
|
rs.product_content_types_id,
|
48
|
rs.resource
|
49
|
FROM
|
50
|
wernerscharinger_shopneu.product_content_descriptions d
|
51
|
LEFT OUTER JOIN wernerscharinger_shopneu.product_content_resources r ON d.id=r.product_content_description_id
|
52
|
JOIN wernerscharinger_shopneu.product_content_descriptions ds ON d.product_content_ID=ds.product_content_ID AND ds.language_id=2
|
53
|
JOIN wernerscharinger_shopneu.product_content_resources rs ON ds.id=rs.product_content_description_id
|
54
|
WHERE
|
55
|
r.resource IS NULL AND d.language_id<>2
|