defmodule Cake.Accounts.User do use Ecto.Schema import Ecto.Changeset schema "users" do field :email, :string field :id, Ecto.UUID field :user_name, :string field :role, :id timestamps() end @doc false def changeset(user, attrs) do user |> cast(attrs, [:id, :user_name, :email]) |> validate_required([:id, :user_name, :email]) end end