-
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/postgres #11
antti/postgres #11
Conversation
… a new function called handleError
… and model data there
…ndlers and did some testing overall
…able function name from handleSomething -> handlePrisma
…ed updatedAt as well. Made id, createdAt and updateAt optional
…etion works instantly. Before gave an error due to wrong ID. Added some class tests
…se search. Added functionality to Delete request
…risma. Added a response if gift was deleted properly
…ated a file prismaClient.ts to try a global Prisma client
…t due to as CreateGift at the end
Kiitos jälleen tarkistuksesta! :) Nyt pitäisi olla kaikki korjailtu. Tähän neuvoon #11 (comment) viittaavia korjaamattomia tai väärin korjattuja kohtia saattanee löytyä, pitää tuota harjoitella ja testailla, jotta pystyn olemaan varma osaamisestani 😄 |
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.
Kommenttien lisäksi tekisin vielä kaksi muutosta:
- README.md tiedostoon ohjeet miten otetaan käyttöön, eli
- Luo
.env
tiedosto.env.example
tiedostosta - Aja migraatiot
npx prisma migrate deploy
- Luo
- Poistaisin kaikki migraatiot ja tyhjentäisin tietokannan, ja sitten generoisin skeemasta yhden uuden migraation niin poistuisi nuo testit.
… is more clear and contains every column
### Setting the environment variables | ||
|
||
Create `.env` file using `.env.example` as a template. | ||
|
||
Change the DATABASE_URL variable to match your database user's details. | ||
|
||
For example: `DATABASE_URL="postgresql://johndoe:JohnDoeDoesPostgres@localhost:5432/johnDB?schema=public"` | ||
|
||
`johnDB` in DATABASE_URL can be named whatever wanted. Prisma will make a new database if it does not exist. | ||
|
||
### Run the migratiation | ||
|
||
Run the migrations: | ||
|
||
```bash | ||
npx prisma migrate deploy | ||
``` | ||
|
||
after this, the database is set up! | ||
|
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.
En ole README.md tiedostoja koskaan tehnyt, joten en tiedä onko tuo ollenkaan hyvä. 😄 Onko esimerkiksi rivit 23 - 25 turhat?
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.
Hyvin kirjoitettu tuo. Ja ei ole rivit 23-25 turhia. Erityisesti on hyvä tieto, että tietokantaa ei tarvitse itse luoda, vaan Prisma tekee sen.
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.
Hienoa työtä!! 💪 Valmis mergettäväksi.
Pohja tehty Postgresille