diff --git a/app/models/conversation.rb b/app/models/conversation.rb index a7fe1488407..5b26b833929 100644 --- a/app/models/conversation.rb +++ b/app/models/conversation.rb @@ -11,6 +11,8 @@ # class Conversation < ApplicationRecord + self.ignored_columns += %w(parent_status_id parent_account_id) + validates :uri, uniqueness: true, if: :uri? has_many :statuses, dependent: nil diff --git a/db/migrate/20250908181205_remove_reverted_conversation_changes.rb b/db/migrate/20250908181205_remove_reverted_conversation_changes.rb new file mode 100644 index 00000000000..16ec1c9e037 --- /dev/null +++ b/db/migrate/20250908181205_remove_reverted_conversation_changes.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class RemoveRevertedConversationChanges < ActiveRecord::Migration[8.0] + def up + remove_index :statuses, :conversation_id if index_exists?(:statuses, :conversation_id) + safety_assured { remove_column :conversations, :parent_status_id, if_exists: true } + safety_assured { remove_column :conversations, :parent_account_id, if_exists: true } + end + + def down; end +end diff --git a/db/schema.rb b/db/schema.rb index 81b0fe7ccc1..1bb20f4725a 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[8.0].define(version: 2025_08_20_084312) do +ActiveRecord::Schema[8.0].define(version: 2025_09_08_181205) do # These are extensions that must be enabled in order to support this database enable_extension "pg_catalog.plpgsql"