diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-25 18:09:02 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-25 18:09:02 +0000 |
commit | 951616a26a61e880860ad862c1d45a8e3762b4bc (patch) | |
tree | ed6fe722e955aff38e13ca02d2aa7fdd4239c863 /db | |
parent | e06d0e779673d745972863302858105aad9032e5 (diff) | |
download | gitlab-ce-951616a26a61e880860ad862c1d45a8e3762b4bc.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20200224163804_add_version_to_feature_flags_table.rb | 23 | ||||
-rw-r--r-- | db/schema.rb | 3 |
2 files changed, 25 insertions, 1 deletions
diff --git a/db/migrate/20200224163804_add_version_to_feature_flags_table.rb b/db/migrate/20200224163804_add_version_to_feature_flags_table.rb new file mode 100644 index 00000000000..e2ccefd8955 --- /dev/null +++ b/db/migrate/20200224163804_add_version_to_feature_flags_table.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class AddVersionToFeatureFlagsTable < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + FEATURE_FLAG_LEGACY_VERSION = 1 + + def up + # The operations_feature_flags table is small enough that we can disable this cop. + # See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/25552#note_291202882 + # rubocop: disable Migration/AddColumnWithDefault + add_column_with_default(:operations_feature_flags, :version, :smallint, default: FEATURE_FLAG_LEGACY_VERSION, allow_null: false) + # rubocop: enable Migration/AddColumnWithDefault + end + + def down + remove_column(:operations_feature_flags, :version) + end +end diff --git a/db/schema.rb b/db/schema.rb index c3b1172c6dc..8052a93e841 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: 2020_02_21_144534) do +ActiveRecord::Schema.define(version: 2020_02_24_163804) do # These are extensions that must be enabled in order to support this database enable_extension "pg_trgm" @@ -2916,6 +2916,7 @@ ActiveRecord::Schema.define(version: 2020_02_21_144534) do t.string "name", null: false t.text "description" t.integer "iid", null: false + t.integer "version", limit: 2, default: 1, null: false t.index ["project_id", "iid"], name: "index_operations_feature_flags_on_project_id_and_iid", unique: true t.index ["project_id", "name"], name: "index_operations_feature_flags_on_project_id_and_name", unique: true end |