20 lines
353 B
Elixir
20 lines
353 B
Elixir
defmodule Charbase.Changelog do
|
|
use Ecto.Schema
|
|
import Ecto.Changeset
|
|
|
|
schema "changelog" do
|
|
field :text, :string
|
|
field :type, :string
|
|
field :character_id, :id
|
|
|
|
timestamps()
|
|
end
|
|
|
|
@doc false
|
|
def changeset(changelog, attrs) do
|
|
changelog
|
|
|> cast(attrs, [:type, :text])
|
|
|> validate_required([:type, :text])
|
|
end
|
|
end
|