Skip to content

Database installation

Rey Dekker edited this page Oct 21, 2020 · 2 revisions
  1. Login to psql.
  • psql
  • For Windows, run pgstart and psql and enter your password if prompted.
  1. You should be at a prompt that looks like postgres=# or <your-username-here>=#.
  2. CREATE DATABASE scproject; Note the semicolon. If you forget it, your prompt will go to a new line and look like postgres-#. This means you have an unterminated command and the prompt will just keep going to new lines until you enter a semicolon.
  • You should see - "CREATE DATABASE".
  1. IMPORTANT STEP - populate the database with tables (DO NOT COPY PASTE THE PATH! Edit it first!):
    For Mac: quit and then psql -d scproject -f YOUR_FILE/PATH/TO/schema.sql;
    For Windows:
    • from scproject=# run \i YOUR_FILE/PATH/TO/projects-platform-frontend/server/data/schema.sql;

    • IMPORTANT: make sure your slashes are backward slash for \i and forward slash for the path YOUR_FILE/PATH/TO/projects-platform-frontend/server/data/schema.sql;
. Otherwise you will see "Permission Denied" error!
  • you should see something like:
DROP TABLE
DROP TABLE
CREATE TABLE
CREATE TABLE
  1. Verify:
  • \d should show something like (nurmerey is an example username):
    Screen Shot 2020-09-30 at 9 52 25 pm
  1. Update a .env file DATABASE_URL=postgres://your-psql-username:your-psql-password@LOCALHOST:5432/scproject

NOTE: if you don't have .env file ask project rep or mentor to give it to you.