-
Notifications
You must be signed in to change notification settings - Fork 59
Database installation
Rey Dekker edited this page Oct 21, 2020
·
2 revisions
- Login to psql.
psql- For Windows, run
pgstartandpsqland enter your password if prompted.
- You should be at a prompt that looks like
postgres=#or<your-username-here>=#. -
CREATE DATABASE scproject;Note the semicolon. If you forget it, your prompt will go to a new line and look likepostgres-#. 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".
- IMPORTANT STEP - populate the database with tables (DO NOT COPY PASTE THE PATH! Edit it first!):
For Mac:quitand thenpsql -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
\iand forward slash for the pathYOUR_FILE/PATH/TO/projects-platform-frontend/server/data/schema.sql;. Otherwise you will see "Permission Denied" error!
- from
- you should see something like:
DROP TABLE
DROP TABLE
CREATE TABLE
CREATE TABLE
- Verify:
-
\dshould show something like (nurmereyis an example username):
- Update a
.envfileDATABASE_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.