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

Migrate Models To Prisma #190

Merged
merged 4 commits into from
Jun 22, 2024

Conversation

shencynthia
Copy link

@shencynthia shencynthia commented Jun 6, 2024

Notion ticket link

Migrate all models into schema.prisma

Implementation description

  • Defined the prisma models in schema.prisma
  • Set up the database connection (env's in slack)
  • Installed prisma dependencies
  • Applied initial migration

Steps to test

  1. cd into the starter-code-cli repository and run npm run dev -- --testing
  2. select (PERN and opt-in to all features) and clone from cynthia/migrate-models-to-prisma
  3. add the .env files in the root, frontend/, and backend/typescript/models/primsa/
  4. run docker exec -it scv2_ts_backend bash and cd into models/prisma
  5. run npx prisma migrate status , if the initial migration has not been applied yet run npx prisma migrate dev --name init
  6. runnpx prisma studio
  7. verify that the tables are loaded at http://localhost:5555/

What should reviewers focus on?

  • please also skim over the models and ensure they are the same as the sequelize models
  • when I introspected the database it automatically created the "created at" and "updated at" fields - do we want to keep these or not?

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

@shencynthia shencynthia requested a review from omeradeel26 June 6, 2024 23:42
Copy link

@omeradeel26 omeradeel26 left a comment

Choose a reason for hiding this comment

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

lgtm

@omeradeel26 omeradeel26 merged commit b13d302 into prisma-migration Jun 22, 2024
@omeradeel26 omeradeel26 deleted the cynthia/migrate-models-to-prisma branch June 22, 2024 02:17
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.

3 participants