Skip to content

Commit

Permalink
Updating the local setup documentation. (#418)
Browse files Browse the repository at this point in the history
* Updating the local setup documentation.

* Bumping the backend version.

* Trunk fix.

* Trunk fix.

---------

Co-authored-by: Mark <[email protected]>
  • Loading branch information
THOR300 and Mark authored Nov 7, 2024
1 parent e4e9b9d commit f1b782c
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
41 changes: 41 additions & 0 deletions docs/local_full_stack_setup/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,47 @@ cp .env.example .env
make start
```

### Load the postgres database from an sql dump

This section outlines steps for loading a database dump from an sql file in to a
local postgres database. This should be done if you want for example the latest
production data locally.

Assumptions:

- You've created a `.env` and exported the variables to your local terminal.
- You've run `make build` and `make start`
- You have no open connections to the database.
- You have `psql` installed.

1. Export the postgres db variables from the .env

```shell
export $(cat .env | xargs)
```

2. Drop and recreate the navigator database.

```shell
psql --host=0.0.0.0 --port=5432 --dbname=postgres --username=navigator --password
```

_Note enter the password from the .env when prompted._

When in the postgres shell run:

```shell
postgres=# drop database navigator
postgres=# create database navigator
postgres=# \q
```

3. Load the sql dump into the postgres database.

```shell
psql --host=0.0.0.0 --port=5432 --dbname=postgres --username=navigator --password -f ${path_to_sql_dump}/sql_dump.sql
```

### Authenticate with Vespa

```shell
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "navigator_backend"
version = "1.19.11"
version = "1.19.12"
description = ""
authors = ["CPR-dev-team <[email protected]>"]
packages = [{ include = "app" }, { include = "tests" }]
Expand Down

0 comments on commit f1b782c

Please sign in to comment.