discourse/db/migrate/20220202225716_add_external_id_to_topics.rb
2023-01-09 11:59:41 +00:00

9 lines
255 B
Ruby

# frozen_string_literal: true
class AddExternalIdToTopics < ActiveRecord::Migration[6.1]
def change
add_column :topics, :external_id, :string, null: true
add_index :topics, :external_id, unique: true, where: "external_id IS NOT NULL"
end
end