Current section
Files
Jump to
Current section
Files
lib/arke_postgres/tables/arke_unit.ex
defmodule ArkePostgres.Tables.ArkeUnit do
use Ecto.Schema
import Ecto.Changeset
@arke_record_fields ~w[id arke_id data configuration]a
@timestamps ~w[inserted_at updated_at]a
@primary_key {:id, :string, []}
schema "arke_unit" do
field(:arke_id, :string)
field(:data, :map)
field(:configuration, :map, default: %{})
timestamps()
end
def changeset(args \\ []) do
%__MODULE__{}
|> cast(args, @arke_record_fields)
|> validate_required(@arke_record_fields)
end
end