mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-07-04 16:48:26 +00:00
@ -0,0 +1,35 @@
|
||||
ALTER TABLE "attachmentmeta"
|
||||
ADD COLUMN "language" varchar(254);
|
||||
|
||||
update "attachmentmeta"
|
||||
set "language" = 'deu'
|
||||
where "attachid" in (
|
||||
select "m"."attachid"
|
||||
from "attachmentmeta" m
|
||||
inner join "attachment" a on "a"."attachid" = "m"."attachid"
|
||||
inner join "item" i on "a"."itemid" = "i"."itemid"
|
||||
inner join "collective" c on "c"."cid" = "i"."cid"
|
||||
where "c"."doclang" = 'deu'
|
||||
);
|
||||
|
||||
update "attachmentmeta"
|
||||
set "language" = 'eng'
|
||||
where "attachid" in (
|
||||
select "m"."attachid"
|
||||
from "attachmentmeta" m
|
||||
inner join "attachment" a on "a"."attachid" = "m"."attachid"
|
||||
inner join "item" i on "a"."itemid" = "i"."itemid"
|
||||
inner join "collective" c on "c"."cid" = "i"."cid"
|
||||
where "c"."doclang" = 'eng'
|
||||
);
|
||||
|
||||
update "attachmentmeta"
|
||||
set "language" = 'fra'
|
||||
where "attachid" in (
|
||||
select "m"."attachid"
|
||||
from "attachmentmeta" m
|
||||
inner join "attachment" a on "a"."attachid" = "m"."attachid"
|
||||
inner join "item" i on "a"."itemid" = "i"."itemid"
|
||||
inner join "collective" c on "c"."cid" = "i"."cid"
|
||||
where "c"."doclang" = 'fra'
|
||||
);
|
@ -0,0 +1,14 @@
|
||||
ALTER TABLE `attachmentmeta`
|
||||
ADD COLUMN (`language` varchar(254));
|
||||
|
||||
update `attachmentmeta` `m`
|
||||
inner join (
|
||||
select `m`.`attachid`, `c`.`doclang`
|
||||
from `attachmentmeta` m
|
||||
inner join `attachment` a on `a`.`attachid` = `m`.`attachid`
|
||||
inner join `item` i on `a`.`itemid` = `i`.`itemid`
|
||||
inner join `collective` c on `c`.`cid` = `i`.`cid`
|
||||
) as `c`
|
||||
set `m`.`language` = `c`.`doclang`
|
||||
where `m`.`attachid` = `c`.`attachid` and `m`.`language` is null;
|
||||
|
@ -0,0 +1,15 @@
|
||||
ALTER TABLE "attachmentmeta"
|
||||
ADD COLUMN "language" varchar(254);
|
||||
|
||||
with
|
||||
"attachlang" as (
|
||||
select "m"."attachid", "m"."language", "c"."doclang"
|
||||
from "attachmentmeta" m
|
||||
inner join "attachment" a on "a"."attachid" = "m"."attachid"
|
||||
inner join "item" i on "a"."itemid" = "i"."itemid"
|
||||
inner join "collective" c on "c"."cid" = "i"."cid"
|
||||
)
|
||||
update "attachmentmeta" as "m"
|
||||
set "language" = "c"."doclang"
|
||||
from "attachlang" c
|
||||
where "m"."attachid" = "c"."attachid" and "m"."language" is null;
|
Reference in New Issue
Block a user