Skip to content
This repository has been archived by the owner on Sep 15, 2023. It is now read-only.

Commit

Permalink
sqlite with index for android
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Gstoehl committed Dec 15, 2022
1 parent 5a17edc commit cd843a5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"validDuration": 172800000, "lastDownload": 1665473995987, "nextSince": "11843609"}
{"validDuration": 172800000, "lastDownload": 1670858784137, "nextSince": "11856236"}
6 changes: 6 additions & 0 deletions update_resources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@ python3 ch-covidcertificate-backend-verifier/ch-covidcertificate-backend-verifie
sqlite3 revocations.sqlite "CREATE TABLE revocations ( uvci text NOT NULL );" ".mode csv" ".import revocations.csv revocations"
sqlite3 revocations.sqlite "CREATE TABLE \"metadata\" (\"validDuration\" integer NOT NULL DEFAULT '0',\"lastDownload\" integer NOT NULL DEFAULT '0',\"nextSince\" text);"
sqlite3 revocations.sqlite "INSERT INTO \"metadata\" (validDuration, lastDownload, nextSince) VALUES ($(cat revocation_metadata.json | jq .validDuration), $(cat revocation_metadata.json | jq .lastDownload), $(cat revocation_metadata.json | jq .nextSince));"

sqlite3 revocations-android.sqlite "CREATE TABLE revocations ( uvci text NOT NULL ,PRIMARY KEY (uvci));" ".mode csv" ".import revocations.csv revocations"
sqlite3 revocations-android.sqlite "CREATE TABLE \"metadata\" (\"validDuration\" integer NOT NULL DEFAULT '0',\"lastDownload\" integer NOT NULL DEFAULT '0',\"nextSince\" text NOT NULL DEFAULT '' , PRIMARY KEY (nextSince, validDuration, lastDownload));"
sqlite3 revocations-android.sqlite "INSERT INTO \"metadata\" (validDuration, lastDownload, nextSince) VALUES ($(cat revocation_metadata.json | jq .validDuration), $(cat revocation_metadata.json | jq .lastDownload), $(cat revocation_metadata.json | jq .nextSince));"

rm revocations.csv
mv revocations.sqlite ch-covidcertificate-backend-verifier/ch-covidcertificate-backend-verifier-ws/src/main/resources/
mv revocations-android.sqlite ch-covidcertificate-backend-verifier/ch-covidcertificate-backend-verifier-ws/src/main/resources/
mv revocation_metadata.json ch-covidcertificate-backend-verifier/ch-covidcertificate-backend-verifier-ws/src/main/resources/

./ch-covidcertificate-backend-verifier/ch-covidcertificate-backend-verifier-valuesets/src/main/resources/test_rules.sh

0 comments on commit cd843a5

Please sign in to comment.