2021-04-11 21:46:06 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2021-04-26 02:13:26 +00:00
|
|
|
set -eou pipefail
|
|
|
|
|
2021-04-16 05:08:47 +00:00
|
|
|
# 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.
|
|
|
|
|
2021-04-16 23:04:01 +00:00
|
|
|
# TODO(opensource): We should adapt Asaf's seedfile command and then delete this.
|
|
|
|
|
2021-04-11 21:46:06 +00:00
|
|
|
THIS_PATH=$(pwd)
|
2021-09-01 06:15:13 +00:00
|
|
|
#BETA_PATH='/mnt/c/Users/bvisn/Developer/handmade/handmade-beta'
|
|
|
|
BETA_PATH='/Users/benvisness/Developer/handmade/handmade-beta'
|
2021-04-11 21:46:06 +00:00
|
|
|
|
|
|
|
cd $BETA_PATH
|
|
|
|
docker-compose down -v
|
|
|
|
docker-compose up -d postgres
|
|
|
|
sleep 3
|
|
|
|
./scripts/db_import -d -n hmn_two -c
|
|
|
|
|
|
|
|
cd $THIS_PATH
|
|
|
|
go run src/main.go migrate 2021-03-10T05:16:21Z
|
|
|
|
|
|
|
|
cd $BETA_PATH
|
2021-09-01 06:15:13 +00:00
|
|
|
#./scripts/db_import -d -n hmn_two -a ./dbdumps/hmn_pg_dump_2021-04-26
|
|
|
|
./scripts/db_import -d -n hmn_two -a ./dbdumps/hmn_pg_dump_2021-04-25
|