diff options
author | Alex S <alex.strizhakov@gmail.com> | 2019-04-14 19:45:56 +0700 |
---|---|---|
committer | Alex S <alex.strizhakov@gmail.com> | 2019-04-25 13:38:24 +0700 |
commit | 73d01857e3ff1737a4ea733a3f6c6419379ce8e8 (patch) | |
tree | 0330ba6351c22bc3810591c82c2d715e3143dc4b /priv/repo/migrations/20190413082658_create_bookmarks.exs | |
parent | 030a7876b42a0c925fd52474de514ae5e9171e55 (diff) | |
download | pleroma-73d01857e3ff1737a4ea733a3f6c6419379ce8e8.tar.gz pleroma-73d01857e3ff1737a4ea733a3f6c6419379ce8e8.zip |
bookmarks in separate table
Diffstat (limited to 'priv/repo/migrations/20190413082658_create_bookmarks.exs')
-rw-r--r-- | priv/repo/migrations/20190413082658_create_bookmarks.exs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/priv/repo/migrations/20190413082658_create_bookmarks.exs b/priv/repo/migrations/20190413082658_create_bookmarks.exs new file mode 100644 index 000000000..38b108158 --- /dev/null +++ b/priv/repo/migrations/20190413082658_create_bookmarks.exs @@ -0,0 +1,14 @@ +defmodule Pleroma.Repo.Migrations.CreateBookmarks do + use Ecto.Migration + + def change do + create table(:bookmarks) do + add(:user_id, references(:users, type: :uuid, on_delete: :delete_all)) + add(:activity_id, references(:activities, type: :uuid, on_delete: :delete_all)) + + timestamps() + end + + create(unique_index(:bookmarks, [:user_id, :activity_id])) + end +end |