defmodule Chklst.Accounts.UserOrg do
  use Ecto.Schema
  import Ecto.Changeset

  @primary_key false
  @foreign_key_type :binary_id
  schema "users_orgs" do
    belongs_to :user, Chklst.Accounts.User
    belongs_to :org, Chklst.Accounts.Org

    timestamps(type: :utc_datetime)
  end

  @doc false
  def changeset(user_org, attrs) do
    user_org
    |> cast(attrs, [])
    |> validate_required([])
  end
end