Commit e929fc1b authored by Kamil Trzciński's avatar Kamil Trzciński

Merge branch '56557-add-managed-field-to-cluster' into 'master'

Adds `managed` boolean column to Clusters table

Closes #56557

See merge request gitlab-org/gitlab-ce!26675
parents c44b9e9e 6473f697
# frozen_string_literal: true
class AddManagedToCluster < ActiveRecord::Migration[5.0]
include Gitlab::Database::MigrationHelpers
disable_ddl_transaction!
DOWNTIME = false
def up
add_column_with_default(:clusters, :managed, :boolean, default: true)
end
def down
remove_column(:clusters, :managed)
end
end
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20190322132835) do ActiveRecord::Schema.define(version: 20190325165127) do
# These are extensions that must be enabled in order to support this database # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"
...@@ -670,6 +670,7 @@ ActiveRecord::Schema.define(version: 20190322132835) do ...@@ -670,6 +670,7 @@ ActiveRecord::Schema.define(version: 20190322132835) do
t.string "environment_scope", default: "*", null: false t.string "environment_scope", default: "*", null: false
t.integer "cluster_type", limit: 2, default: 3, null: false t.integer "cluster_type", limit: 2, default: 3, null: false
t.string "domain" t.string "domain"
t.boolean "managed", default: true, null: false
t.index ["enabled"], name: "index_clusters_on_enabled", using: :btree t.index ["enabled"], name: "index_clusters_on_enabled", using: :btree
t.index ["user_id"], name: "index_clusters_on_user_id", using: :btree t.index ["user_id"], name: "index_clusters_on_user_id", using: :btree
end end
......
...@@ -3,6 +3,7 @@ FactoryBot.define do ...@@ -3,6 +3,7 @@ FactoryBot.define do
user user
name 'test-cluster' name 'test-cluster'
cluster_type :project_type cluster_type :project_type
managed true
trait :instance do trait :instance do
cluster_type { Clusters::Cluster.cluster_types[:instance_type] } cluster_type { Clusters::Cluster.cluster_types[:instance_type] }
...@@ -63,5 +64,9 @@ FactoryBot.define do ...@@ -63,5 +64,9 @@ FactoryBot.define do
trait :with_domain do trait :with_domain do
domain 'example.com' domain 'example.com'
end end
trait :user_managed do
managed false
end
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