diff options
author | Lin Jen-Shin <godfat@godfat.org> | 2017-06-23 11:23:27 +0300 |
---|---|---|
committer | Lin Jen-Shin <godfat@godfat.org> | 2017-06-23 13:09:22 +0300 |
commit | d34e87818c217a1a7368852e4cba384914afedd0 (patch) | |
tree | 3a5fbd0400f2b3f5c7addf897f0ff18f15302e5a /db/migrate/20170623080805_remove_ci_variables_project_id_index.rb | |
parent | 5eb4a47204931ebf5e5f40a3653f1ba9557af2ce (diff) |
Remove old project_id index and make sure mysql work
Diffstat (limited to 'db/migrate/20170623080805_remove_ci_variables_project_id_index.rb')
-rw-r--r-- | db/migrate/20170623080805_remove_ci_variables_project_id_index.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/db/migrate/20170623080805_remove_ci_variables_project_id_index.rb b/db/migrate/20170623080805_remove_ci_variables_project_id_index.rb new file mode 100644 index 00000000000..ddcc0292b9d --- /dev/null +++ b/db/migrate/20170623080805_remove_ci_variables_project_id_index.rb @@ -0,0 +1,19 @@ +class RemoveCiVariablesProjectIdIndex < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + if index_exists?(:ci_variables, :project_id) + remove_concurrent_index(:ci_variables, :project_id) + end + end + + def down + unless index_exists?(:ci_variables, :project_id) + add_concurrent_index(:ci_variables, :project_id) + end + end +end |