mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-04-04 18:39:33 +00:00
Add missing db migrations for h2 and mariadb
This commit is contained in:
parent
aecc689240
commit
b79ac5fbad
@ -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";
|
@ -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`;
|
Loading…
x
Reference in New Issue
Block a user