From cdfe284f9a19ce095150b965b90ee169dd7c154a Mon Sep 17 00:00:00 2001 From: Viktor Lofgren Date: Sat, 5 Aug 2023 14:42:33 +0200 Subject: [PATCH] (file storage) File Storage Type for EXPORT data (file storage) File Storage Type for EXPORT data --- .../nu/marginalia/db/storage/model/FileStorageType.java | 1 + .../resources/db/migration/V23_07_0_004__file_storage.sql | 2 +- .../migration/V23_07_0_005__file_storage_default_values.sql | 6 +++++- run/setup.sh | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/code/common/db/src/main/java/nu/marginalia/db/storage/model/FileStorageType.java b/code/common/db/src/main/java/nu/marginalia/db/storage/model/FileStorageType.java index 97eef136..9f512d06 100644 --- a/code/common/db/src/main/java/nu/marginalia/db/storage/model/FileStorageType.java +++ b/code/common/db/src/main/java/nu/marginalia/db/storage/model/FileStorageType.java @@ -9,5 +9,6 @@ public enum FileStorageType { INDEX_LIVE, LEXICON_LIVE, BACKUP, + EXPORT, SEARCH_SETS } diff --git a/code/common/db/src/main/resources/db/migration/V23_07_0_004__file_storage.sql b/code/common/db/src/main/resources/db/migration/V23_07_0_004__file_storage.sql index d6de88a5..641d0e03 100644 --- a/code/common/db/src/main/resources/db/migration/V23_07_0_004__file_storage.sql +++ b/code/common/db/src/main/resources/db/migration/V23_07_0_004__file_storage.sql @@ -13,7 +13,7 @@ CREATE TABLE IF NOT EXISTS FILE_STORAGE ( BASE_ID BIGINT NOT NULL, PATH VARCHAR(255) NOT NULL COMMENT 'The path to the storage relative to the base', DESCRIPTION VARCHAR(255) NOT NULL, - TYPE ENUM ('CRAWL_SPEC', 'CRAWL_DATA', 'PROCESSED_DATA', 'INDEX_STAGING', 'LEXICON_STAGING', 'INDEX_LIVE', 'LEXICON_LIVE', 'SEARCH_SETS', 'BACKUP') NOT NULL, + TYPE ENUM ('CRAWL_SPEC', 'CRAWL_DATA', 'PROCESSED_DATA', 'INDEX_STAGING', 'LEXICON_STAGING', 'INDEX_LIVE', 'LEXICON_LIVE', 'SEARCH_SETS', 'BACKUP', 'EXPORT') NOT NULL, DO_PURGE BOOLEAN NOT NULL DEFAULT FALSE COMMENT 'If true, the storage may be cleaned', CREATE_DATE TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6), CONSTRAINT CONS UNIQUE (BASE_ID, PATH), diff --git a/code/common/db/src/main/resources/db/migration/V23_07_0_005__file_storage_default_values.sql b/code/common/db/src/main/resources/db/migration/V23_07_0_005__file_storage_default_values.sql index 3803911f..74434055 100644 --- a/code/common/db/src/main/resources/db/migration/V23_07_0_005__file_storage_default_values.sql +++ b/code/common/db/src/main/resources/db/migration/V23_07_0_005__file_storage_default_values.sql @@ -21,4 +21,8 @@ FROM FILE_STORAGE_BASE WHERE NAME='Index Storage'; INSERT IGNORE INTO FILE_STORAGE(BASE_ID, PATH, DESCRIPTION, TYPE) SELECT ID, 'ss', "Search Sets", 'SEARCH_SETS' -FROM FILE_STORAGE_BASE WHERE NAME='Index Storage'; \ No newline at end of file +FROM FILE_STORAGE_BASE WHERE NAME='Index Storage'; + +INSERT IGNORE INTO FILE_STORAGE(BASE_ID, PATH, DESCRIPTION, TYPE) +SELECT ID, 'export', "Exported Data", 'EXPORT' +FROM FILE_STORAGE_BASE WHERE TYPE='EXPORT'; \ No newline at end of file diff --git a/run/setup.sh b/run/setup.sh index ba4ac355..24feba85 100755 --- a/run/setup.sh +++ b/run/setup.sh @@ -18,7 +18,7 @@ function download_model { pushd $(dirname $0) -mkdir -p model logs db samples install vol/ir/{0,1}/ vol/{lr,lw} vol/iw/{0,1}/search-sets vol/{tmpf,tmps} data +mkdir -p model logs db samples install vol/ir/{0,1}/ vol/{lr,lw} vol/iw/{0,1}/search-sets vol/{tmpf,tmps} data samples/export download_model model/English.DICT https://raw.githubusercontent.com/datquocnguyen/RDRPOSTagger/master/Models/POS/English.DICT download_model model/English.RDR https://raw.githubusercontent.com/datquocnguyen/RDRPOSTagger/master/Models/POS/English.RDR