[#1335] Refactored UserMute and UserBlock into UserRelationship, introduced EctoEnum.
This commit is contained in:
parent
01d9c093c3
commit
aad6576130
15 changed files with 239 additions and 317 deletions
|
|
@ -0,0 +1,17 @@
|
|||
defmodule Pleroma.Repo.Migrations.CreateUserRelationships do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create_if_not_exists table(:user_relationships) do
|
||||
add(:source_id, references(:users, type: :uuid, on_delete: :delete_all))
|
||||
add(:target_id, references(:users, type: :uuid, on_delete: :delete_all))
|
||||
add(:relationship_type, :integer, null: false)
|
||||
|
||||
timestamps(updated_at: false)
|
||||
end
|
||||
|
||||
create_if_not_exists(
|
||||
unique_index(:user_relationships, [:source_id, :relationship_type, :target_id])
|
||||
)
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue