Skip to content
Snippets Groups Projects
Commit e929fc1b authored by Kamil Trzcińśki's avatar Kamil Trzcińśki
Browse files

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
No related branches found
No related tags found
No related merge requests found
# 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
Loading
Loading
@@ -10,7 +10,7 @@
#
# 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
enable_extension "plpgsql"
Loading
Loading
@@ -670,6 +670,7 @@ ActiveRecord::Schema.define(version: 20190322132835) do
t.string "environment_scope", default: "*", null: false
t.integer "cluster_type", limit: 2, default: 3, null: false
t.string "domain"
t.boolean "managed", default: true, null: false
t.index ["enabled"], name: "index_clusters_on_enabled", using: :btree
t.index ["user_id"], name: "index_clusters_on_user_id", using: :btree
end
Loading
Loading
Loading
Loading
@@ -3,6 +3,7 @@ FactoryBot.define do
user
name 'test-cluster'
cluster_type :project_type
managed true
 
trait :instance do
cluster_type { Clusters::Cluster.cluster_types[:instance_type] }
Loading
Loading
@@ -63,5 +64,9 @@ FactoryBot.define do
trait :with_domain do
domain 'example.com'
end
trait :user_managed do
managed false
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment