Commit 29249536 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix package indices migration for MySQL

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent b2264607
...@@ -7,11 +7,17 @@ class AddMoreIndicesToPackages < ActiveRecord::Migration ...@@ -7,11 +7,17 @@ class AddMoreIndicesToPackages < ActiveRecord::Migration
def up def up
add_concurrent_index :packages_package_files, [:package_id, :file_name] add_concurrent_index :packages_package_files, [:package_id, :file_name]
add_concurrent_index :packages_maven_metadata, :path add_concurrent_index :packages_maven_metadata, :path, length: text_index_length
end end
def down def down
remove_concurrent_index :packages_package_files, [:package_id, :file_name] remove_concurrent_index :packages_package_files, [:package_id, :file_name]
remove_concurrent_index :packages_maven_metadata, :path remove_concurrent_index :packages_maven_metadata, :path, length: text_index_length
end
private
def text_index_length
Gitlab::Database.mysql? ? 20 : nil
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment