From ab4664668fd50db9391a30c150cb58f651eb3330 Mon Sep 17 00:00:00 2001 From: Rob Orton Date: Fri, 13 Feb 2015 12:48:41 -0700 Subject: [PATCH] drop unused column from sis_batches test plan - migrations should work Change-Id: I29a2b27607690ee62eee5c64e1111ea05772d2a7 Reviewed-on: https://gerrit.instructure.com/48810 Tested-by: Jenkins Reviewed-by: Cody Cutrer QA-Review: August Thornton Product-Review: Rob Orton --- app/models/sis_batch.rb | 2 +- config/initializers/dropped_columns.rb | 1 + .../20150213193129_drop_batch_id_from_sis_batches.rb | 11 +++++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20150213193129_drop_batch_id_from_sis_batches.rb diff --git a/app/models/sis_batch.rb b/app/models/sis_batch.rb index 3353ab14c3c..2e16b76cbd7 100644 --- a/app/models/sis_batch.rb +++ b/app/models/sis_batch.rb @@ -28,7 +28,7 @@ class SisBatch < ActiveRecord::Base belongs_to :user EXPORTABLE_ATTRIBUTES = [ - :id, :account_id, :batch_id, :ended_at, :errored_attempts, :workflow_state, :data, :created_at, :updated_at, :attachment_id, :processing_errors, + :id, :account_id, :ended_at, :errored_attempts, :workflow_state, :data, :created_at, :updated_at, :attachment_id, :processing_errors, :processing_warnings, :batch_mode, :options, :user_id ] diff --git a/config/initializers/dropped_columns.rb b/config/initializers/dropped_columns.rb index ade1aeb1b79..d650c9269ee 100644 --- a/config/initializers/dropped_columns.rb +++ b/config/initializers/dropped_columns.rb @@ -48,6 +48,7 @@ class ActiveRecord::Base 'role_overrides' => %w(context_code enrollment_type), 'users' => %w(type creation_unique_id creation_sis_batch_id creation_email sis_name bio), 'quizzes' => %w(root_quiz_id), + 'sis_batches' => %w{batch_id}, 'stream_items' => %w{context_code item_asset_string}, 'stream_item_instances' => %w(context_code), 'submissions' => %w(changed_since_publish late), diff --git a/db/migrate/20150213193129_drop_batch_id_from_sis_batches.rb b/db/migrate/20150213193129_drop_batch_id_from_sis_batches.rb new file mode 100644 index 00000000000..82454664e96 --- /dev/null +++ b/db/migrate/20150213193129_drop_batch_id_from_sis_batches.rb @@ -0,0 +1,11 @@ +class DropBatchIdFromSisBatches < ActiveRecord::Migration + tag :postdeploy + + def up + remove_column :sis_batches, :batch_id + end + + def down + add_column :sis_batches, :batch_id, :string + end +end