From bbf60f8ed23efc21860d0d39d53586ed3d2e4b59 Mon Sep 17 00:00:00 2001 From: rhymes Date: Tue, 7 Apr 2020 19:15:45 +0200 Subject: [PATCH] Remove unused columns from poll options (#7124) Co-authored-by: Ben Halpern --- app/models/poll_option.rb | 4 ---- ...200407081312_remove_unused_columns_from_poll_options.rb | 7 +++++++ db/schema.rb | 1 - 3 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 db/migrate/20200407081312_remove_unused_columns_from_poll_options.rb diff --git a/app/models/poll_option.rb b/app/models/poll_option.rb index c38af7e59..cb7fcc4b1 100644 --- a/app/models/poll_option.rb +++ b/app/models/poll_option.rb @@ -1,8 +1,4 @@ class PollOption < ApplicationRecord - self.ignored_columns = %w[ - counts_in_tabulation - ] - belongs_to :poll has_many :poll_votes diff --git a/db/migrate/20200407081312_remove_unused_columns_from_poll_options.rb b/db/migrate/20200407081312_remove_unused_columns_from_poll_options.rb new file mode 100644 index 000000000..2a1dd5856 --- /dev/null +++ b/db/migrate/20200407081312_remove_unused_columns_from_poll_options.rb @@ -0,0 +1,7 @@ +class RemoveUnusedColumnsFromPollOptions < ActiveRecord::Migration[5.2] + def change + safety_assured do + remove_column :poll_options, :counts_in_tabulation, :boolean + end + end +end diff --git a/db/schema.rb b/db/schema.rb index e98cc6d82..c7508422e 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -820,7 +820,6 @@ ActiveRecord::Schema.define(version: 2020_04_07_091449) do end create_table "poll_options", force: :cascade do |t| - t.boolean "counts_in_tabulation" t.datetime "created_at", null: false t.string "markdown" t.bigint "poll_id"