mirror of
https://github.com/mastodon/mastodon.git
synced 2025-10-05 16:42:47 +00:00
Undo reverted migrations when needed
This commit is contained in:
parent
bdebc4dc46
commit
c4676a83fd
|
@ -11,6 +11,8 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
class Conversation < ApplicationRecord
|
class Conversation < ApplicationRecord
|
||||||
|
self.ignored_columns += %w(parent_status_id parent_account_id)
|
||||||
|
|
||||||
validates :uri, uniqueness: true, if: :uri?
|
validates :uri, uniqueness: true, if: :uri?
|
||||||
|
|
||||||
has_many :statuses, dependent: nil
|
has_many :statuses, dependent: nil
|
||||||
|
|
|
@ -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
|
|
@ -10,7 +10,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# 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
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "pg_catalog.plpgsql"
|
enable_extension "pg_catalog.plpgsql"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user