-
Notifications
You must be signed in to change notification settings - Fork 5
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
Feature/cgd 51 - Add DB models, and some seed data [part 1] #5
Conversation
…le all the all table seeding
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is described one major change that will be to change the database type of the id fields to uuid, other than that, in this change you should modify the README.md file to describe how to load the seed data to the database, and since not everyone has the prisma cli installed globally, you should add it npx prisma migrate dev
npx prisma seed
, basically most of your PR description should be added to the README.md
Regarding inserting data programmatically, we can still look at it, but in a worst case scenario, we can always write a TS script to do so and run it as a |
yes as I said it's not a huge issue now and it will be same syntax as doing from a TS script anyway, so there would be no difference. |
That is not the issue here. |
That is why I just made a comment and didn't made a conversation to be resolved before merging |
So after seeing this implemented, I've realized some issues that need to be taken care of. There is a big conflict between what the admins need to be able to handle and what our application requires. There are edge cases that require certain fields to be null on the admin side. So the solution to this is to just allow things to be nullable at the db level, and then we can enforce it to be required at the server level. |
updated all tables to use auto increment (except user) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good to me, everything that's been dsicussed is there. I think the bash commands for Prisma need to be prefixed with npx
or yarn
, other than that looks good to merge to me. Nice work! Thanks for putting your time into getting this all set up 😊🙏
Co-authored-by: Mark Linn <[email protected]>
Co-authored-by: Mark Linn <[email protected]>
did user, voyage, tech stack stuff.
It would take a while to finish everything, so I would like to merge what I have now, so we can use it for other tasks. I will continue to work on it in the next week or two
prisma migrate dev
prisma db seed
might have to do a
prisma migrate reset
orprisma db push
if you have a old schema locallyOne problem is I cannot figure out how to insert a record into the project idea, project stack vote tables programmatically, with just the voyageTeamMemberId. However, the tables seems to be working and I can manually add records using
prisma studio