Add command to initially load habitat and zone data

This commit is contained in:
Dana Lambert 2021-11-04 11:18:42 +13:00
parent 745b0b3007
commit 6b65ac77b3
3 changed files with 74 additions and 0 deletions

11
dev
View file

@ -1,5 +1,11 @@
#!/bin/bash
# Load .env file if it exists
if [ -f .env ]
then
export $(cat .env | sed 's/#.*//g' | xargs)
fi
cmd_create_database() {
echo "Creating right_tree database..."
docker-compose down --remove-orphans --volumes
@ -53,6 +59,11 @@ cmd_load_plants() {
cmd_load_plant_fixtures
}
cmd_load_sites_from_spreadsheet() {
echo "Loading habitats and zones..."
docker-compose exec django-backend python manage.py loadsitedata
}
cmd_populate_database() {
echo "Populating the database..."
docker-compose up -d django-backend postgres