nas/db/migrate/20240217230006_create_pending_follow_requests.rb
KMY(雪あすか) dfc9f35d71
Add: #586 保留中のリモートアカウントからのフォローが飛んできた場合に記録する (#590)
* Add: #586 保留中のリモートアカウントからのフォローが飛んできた場合に記録する

* 本家に戻す処理を修正

* Fix test

* Fix worker link

* Fix test

* リモートアカウント拒否時に既存のリクエストを削除
2024-02-18 10:48:48 +09:00

17 lines
572 B
Ruby

# frozen_string_literal: true
class CreatePendingFollowRequests < ActiveRecord::Migration[7.1]
disable_ddl_transaction!
def change
create_table :pending_follow_requests do |t|
t.references :account, null: false, foreign_key: { on_delete: :cascade }, index: false
t.references :target_account, null: false, foreign_key: { to_table: 'accounts', on_delete: :cascade }
t.string :uri, null: false, index: { unique: true }
t.timestamps
end
add_index :pending_follow_requests, [:account_id, :target_account_id], unique: true
end
end