0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-04 10:39:43 +08:00
discourse/plugins/discourse-solved/db/migrate/20210618142654_recreate_solutions_column.rb
2025-07-22 15:07:59 +02:00

15 lines
495 B
Ruby
Vendored

# frozen_string_literal: true
class RecreateSolutionsColumn < ActiveRecord::Migration[6.1]
def up
if !ActiveRecord::Base.connection.column_exists?(:directory_items, :solutions)
# A reverted commit had added this column previously so some sites have this
# column, and some so not. Only add if the DB doesn't already have it.
add_column :directory_items, :solutions, :integer, default: 0
end
end
def down
remove_column :directory_items, :solutions
end
end