diff options
| author | Felipe Artur <felipefac@gmail.com> | 2016-06-06 11:30:17 -0300 |
|---|---|---|
| committer | Felipe Artur <felipefac@gmail.com> | 2016-06-06 13:06:21 -0300 |
| commit | 9264203103bbd2b4f46ce777304f210b07765c43 (patch) | |
| tree | ae409366398ca3882b0ed9e55c37708a7c27fee4 /lib | |
| parent | 8450fe3074140b86e7d2e5a85d2cdb65051906ee (diff) | |
| download | gitlab-ce-9264203103bbd2b4f46ce777304f210b07765c43.tar.gz | |
change add_concurrent_index function argumentsissue_3359
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/gitlab/database/migration_helpers.rb | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/lib/gitlab/database/migration_helpers.rb b/lib/gitlab/database/migration_helpers.rb index b88e50748f6..978c3f7896d 100644 --- a/lib/gitlab/database/migration_helpers.rb +++ b/lib/gitlab/database/migration_helpers.rb @@ -11,7 +11,7 @@ module Gitlab # add_concurrent_index :users, :some_column # # See Rails' `add_index` for more info on the available arguments. - def add_concurrent_index(*args) + def add_concurrent_index(table_name, column_name, options = {}) if transaction_open? raise 'add_concurrent_index can not be run inside a transaction, ' \ 'you can disable transactions by calling disable_ddl_transaction! ' \ @@ -19,14 +19,10 @@ module Gitlab end if Database.postgresql? - if args[2].present? - args[2].merge!({ algorithm: :concurrently }) - else - args << { algorithm: :concurrently } - end + options = options.merge({ algorithm: :concurrently }) end - add_index(*args) + add_index(table_name, column_name, options) end # Updates the value of a column in batches. |
