Skip to content

Commit

Permalink
Merge pull request #23 from epochtalk/pm-feats
Browse files Browse the repository at this point in the history
Pm feats
  • Loading branch information
akinsey authored May 11, 2020
2 parents f83b4b9 + 191f757 commit 1f11efa
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions priv/repo/migrations/20200421225634_pm_ignored.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
defmodule Epoch.Repo.Migrations.PmIgnored do
use Ecto.Migration
@schema_prefix "messages"
def change do
create table(:ignored, [prefix: @schema_prefix, primary_key: false]) do
add :user_id, references(:users, type: :uuid, on_delete: :delete_all, prefix: "public"), null: false
add :ignored_user_id, references(:users, type: :uuid, on_delete: :delete_all, prefix: "public"), null: false
add :created_at, :timestamp
end

alter table(:preferences, [prefix: "users"]) do
add :email_messages, :boolean, default: true
end

create index(:ignored, [:user_id], prefix: @schema_prefix)
create index(:ignored, [:ignored_user_id], prefix: @schema_prefix)
create unique_index(:ignored, [:user_id, :ignored_user_id], prefix: @schema_prefix)
end
end

0 comments on commit 1f11efa

Please sign in to comment.