20231211234923_create_follow_recommendation_mutes.rb 498 B

1234567891011121314
  1. # frozen_string_literal: true
  2. class CreateFollowRecommendationMutes < ActiveRecord::Migration[7.1]
  3. def change
  4. create_table :follow_recommendation_mutes do |t|
  5. t.references :account, null: false, foreign_key: { on_delete: :cascade }, index: false
  6. t.references :target_account, null: false, foreign_key: { to_table: 'accounts', on_delete: :cascade }
  7. t.timestamps
  8. end
  9. add_index :follow_recommendation_mutes, [:account_id, :target_account_id], unique: true
  10. end
  11. end