1 defmodule Pleroma.Repo.Migrations.CreateUserRelationships do
5 create_if_not_exists table(:user_relationships) do
6 add(:source_id, references(:users, type: :uuid, on_delete: :delete_all))
7 add(:target_id, references(:users, type: :uuid, on_delete: :delete_all))
8 add(:relationship_type, :integer, null: false)
10 timestamps(updated_at: false)
14 unique_index(:user_relationships, [:source_id, :relationship_type, :target_id])