diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-04 21:07:31 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-04 21:07:31 +0000 |
commit | 71221554dd9ddf30f73035c89f78164e001aa96d (patch) | |
tree | c56e0b2fc3dd16602183b78cb3f68aed211c5e77 /db | |
parent | b41cd8cb92d53454b2b160ba922d33801933a9cf (diff) | |
download | gitlab-ce-71221554dd9ddf30f73035c89f78164e001aa96d.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
4 files changed, 60 insertions, 3 deletions
diff --git a/db/migrate/20191115001123_add_index_to_mod_sec_ci_variables.rb b/db/migrate/20191115001123_add_index_to_mod_sec_ci_variables.rb new file mode 100644 index 00000000000..169ecf5ea41 --- /dev/null +++ b/db/migrate/20191115001123_add_index_to_mod_sec_ci_variables.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddIndexToModSecCiVariables < ActiveRecord::Migration[5.2] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_concurrent_index :ci_variables, :project_id, where: "key = 'AUTO_DEVOPS_MODSECURITY_SEC_RULE_ENGINE'" + end + + def down + remove_concurrent_index :ci_variables, :project_id + end +end diff --git a/db/migrate/20191115001843_add_index_to_mod_sec_ci_pipeline_variables.rb b/db/migrate/20191115001843_add_index_to_mod_sec_ci_pipeline_variables.rb new file mode 100644 index 00000000000..6b13f565a11 --- /dev/null +++ b/db/migrate/20191115001843_add_index_to_mod_sec_ci_pipeline_variables.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddIndexToModSecCiPipelineVariables < ActiveRecord::Migration[5.2] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + add_concurrent_index :ci_pipeline_variables, :pipeline_id, where: "key = 'AUTO_DEVOPS_MODSECURITY_SEC_RULE_ENGINE'" + end + + def down + remove_concurrent_index :ci_pipeline_variables, :pipeline_id + end +end diff --git a/db/post_migrate/20191202031812_drop_operations_feature_flags_clients_token.rb b/db/post_migrate/20191202031812_drop_operations_feature_flags_clients_token.rb new file mode 100644 index 00000000000..bda461af7bc --- /dev/null +++ b/db/post_migrate/20191202031812_drop_operations_feature_flags_clients_token.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class DropOperationsFeatureFlagsClientsToken < ActiveRecord::Migration[5.2] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + # Ignored in 12.5 - https://gitlab.com/gitlab-org/gitlab/merge_requests/18923 + remove_column :operations_feature_flags_clients, :token + end + + def down + unless column_exists?(:operations_feature_flags_clients, :token) + add_column :operations_feature_flags_clients, :token, :string # rubocop:disable Migration/AddLimitToStringColumns + end + + add_concurrent_index :operations_feature_flags_clients, [:project_id, :token], unique: true, + name: 'index_operations_feature_flags_clients_on_project_id_and_token' + end +end diff --git a/db/schema.rb b/db/schema.rb index 253d82e790b..3bdf41e609f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2019_11_25_140458) do +ActiveRecord::Schema.define(version: 2019_12_02_031812) do # These are extensions that must be enabled in order to support this database enable_extension "pg_trgm" @@ -821,6 +821,7 @@ ActiveRecord::Schema.define(version: 2019_11_25_140458) do t.integer "pipeline_id", null: false t.integer "variable_type", limit: 2, default: 1, null: false t.index ["pipeline_id", "key"], name: "index_ci_pipeline_variables_on_pipeline_id_and_key", unique: true + t.index ["pipeline_id"], name: "index_ci_pipeline_variables_on_pipeline_id", where: "((key)::text = 'AUTO_DEVOPS_MODSECURITY_SEC_RULE_ENGINE'::text)" end create_table "ci_pipelines", id: :serial, force: :cascade do |t| @@ -979,6 +980,7 @@ ActiveRecord::Schema.define(version: 2019_11_25_140458) do t.boolean "masked", default: false, null: false t.integer "variable_type", limit: 2, default: 1, null: false t.index ["project_id", "key", "environment_scope"], name: "index_ci_variables_on_project_id_and_key_and_environment_scope", unique: true + t.index ["project_id"], name: "index_ci_variables_on_project_id", where: "((key)::text = 'AUTO_DEVOPS_MODSECURITY_SEC_RULE_ENGINE'::text)" end create_table "cluster_groups", id: :serial, force: :cascade do |t| @@ -2774,9 +2776,7 @@ ActiveRecord::Schema.define(version: 2019_11_25_140458) do create_table "operations_feature_flags_clients", force: :cascade do |t| t.integer "project_id", null: false - t.string "token" t.string "token_encrypted" - t.index ["project_id", "token"], name: "index_operations_feature_flags_clients_on_project_id_and_token", unique: true t.index ["project_id", "token_encrypted"], name: "index_feature_flags_clients_on_project_id_and_token_encrypted", unique: true end |