From 556c79d6cc3d7b24ecbba3a79f8432eb3fcf5c7e Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Mon, 2 Dec 2019 15:06:36 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- doc/development/verifying_database_capabilities.md | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'doc/development/verifying_database_capabilities.md') 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 ``` -- cgit v1.2.1