logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

20170604144747_add_foreign_keys_for_accounts.rb (2893B)


  1. class AddForeignKeysForAccounts < ActiveRecord::Migration[5.1]
  2. def change
  3. add_foreign_key :statuses, :accounts, on_delete: :cascade
  4. add_foreign_key :statuses, :accounts, column: :in_reply_to_account_id, on_delete: :nullify
  5. add_foreign_key :statuses, :statuses, column: :in_reply_to_id, on_delete: :nullify
  6. add_foreign_key :account_domain_blocks, :accounts, on_delete: :cascade
  7. add_foreign_key :conversation_mutes, :accounts, on_delete: :cascade
  8. add_foreign_key :conversation_mutes, :conversations, on_delete: :cascade
  9. add_foreign_key :favourites, :accounts, on_delete: :cascade
  10. add_foreign_key :favourites, :statuses, on_delete: :cascade
  11. add_foreign_key :blocks, :accounts, on_delete: :cascade
  12. add_foreign_key :blocks, :accounts, column: :target_account_id, on_delete: :cascade
  13. add_foreign_key :follow_requests, :accounts, on_delete: :cascade
  14. add_foreign_key :follow_requests, :accounts, column: :target_account_id, on_delete: :cascade
  15. add_foreign_key :follows, :accounts, on_delete: :cascade
  16. add_foreign_key :follows, :accounts, column: :target_account_id, on_delete: :cascade
  17. add_foreign_key :mutes, :accounts, on_delete: :cascade
  18. add_foreign_key :mutes, :accounts, column: :target_account_id, on_delete: :cascade
  19. add_foreign_key :imports, :accounts, on_delete: :cascade
  20. add_foreign_key :media_attachments, :accounts, on_delete: :nullify
  21. add_foreign_key :media_attachments, :statuses, on_delete: :nullify
  22. add_foreign_key :mentions, :accounts, on_delete: :cascade
  23. add_foreign_key :mentions, :statuses, on_delete: :cascade
  24. add_foreign_key :notifications, :accounts, on_delete: :cascade
  25. add_foreign_key :notifications, :accounts, column: :from_account_id, on_delete: :cascade
  26. add_foreign_key :preview_cards, :statuses, on_delete: :cascade
  27. add_foreign_key :reports, :accounts, on_delete: :cascade
  28. add_foreign_key :reports, :accounts, column: :target_account_id, on_delete: :cascade
  29. add_foreign_key :reports, :accounts, column: :action_taken_by_account_id, on_delete: :nullify
  30. add_foreign_key :statuses_tags, :statuses, on_delete: :cascade
  31. add_foreign_key :statuses_tags, :tags, on_delete: :cascade
  32. add_foreign_key :stream_entries, :accounts, on_delete: :cascade
  33. add_foreign_key :subscriptions, :accounts, on_delete: :cascade
  34. add_foreign_key :users, :accounts, on_delete: :cascade
  35. add_foreign_key :web_settings, :users, on_delete: :cascade
  36. add_foreign_key :oauth_access_grants, :users, column: :resource_owner_id, on_delete: :cascade
  37. add_foreign_key :oauth_access_grants, :oauth_applications, column: :application_id, on_delete: :cascade
  38. add_foreign_key :oauth_access_tokens, :users, column: :resource_owner_id, on_delete: :cascade
  39. add_foreign_key :oauth_access_tokens, :oauth_applications, column: :application_id, on_delete: :cascade
  40. end
  41. end