diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2019-07-18 12:47:43 +0100 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2019-07-18 12:47:43 +0100 |
commit | d158efa8a2012bc2d6a80f71c765aefb677fe38e (patch) | |
tree | 59923c49efd8562af815db708308f003b80fb318 /doc/development/database_debugging.md | |
parent | 0f7d462b6a16ffa40aae162be7d292ce2e00246e (diff) | |
parent | 3069cb25451cf9aad4840551b7286fee1c5aebc8 (diff) | |
download | gitlab-ce-10009-ee-board.tar.gz |
Merge branch 'master' into 10009-ee-board10009-ee-board
* master: (34 commits)
Set correct file mode for autocomplete images
Ensure visibility icons in group/project listings are grey
FE remove create branch call in IDE commit
Add start_sha to commits API
Localize updated text on projects list page
Perform more redactions in Redis performance bar traces
Refactor all existing usages of .act
Unquarantine object storage test
Go guide: be more explicit on testing frameworks + diffing test results
Doc for "Move external authorization service API management to EE"
Fix unordered list spacing
Refactor RedisCounter and WebIdeCommitsCounter
Move boards switcher partial
Add tests for when deploy token usernames are not unique
Fix factory default for pages_access_level
Add documentation surrounding [data-qa-selector]
Mockify jquery and axios packages
Add docs about auto-injected Jest mocks
Add rule_type to approval_project_rules
typo
...
Diffstat (limited to 'doc/development/database_debugging.md')
-rw-r--r-- | doc/development/database_debugging.md | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/doc/development/database_debugging.md b/doc/development/database_debugging.md index 0311eda1ff1..eb3b227473b 100644 --- a/doc/development/database_debugging.md +++ b/doc/development/database_debugging.md @@ -9,31 +9,31 @@ 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) +- `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) ## Nuke everything and start over If you just want to delete everything and start over with an empty DB (~1 minute): - - `bundle exec rake db:reset RAILS_ENV=development` +- `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` +- `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` +- `bundle exec rake db:reset RAILS_ENV=test` ## Migration wrangling - - `bundle exec rake db:migrate RAILS_ENV=development`: Execute any pending migrations that you may have picked up from a MR - - `bundle exec rake db:migrate:status RAILS_ENV=development`: Check if all migrations are `up` or `down` - - `bundle exec rake db:migrate:down VERSION=20170926203418 RAILS_ENV=development`: Tear down a migration - - `bundle exec rake db:migrate:up VERSION=20170926203418 RAILS_ENV=development`: Set up a migration - - `bundle exec rake db:migrate:redo VERSION=20170926203418 RAILS_ENV=development`: Re-run a specific migration +- `bundle exec rake db:migrate RAILS_ENV=development`: Execute any pending migrations that you may have picked up from a MR +- `bundle exec rake db:migrate:status RAILS_ENV=development`: Check if all migrations are `up` or `down` +- `bundle exec rake db:migrate:down VERSION=20170926203418 RAILS_ENV=development`: Tear down a migration +- `bundle exec rake db:migrate:up VERSION=20170926203418 RAILS_ENV=development`: Set up a migration +- `bundle exec rake db:migrate:redo VERSION=20170926203418 RAILS_ENV=development`: Re-run a specific migration ## Manually access the database @@ -45,12 +45,12 @@ bundle exec rails dbconsole RAILS_ENV=development bundle exec rails db RAILS_ENV=development ``` - - `\q`: Quit/exit - - `\dt`: List all tables - - `\d+ issues`: List columns for `issues` table - - `CREATE TABLE board_labels();`: Create a table called `board_labels` - - `SELECT * FROM schema_migrations WHERE version = '20170926203418';`: Check if a migration was run - - `DELETE FROM schema_migrations WHERE version = '20170926203418';`: Manually remove a migration +- `\q`: Quit/exit +- `\dt`: List all tables +- `\d+ issues`: List columns for `issues` table +- `CREATE TABLE board_labels();`: Create a table called `board_labels` +- `SELECT * FROM schema_migrations WHERE version = '20170926203418';`: Check if a migration was run +- `DELETE FROM schema_migrations WHERE version = '20170926203418';`: Manually remove a migration ## FAQ |