Skip to content
Andrew Pope edited this page Nov 8, 2018 · 4 revisions

Docker

Build the docker image with postgres and the schema

docker build -t irs_db .

Run docker docker run --rm -p 5432:5432 irs_db

Other Instructions

Instructions to manually create your local machine database development. The following assumes that you:

  1. Installed postgresql and during this process, the default postgres user has been created.
  2. The postgresql localhost server is running.

You can run

./database_setup.sh

to automatically create and load the schema or you can create the database your self and follow the steps below to load the schema.

Load the Schema

After creating a new database called irs, run this command from terminal to generate schema:

sudo -u postgres psql irs < db/schema.sql

This structure will be loaded into the default public schema.

Load an example restaurant to the database

Developers may also want to load some test records to their database. They can do so with the example_restaurant.py script:

python example_restaurant.py

Nuking

To start from scratch, run:

echo "DROP SCHEMA public CASCADE; CREATE SCHEMA public;" | sudo -u postgres psql irs