Glasgow Graduation Project - Women Shelter system
- Add upstream repo
[email protected]:CodeYourFuture/ubuntu.git
- Check if upstream has been added
git remote -v
- Create branch
git checkout -b setup
Do everything in your branch
- If you have not done so, setup the database first so it runs locally as a process (See Database section below)
- First time (and then each time you update the schema) run
npm run recreate-db
- Run
npm start
from top-level (root folder)
Our workflow is a variation of Gitflow
-
Pick a card from trello (assign it to yourself and make sure there is enough description)
-
Locally, switch to
master
, thengit pull upstream master
. NOTE: If you get a merge message, that means you made a mistake and you worked onmaster
by accident. Clean your master (i.e.git reset --hard previous_commit
- ask a mentor to help) -
Create a branch based on the story
git checkout -b feature-title
.
If you're working on a feature for adding a student, then name the branch add-student
for example.
-
Work on the branch (add, commit and push)
-
Create a Pull Request when you are finished.
-
Repeat.
Switch to the postgres
system user: sudo -i -u postgres
Launch postgresql client: psql
The first time you create the database, you will need to run these commands (three of them separately) in psql
DROP ROLE IF EXISTS cyf;
CREATE USER cyf WITH PASSWORD 'password';
CREATE DATABASE ubuntu OWNER cyf;
You can verify role has been added correctly: \du
Switch to ubuntu DB: \c ubuntu
Command for getting into ubuntu database directly as the cyf
user psql -U cyf ubuntu
We use knex
for changing the DB schema
Schema file you need to change the DB: server/migrations/20180811161248_base-schema.js
Once you change it run: npm run recreate-db