summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorblackst0ne <blackst0ne.ru@gmail.com>2018-05-29 20:51:43 +1100
committerblackst0ne <blackst0ne.ru@gmail.com>2018-05-29 20:51:43 +1100
commit4cff66a6c46361e8d775ea3f5a80bf147d4020b3 (patch)
treef1f76411400f35f394fedd28ad03d42ccbaf990e /db
parent6e354cb642f911dc71be3d5368f066900fc25970 (diff)
downloadgitlab-ce-4cff66a6c46361e8d775ea3f5a80bf147d4020b3.tar.gz
Add 'squash and rebase' feature to CEblackst0ne-squash-and-merge-in-gitlab-core-ce
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20180515005612_add_squash_to_merge_requests.rb19
-rw-r--r--db/schema.rb1
2 files changed, 20 insertions, 0 deletions
diff --git a/db/migrate/20180515005612_add_squash_to_merge_requests.rb b/db/migrate/20180515005612_add_squash_to_merge_requests.rb
new file mode 100644
index 00000000000..f526b45bd4b
--- /dev/null
+++ b/db/migrate/20180515005612_add_squash_to_merge_requests.rb
@@ -0,0 +1,19 @@
+# See http://doc.gitlab.com/ce/development/migration_style_guide.html
+# for more information on how to write migrations for GitLab.
+
+class AddSquashToMergeRequests < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+ disable_ddl_transaction!
+
+ DOWNTIME = false
+
+ def up
+ unless column_exists?(:merge_requests, :squash)
+ add_column_with_default :merge_requests, :squash, :boolean, default: false, allow_null: false
+ end
+ end
+
+ def down
+ remove_column :merge_requests, :squash if column_exists?(:merge_requests, :squash)
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 884e333874c..ee9c85da7a2 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -1217,6 +1217,7 @@ ActiveRecord::Schema.define(version: 20180521171529) do
t.integer "latest_merge_request_diff_id"
t.string "rebase_commit_sha"
t.boolean "allow_maintainer_to_push"
+ t.boolean "squash", default: false, null: false
end
add_index "merge_requests", ["assignee_id"], name: "index_merge_requests_on_assignee_id", using: :btree