add shadow db service for migration drift check
This commit is contained in:
@@ -8,6 +8,20 @@ jobs:
|
|||||||
check-migrations:
|
check-migrations:
|
||||||
name: Check for Missing Migrations
|
name: Check for Missing Migrations
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
services:
|
||||||
|
shadow-db:
|
||||||
|
image: postgres:17
|
||||||
|
env:
|
||||||
|
POSTGRES_USER: prisma
|
||||||
|
POSTGRES_PASSWORD: prisma
|
||||||
|
POSTGRES_DB: shadow
|
||||||
|
ports:
|
||||||
|
- 5432:5432
|
||||||
|
options: >-
|
||||||
|
--health-cmd="pg_isready -U prisma"
|
||||||
|
--health-interval=5s
|
||||||
|
--health-timeout=5s
|
||||||
|
--health-retries=5
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout source code
|
- name: Checkout source code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -23,9 +37,10 @@ jobs:
|
|||||||
bunx prisma migrate diff \
|
bunx prisma migrate diff \
|
||||||
--from-migrations prisma/migrations \
|
--from-migrations prisma/migrations \
|
||||||
--to-schema prisma/schema.prisma \
|
--to-schema prisma/schema.prisma \
|
||||||
|
--shadow-database-url "postgresql://prisma:prisma@localhost:5432/shadow" \
|
||||||
--exit-code
|
--exit-code
|
||||||
env:
|
env:
|
||||||
DATABASE_URL: "postgresql://dummy:dummy@localhost:5432/dummy"
|
DATABASE_URL: "postgresql://prisma:prisma@localhost:5432/shadow"
|
||||||
|
|
||||||
build:
|
build:
|
||||||
name: Build
|
name: Build
|
||||||
|
|||||||
Reference in New Issue
Block a user