File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,8 +20,8 @@ Edit `postgres/Dockerfile` to build and install the extension:
2020
2121``` sh
2222RUN apt-get update && apt-get install -y \
23- build-essential \
24- postgresql-server-dev-17
23+ build-essential \
24+ postgresql-server-dev-17
2525
2626# pgjwt - used by auth schema
2727COPY ./pgjwt /pgjwt
@@ -37,14 +37,22 @@ Then rebuild:
3737docker compose build postgres
3838```
3939
40+ And recreate the running container:
41+
42+ ``` sh
43+ docker compose up -d postgres
44+ ```
45+
4046## ➡️ 2. Add Migrations
4147
4248### 📚 Load Required Extensions
4349
4450Add this to a migration file like ` 01-extensions.sql ` :
4551
4652``` sql
47- -- pgcrypto adds public.crypt used in auth.encrypt_pass
53+ /* pgcrypto adds public.crypt used in auth.encrypt_pass pgjwt also needs this
54+ so it must be loaded first. pgcrypto is built into Postgres, so no need to
55+ install it. */
4856create extension pgcrypto;
4957
5058-- pgjwt adds public.sign used in auth.generate_access_token
@@ -212,7 +220,7 @@ commit;
212220
213221### 👮 Grant Permissions
214222
215- Add another migration such as ` 99-roles_and_grants .sql ` :
223+ Add another migration such as ` 99-grants .sql ` :
216224
217225``` sql
218226begin ;
You can’t perform that action at this time.
0 commit comments