Current section
Files
Jump to
Current section
Files
lib/arke_postgres/tables/arke_schema.ex
defmodule ArkePostgres.Tables.ArkeSchema do
use Ecto.Schema
import Ecto.Changeset
@arke_schema_fields ~w[id label configuration active]a
@timestamps ~w[inserted_at updated_at]a
@primary_key {:id, :string, []}
schema "arke_schema" do
field(:label, :string)
field(:configuration, :map, default: %{})
field(:active, :boolean, default: true)
field(:type, :string, default: "arke")
timestamps()
end
def changeset(args \\ []) do
%__MODULE__{}
|> cast(args, @arke_schema_fields)
|> validate_required(@arke_schema_fields)
end
end