diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-01-30 22:51:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-30 22:51:32 +0100 |
commit | b54e263712a9f2b3d4ff0d7b692565d8e24dc03b (patch) | |
tree | 88600c7253f9a929ae30cef4644e2663f41788e6 /db/migrate/20181026034033_remove_faux_remote_account_duplicates.rb | |
parent | 2ba6267f1603cee682bfe3885b797ad5df7e958f (diff) | |
parent | 7679ddcd5ee289f847f8a4836a0b0220d433bae6 (diff) |
Merge pull request #1673 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'db/migrate/20181026034033_remove_faux_remote_account_duplicates.rb')
-rw-r--r-- | db/migrate/20181026034033_remove_faux_remote_account_duplicates.rb | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/db/migrate/20181026034033_remove_faux_remote_account_duplicates.rb b/db/migrate/20181026034033_remove_faux_remote_account_duplicates.rb index bd4f4c2a3..40537e9c9 100644 --- a/db/migrate/20181026034033_remove_faux_remote_account_duplicates.rb +++ b/db/migrate/20181026034033_remove_faux_remote_account_duplicates.rb @@ -1,6 +1,46 @@ class RemoveFauxRemoteAccountDuplicates < ActiveRecord::Migration[5.2] disable_ddl_transaction! + class StreamEntry < ApplicationRecord + # Dummy class, to make migration possible across version changes + belongs_to :account, inverse_of: :stream_entries + end + + class Status < ApplicationRecord + # Dummy class, to make migration possible across version changes + belongs_to :account, inverse_of: :statuses + has_many :favourites, inverse_of: :status, dependent: :destroy + has_many :mentions, dependent: :destroy, inverse_of: :status + end + + class Favourite < ApplicationRecord + # Dummy class, to make migration possible across version changes + belongs_to :account, inverse_of: :favourites + belongs_to :status, inverse_of: :favourites + end + + class Mention < ApplicationRecord + # Dummy class, to make migration possible across version changes + belongs_to :account, inverse_of: :mentions + belongs_to :status + end + + class Notification < ApplicationRecord + # Dummy class, to make migration possible across version changes + belongs_to :account, optional: true + belongs_to :from_account, class_name: 'Account', optional: true + belongs_to :activity, polymorphic: true, optional: true + end + + class Account < ApplicationRecord + # Dummy class, to make migration possible across version changes + has_many :stream_entries, inverse_of: :account, dependent: :destroy + has_many :statuses, inverse_of: :account, dependent: :destroy + has_many :favourites, inverse_of: :account, dependent: :destroy + has_many :mentions, inverse_of: :account, dependent: :destroy + has_many :notifications, inverse_of: :account, dependent: :destroy + end + def up local_domain = Rails.configuration.x.local_domain |