diff options
| author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2016-12-12 16:30:24 +0200 |
|---|---|---|
| committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2016-12-12 16:34:47 +0200 |
| commit | 211f019382c5e3fcf4812199aaf09b850eab09dd (patch) | |
| tree | 4775f6506caee718589b245d1cbf8f5bb2f3d616 /db/migrate | |
| parent | db9e1635d0d17596193ecbee8e0acc1916918d1d (diff) | |
| download | gitlab-ce-211f019382c5e3fcf4812199aaf09b850eab09dd.tar.gz | |
Add index to routes table on lower path for postgresqldz-create-routes-lower-index
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'db/migrate')
| -rw-r--r-- | db/migrate/20161212142807_add_lower_path_index_to_routes.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/db/migrate/20161212142807_add_lower_path_index_to_routes.rb b/db/migrate/20161212142807_add_lower_path_index_to_routes.rb new file mode 100644 index 00000000000..6958500306f --- /dev/null +++ b/db/migrate/20161212142807_add_lower_path_index_to_routes.rb @@ -0,0 +1,22 @@ +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class AddLowerPathIndexToRoutes < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + return unless Gitlab::Database.postgresql? + + execute 'CREATE INDEX CONCURRENTLY index_on_routes_lower_path ON routes (LOWER(path));' + end + + def down + return unless Gitlab::Database.postgresql? + + remove_index :routes, name: :index_on_routes_lower_path + end +end |
