Skip to content

Commit 2bf4ad4

Browse files
committed
fix: dbmate per pg version
1 parent 642645b commit 2bf4ad4

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,10 @@ jobs:
150150
PGUSER: supabase_admin
151151
PGPASSWORD: ${{ env.POSTGRES_PASSWORD }}
152152

153+
- name: Update Dockerfile.dbmate version
154+
run: |
155+
sed -i 's/%VERSION%/${{ env.PGMAJOR }}/g' migrations/Dockerfile.dbmate
156+
153157
- name: verify schema.sql is committed
154158
run: |
155159
docker compose -f migrations/docker-compose.yaml up db dbmate --abort-on-container-exit

migrations/Dockerfile.dbmate

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM amacneil/dbmate:1.16.2
2+
3+
# Install PostgreSQL 16 client
4+
RUN apt-get update && apt-get install -y wget gnupg2 lsb-release
5+
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
6+
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list
7+
RUN apt-get update && apt-get install -y postgresql-client-%VERSION%
8+
9+
# Set the PATH to use the new PostgreSQL 16 binaries
10+
ENV PATH="/usr/lib/postgresql/%VERSION%/bin:${PATH}"

migrations/docker-compose.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ services:
3333
command: pg_prove /tests/test.sql
3434

3535
dbmate:
36-
image: amacneil/dbmate:1.16.2
36+
build:
37+
context: .
38+
dockerfile: Dockerfile.dbmate
3739
depends_on:
3840
db:
3941
condition: service_healthy

0 commit comments

Comments
 (0)