Browse Source

removed meta entity

sirekanian 3 years ago
parent
commit
f72ad47a03
3 changed files with 1 additions and 9 deletions
  1. 0 1
      app/schemas/MetaEntity.csv
  2. 0 2
      app/schemas/init.sql
  3. 1 6
      update.sh

+ 0 - 1
app/schemas/MetaEntity.csv

@@ -1 +0,0 @@
-"date","2022-09-16"

+ 0 - 2
app/schemas/init.sql

@@ -1,7 +1,5 @@
 CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT);
 INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, 'b8bb5e1f5cbce85118a62d7a7ce20bb4');
-CREATE TABLE IF NOT EXISTS `MetaEntity` (`key` TEXT NOT NULL, `value` TEXT NOT NULL, PRIMARY KEY(`key`));
-.import --csv app/schemas/MetaEntity.csv MetaEntity
 CREATE VIRTUAL TABLE IF NOT EXISTS `WarmongerEntity` USING FTS4(`cyrillicName` TEXT NOT NULL, `name` TEXT NOT NULL, `notes` TEXT NOT NULL, `tags` TEXT NOT NULL, tokenize=unicode61);
 .import --csv app/schemas/WarmongerEntity.csv WarmongerEntity
 CREATE TABLE IF NOT EXISTS `TagEntity` (`id` INTEGER NOT NULL, `name` TEXT NOT NULL, `ruName` TEXT NOT NULL, PRIMARY KEY(`id`));

+ 1 - 6
update.sh

@@ -7,11 +7,6 @@ ENDPOINT="https://sirekanian.github.io/warmongr"
 SCHEMAS="app/schemas/com.sirekanian.acf.data.local.Database"
 SCHEMA=$(find "$SCHEMAS" -name "*.json" | sort -V | tail -1)
 
-# transform meta.json to csv
-wget -qO- "$ENDPOINT/meta.json" |
-  jq -r 'to_entries[] | [.key, .value] | @csv' \
-    >"app/schemas/MetaEntity.csv"
-
 # transform data.json to csv
 wget --header="Accept-Encoding: gzip" -qO- "$ENDPOINT/data.json" | gunzip |
   jq -r 'map([.["0"],.["1"],.["4"],(.["5"] | join(" "))])[] | @csv' \
@@ -32,7 +27,7 @@ jq -r ".database.setupQueries[]" "$SCHEMA" |
   sed 's/$/;/' \
     >app/schemas/init.sql
 
-for TABLE in MetaEntity WarmongerEntity TagEntity IndexEntity; do
+for TABLE in WarmongerEntity TagEntity IndexEntity; do
 
   # copy createSql from schema
   jq -r ".database.entities[] | select(.tableName==\"$TABLE\") | .createSql" "$SCHEMA" |