summaryrefslogtreecommitdiff
path: root/priv
diff options
context:
space:
mode:
authormarcin mikołajczak <git@mkljczk.pl>2021-11-21 16:53:30 +0100
committermarcin mikołajczak <git@mkljczk.pl>2021-11-21 16:56:26 +0100
commit40414bf177c93b39d75c6091ef0ce1db093edb6f (patch)
tree449c02c847c2385387dc0ee1d1fc58520d6716b1 /priv
parentc97f99ccf2a51c7f1078d7a20006deae2df3d12c (diff)
MastoAPI: Add user notes on accounts
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
Diffstat (limited to 'priv')
-rw-r--r--priv/repo/migrations/20211121000000_create_user_notes.exs17
1 files changed, 17 insertions, 0 deletions
diff --git a/priv/repo/migrations/20211121000000_create_user_notes.exs b/priv/repo/migrations/20211121000000_create_user_notes.exs
new file mode 100644
index 000000000..8fc23749f
--- /dev/null
+++ b/priv/repo/migrations/20211121000000_create_user_notes.exs
@@ -0,0 +1,17 @@
+defmodule Pleroma.Repo.Migrations.CreateUserNotes do
+ use Ecto.Migration
+
+ def change do
+ create_if_not_exists table(:user_notes) do
+ add(:source_id, references(:users, type: :uuid, on_delete: :delete_all))
+ add(:target_id, references(:users, type: :uuid, on_delete: :delete_all))
+ add(:comment, :string)
+
+ timestamps()
+ end
+
+ create_if_not_exists(
+ unique_index(:user_notes, [:source_id, :target_id])
+ )
+ end
+end