Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set container names and update backend dev script to include prisma generate command #46

Merged
merged 2 commits into from
Nov 10, 2021

Conversation

sherryhli
Copy link
Member

@sherryhli sherryhli commented Nov 2, 2021

Ticket link

N/A

Implementation description

  • Explicitly set container names in docker-compose.yml so that it is deterministic
  • Run npx prisma generate as part of backend's dev script

Steps to test

  1. Run the application (important: update DB_HOST in root .env file to be sistering_db)
docker-compose up --build
docker ps

You should see these container names:
image

  1. Check that the prisma generate command ran as part of the backend dev script, you should see logs like this:
backend_1   | Environment variables loaded from prisma/.env
backend_1   | Prisma schema loaded from prisma/schema.prisma
backend_1   |
backend_1   | ✔ Generated Prisma Client (3.3.0) to ./node_modules/@prisma/client in 1.10s
backend_1   | You can now start using Prisma Client in your code. Reference: https://pris.ly/d/client
backend_1   | ```
backend_1   | import { PrismaClient } from '@prisma/client'
backend_1   | const prisma = new PrismaClient()
backend_1   | ```

You should no longer see this error:

error TS2305: Module '"@prisma/client"' has no exported member 'User'.

What should reviewers focus on?

  • N/A

Checklist

  • My PR name is descriptive and in imperative tense
  • My commit messages are descriptive and in imperative tense. My commits are atomic and trivial commits are squashed or fixup'd into non-trivial commits
  • I have run the appropriate linter(s)
  • I have requested a review from the PL, as well as other devs who have background knowledge on this PR or who will be building on top of this PR

@albertlai431 albertlai431 self-requested a review November 8, 2021 17:30
Copy link
Contributor

@albertlai431 albertlai431 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me!

@sherryhli sherryhli merged commit 1f001eb into main Nov 10, 2021
@sherryhli sherryhli deleted the sherry/infra-fixes branch November 10, 2021 02:33
sherryhli added a commit that referenced this pull request Jan 6, 2022
…enerate command (#46)

* Set container names in docker-compose.yml

* Add prisma generate command to backend dev script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants