19 lines
452 B
Elixir
19 lines
452 B
Elixir
defmodule DrainCloudCore.Auth.Users do
|
|
use Ecto.Schema
|
|
import Ecto.Changeset
|
|
|
|
schema "users" do
|
|
field :login, :string
|
|
field :password, :string, redact: true
|
|
field :created_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
|