boolean-uk / software-developer

0 stars 0 forks source link

Create repo for Create with Express afternoon exercise #73

Closed glowkeeper closed 2 years ago

glowkeeper commented 2 years ago

I've started doing the port - it's slightly more complex, because of the PGURL environment variable, so I'm going to use the dotenv package - playing now :)

glowkeeper commented 2 years ago

Hmmm - I have dotenv up and running, but while the code's creating the Pets database okay, it's not managing to do the same for Books - instead, I'm getting tons of errors like this: error: relation "books" does not exist. Investigating...

glowkeeper commented 2 years ago

Aha! books/resource.js had DROP TABLE books; and not DROP TABLE IF EXISTS books;. That failed (as books didn't exist), which meant the CREATE never got called, which meant the INSERTs generated a ton of errors :)

In other words - Fixed :)