Closed ShoshinNikita closed 2 weeks ago
I noticed that species recently added via a7d8237 are not used for autocomplete. Am I right that updating the species is a manual process? Maybe we can apply species.sql
at the startup (like schema-sqlite.sql
)?
#!/bin/sh
set -e
SCHEMA="/app/schema-sqlite.sql"
+SPECIES="/app/species.sql"
DATABASE="/app/var/database.sqlite"
cd /app
mkdir -p /app/var
if [ ! -f $DATABASE ]; then
echo "Initializing the database..."
sqlite3 $DATABASE < $SCHEMA
+ sqlite3 $DATABASE < $SPECIES
fi
exec /usr/bin/supervisord -nc /etc/supervisord.conf
Another suggestion - we can use INSERT OR REPLACE
[0] instead of DELETE FROM
:
INSERT OR REPLACE INTO species (name, local, keywords, wikidata_id) VALUES
('Acer negundo', 'Box Elder', 'клён;ясенелистный;boxelder;maple;ashleaf;manitoba', 'Q161166'),
('Acer pseudoplatanus', 'Sycamore maple', 'клён белый;явор;немецкий;maple;sycamore', 'Q156944'),
('Acer', 'Maple', 'клён', 'Q42292'),
...
Yes the process is manual, unfortunately.
prunus
.Styphnolobium japonicum
(11 records on the map at the moment of commit).