Merge remote-tracking branch 'remotes/upstream/develop' into 1335-user-api-id-fields...
[akkoma] / priv / repo / migrations / 20191108161911_create_user_blocks.exs
1 defmodule Pleroma.Repo.Migrations.CreateUserBlocks do
2 use Ecto.Migration
3
4 def change do
5 create_if_not_exists table(:user_blocks) do
6 add(:blocker_id, references(:users, type: :uuid, on_delete: :delete_all))
7 add(:blockee_id, references(:users, type: :uuid, on_delete: :delete_all))
8
9 timestamps(updated_at: false)
10 end
11
12 create_if_not_exists(unique_index(:user_blocks, [:blocker_id, :blockee_id]))
13 end
14 end