From b958acb76a54a8e3bd89091c939f155cf5f187e5 Mon Sep 17 00:00:00 2001 From: Viktor Lofgren Date: Thu, 24 Aug 2023 09:05:43 +0200 Subject: [PATCH] (file-storage) New File Storage type for linkdb --- .../nu/marginalia/db/storage/model/FileStorageType.java | 2 ++ .../db/migration/V23_07_1_000__filestorage_livedb.sql | 9 +++++++++ run/setup.sh | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 code/common/db/src/main/resources/db/migration/V23_07_1_000__filestorage_livedb.sql 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 9f512d06..8aaad75d 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 @@ -6,6 +6,8 @@ public enum FileStorageType { PROCESSED_DATA, INDEX_STAGING, LEXICON_STAGING, + LINKDB_STAGING, + LINKDB_LIVE, INDEX_LIVE, LEXICON_LIVE, BACKUP, diff --git a/code/common/db/src/main/resources/db/migration/V23_07_1_000__filestorage_livedb.sql b/code/common/db/src/main/resources/db/migration/V23_07_1_000__filestorage_livedb.sql new file mode 100644 index 00000000..ed4e4e74 --- /dev/null +++ b/code/common/db/src/main/resources/db/migration/V23_07_1_000__filestorage_livedb.sql @@ -0,0 +1,9 @@ +ALTER TABLE FILE_STORAGE MODIFY COLUMN TYPE ENUM ('CRAWL_SPEC', 'CRAWL_DATA', 'PROCESSED_DATA', 'INDEX_STAGING', 'LEXICON_STAGING', 'INDEX_LIVE', 'LEXICON_LIVE', 'SEARCH_SETS', 'BACKUP', 'EXPORT', 'LINKDB_LIVE', 'LINKDB_STAGING') NOT NULL; + +INSERT IGNORE INTO FILE_STORAGE(BASE_ID, PATH, DESCRIPTION, TYPE) +SELECT ID, 'ldbr', "Linkdb Current", 'LINKDB_LIVE' +FROM FILE_STORAGE_BASE WHERE NAME='Index Storage'; + +INSERT IGNORE INTO FILE_STORAGE(BASE_ID, PATH, DESCRIPTION, TYPE) +SELECT ID, 'ldbw', "Linkdb Staging Area", 'LINKDB_STAGING' +FROM FILE_STORAGE_BASE WHERE NAME='Index Storage'; \ No newline at end of file diff --git a/run/setup.sh b/run/setup.sh index 4739176b..0ea929cf 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} vol/ss data samples/export +mkdir -p model logs db samples install vol/ir/{0,1}/ vol/{lr,lw} vol/iw/{0,1}/search-sets vol/{tmpf,tmps} vol/ss vol/{ldbw,ldbr} 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