Add membership table

This commit is contained in:
Pim Kunis 2021-09-08 12:03:41 +02:00
parent a682f1c7ad
commit 46b4199618
4 changed files with 63 additions and 6 deletions

View file

@ -0,0 +1,18 @@
defmodule Architex.Membership do
use Ecto.Schema
alias Architex.{Account, Room}
@type t :: %__MODULE__{
account_id: integer(),
room_id: String.t(),
membership: String.t()
}
@primary_key false
schema "membership" do
belongs_to :account, Account, primary_key: true
belongs_to :room, Room, primary_key: true, type: :string
field :membership, :string
end
end