As we are using PostgreSQL in our project this wiki contains instructions for creating and maintaining databases and debugging issues.
Install PostgreSQL:
On macOS:
brew install postgresql@16
On Windows: Download and install from the official website.
Start the PostgreSQL service:
brew services start postgresql@16
On Windows: Start the PostgreSQL service from the Services management console.
Create a new database user:
createuser -s -P postgres
When prompted, enter the following:
Create a new database:
createdb -O postgres meal_mentor
Set the DATABASE_URL environment variable:
DATABASE_URL
export DATABASE_URL="postgresql://postgres:postgres@localhost:5432/meal_mentor"
Run the migrations:
alembic upgrade head
Connect to the database:
psql -d meal_mentor -U postgres
View tables:
\dt
Exit:
\q
Change the database user password:
alter user postgres with password 'postgres';
There was an error while loading. Please reload this page.