summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Artur <felipefac@gmail.com>2017-06-09 15:34:58 -0300
committerFelipe Artur <felipefac@gmail.com>2017-06-16 12:03:15 -0300
commit85cdde8d3340dc0be28749225bf00923c84e5924 (patch)
tree3a9066c61ad31f4a88bf541f911d6a9c21524d01
parent2e3f0b08fbc0387d3f7985bf61c16e8ec9821750 (diff)
downloadgitlab-ce-85cdde8d3340dc0be28749225bf00923c84e5924.tar.gz
Migration - Remove position field from issues and merge requests
-rw-r--r--app/models/issue.rb3
-rw-r--r--app/models/merge_request.rb3
-rw-r--r--db/post_migrate/20170609183112_remove_position_from_issuables.rb8
-rw-r--r--db/schema.rb4
4 files changed, 15 insertions, 3 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb
index 2cede9d284b..f0f525aea21 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -9,6 +9,9 @@ class Issue < ActiveRecord::Base
include Spammable
include FasterCacheKeys
include RelativePositioning
+ include IgnorableColumn
+
+ ignore_column :position
DueDateStruct = Struct.new(:title, :name).freeze
NoDueDate = DueDateStruct.new('No Due Date', '0').freeze
diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb
index dd155252ad5..8e8eaea3926 100644
--- a/app/models/merge_request.rb
+++ b/app/models/merge_request.rb
@@ -4,6 +4,9 @@ class MergeRequest < ActiveRecord::Base
include Noteable
include Referable
include Sortable
+ include IgnorableColumn
+
+ ignore_column :position
belongs_to :target_project, class_name: "Project"
belongs_to :source_project, class_name: "Project"
diff --git a/db/post_migrate/20170609183112_remove_position_from_issuables.rb b/db/post_migrate/20170609183112_remove_position_from_issuables.rb
new file mode 100644
index 00000000000..4caaa2e83e8
--- /dev/null
+++ b/db/post_migrate/20170609183112_remove_position_from_issuables.rb
@@ -0,0 +1,8 @@
+class RemovePositionFromIssuables < ActiveRecord::Migration
+ DOWNTIME = false
+
+ def change
+ remove_column :issues, :position, :integer
+ remove_column :merge_requests, :position, :integer
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 956ca2278f4..803e36fba5a 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: 20170607121233) do
+ActiveRecord::Schema.define(version: 20170609183112) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -547,7 +547,6 @@ ActiveRecord::Schema.define(version: 20170607121233) do
t.integer "project_id"
t.datetime "created_at"
t.datetime "updated_at"
- t.integer "position", default: 0
t.string "branch_name"
t.text "description"
t.integer "milestone_id"
@@ -738,7 +737,6 @@ ActiveRecord::Schema.define(version: 20170607121233) do
t.integer "target_project_id", null: false
t.integer "iid"
t.text "description"
- t.integer "position", default: 0
t.datetime "locked_at"
t.integer "updated_by_id"
t.text "merge_error"