summaryrefslogtreecommitdiff
path: root/db/migrate/20210503105845_add_project_value_stream_id_to_project_stages.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20210503105845_add_project_value_stream_id_to_project_stages.rb')
-rw-r--r--db/migrate/20210503105845_add_project_value_stream_id_to_project_stages.rb30
1 files changed, 0 insertions, 30 deletions
diff --git a/db/migrate/20210503105845_add_project_value_stream_id_to_project_stages.rb b/db/migrate/20210503105845_add_project_value_stream_id_to_project_stages.rb
deleted file mode 100644
index d888ab4943c..00000000000
--- a/db/migrate/20210503105845_add_project_value_stream_id_to_project_stages.rb
+++ /dev/null
@@ -1,30 +0,0 @@
-# frozen_string_literal: true
-
-class AddProjectValueStreamIdToProjectStages < ActiveRecord::Migration[6.0]
- disable_ddl_transaction!
-
- INDEX_NAME = 'index_analytics_ca_project_stages_on_value_stream_id'
-
- class ProjectValueStream < ActiveRecord::Base
- self.table_name = 'analytics_cycle_analytics_project_stages'
-
- include EachBatch
- end
-
- def up
- ProjectValueStream.reset_column_information
- # The table was never used, there is no user-facing code that modifies the table, it should be empty.
- # Since there is no functionality present that depends on this data, it's safe to delete the rows.
- ProjectValueStream.each_batch(of: 100) do |relation|
- relation.delete_all
- end
-
- transaction do
- add_reference :analytics_cycle_analytics_project_stages, :project_value_stream, null: false, index: { name: INDEX_NAME }, foreign_key: { on_delete: :cascade, to_table: :analytics_cycle_analytics_project_value_streams }, type: :bigint # rubocop: disable Migration/AddReference, Rails/NotNullColumn
- end
- end
-
- def down
- remove_reference :analytics_cycle_analytics_project_stages, :project_value_stream
- end
-end