Closed mattodinaturas closed 1 month ago
Can you try setting SQLALCHEMY_DATABASE_URI='postgresql://postgres:mysecretpassword@localhost/quiz-buddy'
in you .env? please let me know how that goes
thanks for the reply. I tried but i get the same result:
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (127.0.0.1), port 5432 failed: FATAL: database "exam-buddy" does not exist
After deleting the database I had locally from developing the project, and re-running the upgrade command, I was able to reproduce your issue.
It appears that the upgrade command is not handling creating the database.
Manually creating the database with just the name of the database in the connection string solves the issue.
Please try creating a database manually then re-running the upgrade command.
Hi, it worked. Thanks! I ran these commands:
sudo docker exec -it [insert container id] bash
psql -h localhost -U postgres
CREATE DATABASE "exam-buddy";
No problem have a great day
Hi, i'm trying to install quiz buddy but I can't get around this issue. When i try to perform flask db upgrade, I get this error:
sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) connection to server at "localhost" (127.0.0.1), port 5432 failed: FATAL: database "exam-buddy" does not exist
The postgres docker container is running fine, I don't know what I should do next. The .env file is present in the backend folder, I haven't touched the first line.
.env:
Thanks
This is the full output: