Skip to content

Commit

Permalink
Merge branch 'main' into task/partition-weather-station-model-predict…
Browse files Browse the repository at this point in the history
…ions
  • Loading branch information
conbrad authored Nov 19, 2024
2 parents 9b04472 + 4db12bc commit 664dd6a
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 16 deletions.
21 changes: 21 additions & 0 deletions docs/MANUAL_SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,27 @@ Executing `make docker-build-dev` followed by `make docker-run-dev` will build a

#### Natively

As of Nov 2024 the version of postgis installed with brew doesn't work with postgresql@16. postgis is specifically
linked to the original postgres cask (aka postgres@14). If you choose to use postgresql@16 installed via brew, you
will need to compile postgis yourself. The alternative is to use [Postgres.app](https://postgresapp.com/).

After installing Postgres.app, run the following commands in a terminal (taken from the mac.sh setup script):

```bash
psql -d postgres -c "create database wps;"
psql -d wps -c "create extension postgis;"
psql -d wps -c "
CREATE USER wps;
CREATE USER wpsread;
ALTER USER wps WITH LOGIN;
ALTER USER wpsread WITH LOGIN;
ALTER USER wps WITH SUPERUSER;
grant connect on database wps to wpsread; grant usage on schema public to wpsread; grant select on all tables in schema public to wpsread;
"
```

If you have chosen to `brew install postgresql@16` and compile `postgis` locally, follow the instructions below:

If you're running Postgresql natively for the first time:

```bash
Expand Down
32 changes: 16 additions & 16 deletions setup/mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,22 @@ r -e 'install.packages(c("rgdal","sf", "units"),,"https://mac.R-project.org")'
r -e "install.packages('cffdrs', repos = 'http://cran.us.r-project.org')"
echo "finished installing r packages"

### postgres
echo "installing and configuring postgres"
brew install postgresql
brew services start postgresql
brew install postgis
psql -d postgres -c "create database wps;"
psql -d wps -c "create extension postgis;"
psql -d wps -c "
CREATE USER wps;
CREATE USER wpsread;
ALTER USER wps WITH LOGIN;
ALTER USER wpsread WITH LOGIN;
ALTER USER wps WITH SUPERUSER;
grant connect on database wps to wpsread; grant usage on schema public to wpsread; grant select on all tables in schema public to wpsread;
"
echo "finished installing and configuration postgres, run migrations in poetry shell"
### postgres - Nov 2024 - Commenting out the postgres setup. See MANUAL.md for reasons and manual postgres setup.
# echo "installing and configuring postgres"
# brew install postgresql
# brew services start postgresql
# brew install postgis
# psql -d postgres -c "create database wps;"
# psql -d wps -c "create extension postgis;"
# psql -d wps -c "
# CREATE USER wps;
# CREATE USER wpsread;
# ALTER USER wps WITH LOGIN;
# ALTER USER wpsread WITH LOGIN;
# ALTER USER wps WITH SUPERUSER;
# grant connect on database wps to wpsread; grant usage on schema public to wpsread; grant select on all tables in schema public to wpsread;
# "
# echo "finished installing and configuration postgres, run migrations in poetry shell"

### redis
brew install redis
Expand Down

0 comments on commit 664dd6a

Please sign in to comment.