mirror of
https://github.com/ClaperCo/Claper.git
synced 2026-09-02 03:59:46 +02:00
21 lines
410 B
Elixir
21 lines
410 B
Elixir
defmodule Claper.Settings.GlobalConfig do
|
|
use Ecto.Schema
|
|
import Ecto.Changeset
|
|
|
|
schema "global_configs" do
|
|
field :key, :string
|
|
field :value, :string
|
|
field :encrypted_value, :binary
|
|
|
|
timestamps()
|
|
end
|
|
|
|
@doc false
|
|
def changeset(config, attrs) do
|
|
config
|
|
|> cast(attrs, [:key, :value, :encrypted_value])
|
|
|> validate_required([:key])
|
|
|> unique_constraint(:key)
|
|
end
|
|
end
|