summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2018-06-05 16:46:43 +0000
committerKamil Trzciński <ayufan@ayufan.eu>2018-06-05 16:46:43 +0000
commitced0b4453e1928353b123051dab8ca1ed0137b0e (patch)
treeee98e550f5d3b2e77a275a86806fe67dd6cc2bdc /db
parentda246582db2577107ffdfbcf5741daccc8e029c0 (diff)
parent1fc6935e642a31cebc31c3c8dbc258a9b6467e0a (diff)
downloadgitlab-ce-ced0b4453e1928353b123051dab8ca1ed0137b0e.tar.gz
Merge branch 'master' into 'backstage/gb/use-persisted-stages-to-improve-pipelines-table'
# Conflicts: # db/schema.rb
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20180523042841_rename_merge_requests_allow_maintainer_to_push.rb15
-rw-r--r--db/migrate/20180531220618_change_default_value_for_dsa_key_restriction.rb16
-rw-r--r--db/post_migrate/20180523125103_cleanup_merge_requests_allow_maintainer_to_push_rename.rb15
-rw-r--r--db/schema.rb6
4 files changed, 49 insertions, 3 deletions
diff --git a/db/migrate/20180523042841_rename_merge_requests_allow_maintainer_to_push.rb b/db/migrate/20180523042841_rename_merge_requests_allow_maintainer_to_push.rb
new file mode 100644
index 00000000000..975bdfe70f4
--- /dev/null
+++ b/db/migrate/20180523042841_rename_merge_requests_allow_maintainer_to_push.rb
@@ -0,0 +1,15 @@
+class RenameMergeRequestsAllowMaintainerToPush < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ rename_column_concurrently :merge_requests, :allow_maintainer_to_push, :allow_collaboration
+ end
+
+ def down
+ cleanup_concurrent_column_rename :merge_requests, :allow_collaboration, :allow_maintainer_to_push
+ end
+end
diff --git a/db/migrate/20180531220618_change_default_value_for_dsa_key_restriction.rb b/db/migrate/20180531220618_change_default_value_for_dsa_key_restriction.rb
new file mode 100644
index 00000000000..d0dcacc5b66
--- /dev/null
+++ b/db/migrate/20180531220618_change_default_value_for_dsa_key_restriction.rb
@@ -0,0 +1,16 @@
+class ChangeDefaultValueForDsaKeyRestriction < ActiveRecord::Migration
+ # Set this constant to true if this migration requires downtime.
+ DOWNTIME = false
+
+ def up
+ change_column :application_settings, :dsa_key_restriction, :integer, null: false,
+ default: -1
+
+ execute("UPDATE application_settings SET dsa_key_restriction = -1")
+ end
+
+ def down
+ change_column :application_settings, :dsa_key_restriction, :integer, null: false,
+ default: 0
+ end
+end
diff --git a/db/post_migrate/20180523125103_cleanup_merge_requests_allow_maintainer_to_push_rename.rb b/db/post_migrate/20180523125103_cleanup_merge_requests_allow_maintainer_to_push_rename.rb
new file mode 100644
index 00000000000..b9ce4600675
--- /dev/null
+++ b/db/post_migrate/20180523125103_cleanup_merge_requests_allow_maintainer_to_push_rename.rb
@@ -0,0 +1,15 @@
+class CleanupMergeRequestsAllowMaintainerToPushRename < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ cleanup_concurrent_column_rename :merge_requests, :allow_maintainer_to_push, :allow_collaboration
+ end
+
+ def down
+ rename_column_concurrently :merge_requests, :allow_collaboration, :allow_maintainer_to_push
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 04d3cce5665..b7d7cd89c14 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 20180530135500) do
+ActiveRecord::Schema.define(version: 20180531220618) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -110,7 +110,7 @@ ActiveRecord::Schema.define(version: 20180530135500) do
t.text "shared_runners_text_html"
t.text "after_sign_up_text_html"
t.integer "rsa_key_restriction", default: 0, null: false
- t.integer "dsa_key_restriction", default: 0, null: false
+ t.integer "dsa_key_restriction", default: -1, null: false
t.integer "ecdsa_key_restriction", default: 0, null: false
t.integer "ed25519_key_restriction", default: 0, null: false
t.boolean "housekeeping_enabled", default: true, null: false
@@ -1230,7 +1230,7 @@ ActiveRecord::Schema.define(version: 20180530135500) do
t.boolean "discussion_locked"
t.integer "latest_merge_request_diff_id"
t.string "rebase_commit_sha"
- t.boolean "allow_maintainer_to_push"
+ t.boolean "allow_collaboration"
t.boolean "squash", default: false, null: false
end