Merge pull request #1191 from eikek/update-stanford-core-nlp

Add missing db migrations for h2 and mariadb
This commit is contained in:
mergify[bot] 2021-11-20 14:40:13 +00:00 committed by GitHub
commit 22956dff50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,21 @@
CREATE TEMPORARY TABLE "temp_file_ids" (
cid varchar(254) not null,
file_id varchar(254) not null
);
INSERT INTO "temp_file_ids" SELECT "cid", "file_id" FROM "classifier_model";
INSERT INTO "job"
SELECT random_uuid(), 'learn-classifier', cid, CONCAT('{"collective":"', cid, '"}'),
'new classifier', now(), 'docspell-system', 0, 'waiting', 0, 0,null,null,null,null,null
FROM "classifier_setting";
DELETE FROM "classifier_model";
DELETE FROM "filemeta"
WHERE "file_id" in (SELECT "file_id" FROM "temp_file_ids");
DELETE FROM "filechunk"
WHERE "file_id" in (SELECT "file_id" FROM "temp_file_ids");
DROP TABLE "temp_file_ids";

View File

@ -0,0 +1,21 @@
CREATE TEMPORARY TABLE `temp_file_ids` (
cid varchar(254) not null,
file_id varchar(254) not null
);
INSERT INTO `temp_file_ids` SELECT `cid`, `file_id` FROM `classifier_model`;
INSERT INTO `job`
SELECT md5(rand()), 'learn-classifier', cid, CONCAT('{"collective":"', cid, '"}'),
'new classifier', now(), 'docspell-system', 0, 'waiting', 0, 0,null,null,null,null,null
FROM `classifier_setting`;
DELETE FROM `classifier_model`;
DELETE FROM `filemeta`
WHERE `file_id` in (SELECT `file_id` FROM `temp_file_ids`);
DELETE FROM `filechunk`
WHERE `file_id` in (SELECT `file_id` FROM `temp_file_ids`);
DROP TABLE `temp_file_ids`;