-
Notifications
You must be signed in to change notification settings - Fork 8
Database Update Instruction
The database will be updated by running the scripts, and the front end will be updated, too. The front end displayed the option by querying the database source table, so there was no need to change the code in the front end. Please test in your local database before loading data to the server.
-
Go to
database/network-database/scripts
folder -
Generate new network and preprocessing data by running file
generate_new_network_version.py
. For more information on how the file works, read the READ.me file in thatdatabase/network-database
folder. Make sure to have all dependencies installed beforehand or you will recieve errors. (pip3 install intermine, tzlocal, etc. [see file for all imports]DB_URL="postgresql://[<db_user>:<password>]@<address to database>/<database name>" python3 generate_new_network_version.py
Ex:
DB_URL="postgresql://<db_user>:@localhost/postgres" python3 generate_new_network_version.py
-
Load new data to the database by running
loader_updates.py
Usage:
python3 loader_updates.py | psql postgresql://localhost/postgres
-
Connect to the database server via SSH tunnel (with authentication performed by having a known SSH key). You need to ask Dondi for database address and password.
Usage:
ssh -L <ssh_tunnel_port>:<database_address>:<db_port> [email protected]
Ex:
ssh -L 50000:<database_address>:5432 [email protected]
-
Open another terminal window and let the database server window open so it can connect to the database server.
-
Generate new network and preprocessing data
Usage:
DB_URL="postgresql://[<db_user>:<password>]@<address to database>:<ssh tunnel port>/<database name>" python3 generate_new_network_version.py
Ex:
DB_URL="postgresql://postgres@localhost:50000/postgres" python3 generate_new_network_version.py
-
Load data to the database
Usage:
python3 loader_updates.py | psql postgresql://localhost:50000/postgres -U postgres