Skip to content

Set up Postgres Database for Espresso

Ryan Bacon edited this page Sep 25, 2020 · 1 revision

choose database names and passwords

log in as postgres user psql

CREATE DATABASE espresso; CREATE DATABASE espresso-test;

CREATE ROLE espresso;

GRANT ALL ON DATABASE espresso_test to espresso; GRANT ALL ON DATABASE espresso to espresso;

get environment variables set up for migration

export FLASK_APP=espresso.py export ESPRESSO_DB_USER=espresso export ESPRESSO_DB_PASSWORD=espresso export ESPRESSO_DB_HOST=localhost export ESPRESSO_DB_DATABASE_NAME=espresso

flask db upgrade

optional

psql espresso \i restaurant-starter-rows.sql