Update database_debugging.md

This commit is contained in:
Michael Kozono 2017-11-16 19:17:31 +00:00
parent 8922b7b781
commit c99d58307b

View file

@ -9,17 +9,24 @@ An easy first step is to search for your error in Slack or google "GitLab <my er
Available `RAILS_ENV`
- `production` (generally not for your main GDK db, but you may need this for e.g. omnibus)
- `development` (this is your main GDK db)
- `test` (used for tests like rspec and spinach)
## Nuke everything and start over
If you just want to delete everything and start over,
If you just want to delete everything and start over with an empty DB (~1 minute):
- `bundle exec rake dev:setup RAILS_ENV=development` : Also runs DB specific stuff and seeds dummy data (slow)
- `bundle exec rake db:reset RAILS_ENV=development` : Doesn't do the above (fast)
- `bundle exec rake db:reset RAILS_ENV=test` : Fix the test DB, since it doesn't contain important data.
- `bundle exec rake db:reset RAILS_ENV=development`
If you just want to delete everything and start over with dummy data (~40 minutes). This also does `db:reset` and runs DB-specific migrations:
- `bundle exec rake dev:setup RAILS_ENV=development`
If your test DB is giving you problems, it is safe to nuke it because it doesn't contain important data:
- `bundle exec rake db:reset RAILS_ENV=test`
## Migration wrangling