npm install
nvm use 0.12.0
- Open new shell and start postgres:
postgres -D /usr/local/var/postgres
- Open new shell and start the web server:
gulp
- Go to http://local.carpool.com:3000
- Set up Node (see below)
- Set up postgres (see below)
- Add the following line to
/etc/hosts/
:127.0.0.1 localhost local.carpool.com
npm install
npm install -g gulp
npm install -g gulp-cli
- While postgres is running, setup database
gulp db:setup
- Open new shell and start the web server:
gulp
- Go to http://local.carpool.com:3000
- Install nvm from here.
nvm install 0.12.0
nvm use 0.12.0
- Add
. ~/.nvm/nvm.sh
to your ~/.profile (load nvm when you open a shell) - Add
nvm use 0.12.0
to your ~/.profile (load the correct version of Node automatically when you open a shell)
brew install postgres
postgres -D /usr/local/var/postgres
- In a new shell, start psql
psql --username=<USERNAME> -d template1
// use unix username - Type
create database <USERNAME>
- Exit psql (Ctrl-D on Mac). If you do not exit psql, you will get an error about multiple users accessing the database when you try to run the setup scripts.
gulp db:config | Generate database config from template
gulp g:migration --name=<MIGRATION NAME> | Create a migration: it will create two `.sql` files (up and down) inside `./migrations` directory
gulp db:migrate | Run migrations
gulp db:rollback | Undo migrations: will roll back the latest migration
gulp db:seed | Add dummy data
gulp db:setup | Setup database (config, create, run migrations and add dummy seed data)
gulp db:reset | Reset database (drop and setup)
gulp db:test:prepare | Prepare test database
gulp db:test:prepare
gulp test
gulp test:unit
gulp test:integration
gulp test:browser
- Connect to database:
\c carpool_development
- List all databases:
\dt