-
Notifications
You must be signed in to change notification settings - Fork 0
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
Antti| User model to schema.prisma file #16
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
prisma/schema.prisma
Outdated
createdAt DateTime @default(now()) | ||
updatedAt DateTime @updatedAt | ||
authorEmail String? | ||
author User? @relation(fields: [authorEmail], references: [email]) |
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.
Olisiko uuid
:lla parempi yhdistää lahja? Sähköposti voi vaihtua, uuid
ei
Edit: vai olisko monella yhdistäminen vielä parempi?
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.
Ehdottomasti ennemmin uuid
:lla. Primary key on se millä relaatiot tehdään, eli oikeastaan id
olisi oikeaoppinen kenttä relaatioille, mutta uuid
toimii myös.
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.
Muutetaan relaatio käyttämään uuid
:tä ja lisätään migraatio tarvittaville tietokantamuutoksille, muuten näytti hyvältä.
Nyt pitäisi olla Onko tuo migration semmoinen mitä ajattelit? |
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.
Nyt näyttää hyvältä! User on parempi kuin author ja migraatio juuri sellainen kuin ajattelin 👍
Model lisätty käyttäjille
schema.prisma
-tiedostossa. Laitoin tämänkinmain
-branchiin vetämään, koska ei varsinaista tuotantoa ole vielä