docker-compose: pass schema to migrate deploy (#182)

This patch passes the explicit path to the prisma schema so
that the initial table creation is performed.  Otherwise the
command will print:

    No migration found in prisma/migrations

And attempting to create a poll produces the postgres error:

    ERROR:  relation "public.users" does not exist at character 35
    STATEMENT:  SELECT "public"."users"."id" FROM "public"."users" WHERE "public"."users"."email" = $1 OFFSET $2

Signed-off-by: Trammell Hudson <hudson@trmm.net>
This commit is contained in:
Trammell Hudson 2022-05-19 21:05:06 +02:00 committed by GitHub
parent c07885beee
commit f65fe76863
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -15,7 +15,7 @@ services:
- DATABASE_URL=postgres://postgres:postgres@rallly_db:5432/db?pgbouncer=true
- NEXT_PUBLIC_BASE_URL=${NEXT_PUBLIC_BASE_URL}
restart: always
command: sh -c "yarn prisma migrate deploy && yarn start"
command: sh -c "yarn prisma migrate deploy --schema prisma/schema.prisma && yarn start"
depends_on:
- rallly_db
ports: