hmn/local/resetdb.sh

24 lines
837 B
Bash
Raw Normal View History

#!/bin/bash
set -euxo pipefail
# This script is for use in local development only. It wipes the existing db,
# creates a new empty one, runs the initial migration to create the schema,
# and then imports actual db content on top of that.
# TODO(opensource): We should adapt Asaf's seedfile command and then delete this.
THIS_PATH=$(pwd)
2021-11-14 22:48:06 +00:00
BETA_PATH='/mnt/c/Users/bvisn/Developer/handmade/handmade-beta'
# BETA_PATH='/Users/benvisness/Developer/handmade/handmade-beta'
pushd $BETA_PATH
docker-compose down -v
docker-compose up -d postgres s3
sleep 3
docker-compose exec postgres bash -c "psql -U postgres -c \"CREATE ROLE hmn CREATEDB LOGIN PASSWORD 'password';\""
popd
2022-05-07 13:11:05 +00:00
go run src/main.go db seedfile local/backups/hmn_pg_dump_live_2021-11-14
# go run src/main.go db seedfile local/backups/hmn_pg_dump_live_2021-10-23