diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-02 18:06:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-02 18:06:36 +0300 |
commit | 556c79d6cc3d7b24ecbba3a79f8432eb3fcf5c7e (patch) | |
tree | 93c84c603316cdee73ce85949ba70e29ef78af32 /doc/development | |
parent | bffcdf9bca11a4d43cc40e3f382f03088d36f7c6 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/development')
-rw-r--r-- | doc/development/sql.md | 4 | ||||
-rw-r--r-- | doc/development/verifying_database_capabilities.md | 12 |
2 files changed, 3 insertions, 13 deletions
diff --git a/doc/development/sql.md b/doc/development/sql.md index 67ba98e2f31..84ad11effc5 100644 --- a/doc/development/sql.md +++ b/doc/development/sql.md @@ -108,15 +108,11 @@ class AddUsersLowerUsernameEmailIndexes < ActiveRecord::Migration[4.2] disable_ddl_transaction! def up - return unless Gitlab::Database.postgresql? - execute 'CREATE INDEX CONCURRENTLY index_on_users_lower_username ON users (LOWER(username));' execute 'CREATE INDEX CONCURRENTLY index_on_users_lower_email ON users (LOWER(email));' end def down - return unless Gitlab::Database.postgresql? - remove_index :users, :index_on_users_lower_username remove_index :users, :index_on_users_lower_email end diff --git a/doc/development/verifying_database_capabilities.md b/doc/development/verifying_database_capabilities.md index 6b4995aebe2..1413c782c5d 100644 --- a/doc/development/verifying_database_capabilities.md +++ b/doc/development/verifying_database_capabilities.md @@ -6,22 +6,16 @@ necessary to add database (version) specific behaviour. To facilitate this we have the following methods that you can use: -- `Gitlab::Database.postgresql?`: returns `true` if PostgreSQL is being used. - You can normally just assume this is the case. - `Gitlab::Database.version`: returns the PostgreSQL version number as a string in the format `X.Y.Z`. This allows you to write code such as: ```ruby -if Gitlab::Database.postgresql? - if Gitlab::Database.version.to_f >= 9.6 - run_really_fast_query - else - run_fast_query - end +if Gitlab::Database.version.to_f >= 9.6 + run_really_fast_query else - run_query + run_fast_query end ``` |