blob: 7bf604a1f25e1fb9b59337edce814b039ac344eb (
plain) (
tree)
|
|
defmodule MatrixAppService.Bridge.User do
use Ecto.Schema
import Ecto.Changeset
schema "users" do
field(:data, :map)
field(:local_id, :string)
field(:remote_id, :string)
timestamps()
end
@doc false
def changeset(user, attrs) do
user
|> cast(attrs, [:local_id, :remote_id, :data])
# |> validate_required([:local_id, :remote_id, :data])
|> unique_constraint(:local_id)
|> unique_constraint(:remote_id)
end
end
|