From e726e0adf22b3a9cd7514f3889286d1e121344ec Mon Sep 17 00:00:00 2001 From: Ed Chalstrey Date: Mon, 21 Feb 2022 17:28:42 +0000 Subject: [PATCH] move when to run migrations --- docs/setup-dev-environment.md | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/docs/setup-dev-environment.md b/docs/setup-dev-environment.md index 50d7640c..8b585a58 100644 --- a/docs/setup-dev-environment.md +++ b/docs/setup-dev-environment.md @@ -153,6 +153,9 @@ password `` is arbitrary and probably should not be your Ubuntu logi sudo -u postgres psql -c "SELECT 1 FROM pg_user WHERE usename = '';" | grep -q 1 || sudo -u postgres psql -c "CREATE ROLE SUPERUSER LOGIN PASSWORD '';" ``` +_TODO: temp instruction, find a better place to move this:_ +> If you are creating from a CL db, run the above with `` as "cldbadmin" and use that from now on, but also run the above a second time with `` as "clwebapp". + Set the `` as an environment variable. ```bash @@ -181,13 +184,6 @@ create extension pg_trgm; Then quit `psql` by typing `\q` and hitting return. -Now run all 'up' migrations to create tables, data types, indexes etc. The `.sql` scripts to -do this are located in the `migrations` folder of your local repository. - -```bash -ls ./colouring-london/migrations/*.up.sql 2>/dev/null | while read -r migration; do psql -d -U -h localhost < $migration; done; -``` - ## Setting up Node Now upgrade the npm package manager to the most recent release with global privileges. This @@ -314,6 +310,15 @@ Create a building record per outline. ``` +#### Run migrations + +Now run all 'up' migrations to create tables, data types, indexes etc. The `.sql` scripts to +do this are located in the `migrations` folder of your local repository. + +```bash +ls ./colouring-london/migrations/*.up.sql 2>/dev/null | while read -r migration; do psql -d -U -h localhost < $migration; done; +``` + ## Running the application Now we are ready to run the application. The `APP_COOKIE_SECRET` is arbitrary.