-
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
pgstart
andpsql
and 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:quit
and 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
\i
and 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:
-
\d
should show something like (nurmerey
is an example username):
- Update a
.env
fileDATABASE_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.