diff options
author | Mark Chao <mchao@gitlab.com> | 2018-06-08 13:12:51 +0000 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2018-06-08 13:12:51 +0000 |
commit | 68cb1c2651fde0ae009beed10f81a74172ceeab1 (patch) | |
tree | f8a191e5916b38d00abc747d35cd3e77dd640296 /db | |
parent | e1f9f3c6ac8a71c8196c8eae7d4c573899466cdf (diff) | |
download | gitlab-ce-68cb1c2651fde0ae009beed10f81a74172ceeab1.tar.gz |
Revert rename allow collaboration column
Diffstat (limited to 'db')
5 files changed, 51 insertions, 6 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 index 975bdfe70f4..41bc7b71694 100644 --- a/db/migrate/20180523042841_rename_merge_requests_allow_maintainer_to_push.rb +++ b/db/migrate/20180523042841_rename_merge_requests_allow_maintainer_to_push.rb @@ -6,10 +6,12 @@ class RenameMergeRequestsAllowMaintainerToPush < ActiveRecord::Migration disable_ddl_transaction! def up - rename_column_concurrently :merge_requests, :allow_maintainer_to_push, :allow_collaboration + # NOOP end def down - cleanup_concurrent_column_rename :merge_requests, :allow_collaboration, :allow_maintainer_to_push + if column_exists?(:merge_requests, :allow_collaboration) + cleanup_concurrent_column_rename :merge_requests, :allow_collaboration, :allow_maintainer_to_push + end end end diff --git a/db/migrate/20180608110058_rename_merge_requests_allow_collaboration.rb b/db/migrate/20180608110058_rename_merge_requests_allow_collaboration.rb new file mode 100644 index 00000000000..dcbbef9bd4a --- /dev/null +++ b/db/migrate/20180608110058_rename_merge_requests_allow_collaboration.rb @@ -0,0 +1,21 @@ +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class RenameMergeRequestsAllowCollaboration < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + # Set this constant to true if this migration requires downtime. + DOWNTIME = false + + disable_ddl_transaction! + + def up + if column_exists?(:merge_requests, :allow_collaboration) + rename_column_concurrently :merge_requests, :allow_collaboration, :allow_maintainer_to_push + end + end + + def down + # NOOP + 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 index b9ce4600675..7301bcf2c6c 100644 --- 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 @@ -6,10 +6,12 @@ class CleanupMergeRequestsAllowMaintainerToPushRename < ActiveRecord::Migration disable_ddl_transaction! def up - cleanup_concurrent_column_rename :merge_requests, :allow_maintainer_to_push, :allow_collaboration + # NOOP end def down - rename_column_concurrently :merge_requests, :allow_collaboration, :allow_maintainer_to_push + if column_exists?(:merge_requests, :allow_collaboration) + rename_column_concurrently :merge_requests, :allow_collaboration, :allow_maintainer_to_push + end end end diff --git a/db/post_migrate/20180608201435_cleanup_merge_requests_allow_collaboration_rename.rb b/db/post_migrate/20180608201435_cleanup_merge_requests_allow_collaboration_rename.rb new file mode 100644 index 00000000000..3f3edb8ea3d --- /dev/null +++ b/db/post_migrate/20180608201435_cleanup_merge_requests_allow_collaboration_rename.rb @@ -0,0 +1,20 @@ +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class CleanupMergeRequestsAllowCollaborationRename < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + if column_exists?(:merge_requests, :allow_collaboration) + cleanup_concurrent_column_rename :merge_requests, :allow_collaboration, :allow_maintainer_to_push + end + end + + def down + # NOOP + end +end diff --git a/db/schema.rb b/db/schema.rb index d1446af0a2e..d05c6afbb9f 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: 20180603190921) do +ActiveRecord::Schema.define(version: 20180608201435) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -1231,8 +1231,8 @@ ActiveRecord::Schema.define(version: 20180603190921) do t.boolean "discussion_locked" t.integer "latest_merge_request_diff_id" t.string "rebase_commit_sha" - t.boolean "allow_collaboration" t.boolean "squash", default: false, null: false + t.boolean "allow_maintainer_to_push" end add_index "merge_requests", ["assignee_id"], name: "index_merge_requests_on_assignee_id", using: :btree |