summaryrefslogtreecommitdiff
path: root/db/post_migrate/20170523073948_remove_assignee_id_from_issue.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2019-07-02 13:14:24 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2019-07-02 13:14:24 +0000
commite07ebe66af957c46e7c69329b3ab561bb539351b (patch)
tree9a4d6d52f94b99aea154ad53000a39d172b18cdb /db/post_migrate/20170523073948_remove_assignee_id_from_issue.rb
parent58786e2086b9d8db5784771f4dbfe8b5c107df18 (diff)
parent6aeb6996447ead0f6daf71faab85c99e11ab8ae8 (diff)
downloadgitlab-ce-e07ebe66af957c46e7c69329b3ab561bb539351b.tar.gz
Merge branch '59177-squash-old-migrations' into 'master'harish-and-cindy-ssl-check-rake-taskharish-and-cindy-ldap-sync-rake-tasks
Squash old migrations Closes #59177 See merge request gitlab-org/gitlab-ce!30226
Diffstat (limited to 'db/post_migrate/20170523073948_remove_assignee_id_from_issue.rb')
-rw-r--r--db/post_migrate/20170523073948_remove_assignee_id_from_issue.rb48
1 files changed, 0 insertions, 48 deletions
diff --git a/db/post_migrate/20170523073948_remove_assignee_id_from_issue.rb b/db/post_migrate/20170523073948_remove_assignee_id_from_issue.rb
deleted file mode 100644
index d75bbb2f612..00000000000
--- a/db/post_migrate/20170523073948_remove_assignee_id_from_issue.rb
+++ /dev/null
@@ -1,48 +0,0 @@
-# See http://doc.gitlab.com/ce/development/migration_style_guide.html
-# for more information on how to write migrations for GitLab.
-
-class RemoveAssigneeIdFromIssue < ActiveRecord::Migration[4.2]
- include Gitlab::Database::MigrationHelpers
-
- # Set this constant to true if this migration requires downtime.
- DOWNTIME = false
-
- # When a migration requires downtime you **must** uncomment the following
- # constant and define a short and easy to understand explanation as to why the
- # migration requires downtime.
- # DOWNTIME_REASON = ''
-
- # When using the methods "add_concurrent_index", "remove_concurrent_index" or
- # "add_column_with_default" you must disable the use of transactions
- # as these methods can not run in an existing transaction.
- # When using "add_concurrent_index" or "remove_concurrent_index" methods make sure
- # that either of them is the _only_ method called in the migration,
- # any other changes should go in a separate migration.
- # This ensures that upon failure _only_ the index creation or removing fails
- # and can be retried or reverted easily.
- #
- # To disable transactions uncomment the following line and remove these
- # comments:
- disable_ddl_transaction!
-
- class Issue < ActiveRecord::Base
- self.table_name = 'issues'
-
- include ::EachBatch
- end
-
- def up
- remove_column :issues, :assignee_id
- end
-
- def down
- add_column :issues, :assignee_id, :integer
- add_concurrent_index :issues, :assignee_id
-
- update_value = Arel.sql('(SELECT user_id FROM issue_assignees WHERE issue_assignees.issue_id = issues.id LIMIT 1)')
-
- # This is only used in the down step, so we can ignore the RuboCop warning
- # about large tables, as this is very unlikely to be run on GitLab.com
- update_column_in_batches(:issues, :assignee_id, update_value) # rubocop:disable Migration/UpdateLargeTable
- end
-end