-
Notifications
You must be signed in to change notification settings - Fork 0
/
notes.TODO
48 lines (42 loc) · 2.14 KB
/
notes.TODO
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
Rails General Notes:
☐ Rollback all databasae migrations: rake db:migrate VERSION=0
☐ To change parameters devise allows on sign up edit this file [[./devise_permitted_parameters.rb]]
Restart Postgres "sudo service postgresql restart"
☐ Return random array from model: Model.limit(rand 2..4).order("RANDOM()")
☐ Date Formating http://techoctave.com/c7/posts/23-rails-date-formats
☐ Kill server: lsof -wni tcp:3000
☐ Rail processes: ps -aef | grep rails
Different Rake:DB tasks:
☐ db:create creates the database for the current env
☐ db:create:all creates the databases for all envs
☐ db:drop drops the database for the current env
☐ db:drop:all drops the databases for all envs
☐ db:migrate runs migrations for the current env that have not run yet
☐ db:migrate:up runs one specific migration
☐ db:migrate:down rolls back one specific migration
☐ db:migrate:status shows current migration status
☐ db:rollback rolls back the last migration
☐ db:forward advances the current schema version to the next one
☐ db:seed (only) runs the db/seed.rb file
☐ db:schema:load loads the schema into the current env's database
☐ db:schema:dump dumps the current env's schema (and seems to create the db as well
☐ db:setup runs db:schema:load, db:seed
☐ db:reset runs db:drop db:setup
☐ db:migrate:redo runs (db:migrate:down db:migrate:up) or (db:rollback db:migrate:migrate) depending on the specified migration
☐ db:migrate:reset runs db:drop db:create db:migrate
Checks on current path:
☐ http://stackoverflow.com/questions/1203892/how-can-i-find-out-the-current-route-in-rails
PlayToday notes:
☐ You either have to login as a vanue or a user
☐ a user can't create a facility because they belong to a venue
☐ or associate a user with 1 venue, but how?!
Image Placeholders:
☐ http://lorempixel.com/
☐ robohash
Heroku commands:
☐ heroku pg:info --app playtoday
☐ Heroku SSH: heroku run bash --app playtoday
☐ heroku pg:reset DATABASE --confirm playtoday
☐ heroku run rake db:migrate db:seed
☐ Live logs "heroku logs -t"
☐ heroku restart (seems necessary after db changes)