19 lines
451 B
Elixir
19 lines
451 B
Elixir
|
defmodule DrainCloudCore.Auth.Users do
|
||
|
use Ecto.Schema
|
||
|
import Ecto.Changeset
|
||
|
|
||
|
schema "users" do
|
||
|
field :login, :string
|
||
|
field :passwoed, :string, redact: true
|
||
|
field :crated_at, :utc_datetime
|
||
|
field :updated_at, :utc_datetime
|
||
|
field :deleted_at, :utc_datetime
|
||
|
end
|
||
|
|
||
|
def changeset(user, params \\ %{}) do
|
||
|
user
|
||
|
|> cast(params, [:id, :login, :password, :updated_at, :deleted_at])
|
||
|
|> validate_required([:id])
|
||
|
end
|
||
|
end
|