Remove unused columns from polls (#7125)

This commit is contained in:
rhymes 2020-04-07 15:49:11 +02:00 committed by GitHub
parent cc8168f794
commit 9dc8d1dc3d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 6 deletions

View file

@ -1,8 +1,4 @@
class Poll < ApplicationRecord
self.ignored_columns = %w[
allow_multiple_selections
]
attr_accessor :poll_options_input_array
serialize :voting_data

View file

@ -0,0 +1,7 @@
class RemoveUnusedColumnsFromPolls < ActiveRecord::Migration[5.2]
def change
safety_assured do
remove_column :polls, :allow_multiple_selections, :boolean, default: false
end
end
end

View file

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2020_03_31_155903) do
ActiveRecord::Schema.define(version: 2020_04_07_083405) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -855,7 +855,6 @@ ActiveRecord::Schema.define(version: 2020_03_31_155903) do
end
create_table "polls", force: :cascade do |t|
t.boolean "allow_multiple_selections", default: false
t.bigint "article_id"
t.datetime "created_at", null: false
t.integer "poll_options_count", default: 0, null: false