add steps

This commit is contained in:
2022-07-25 20:18:39 -04:00
parent 0fca0ead12
commit 8b5806116a
5 changed files with 228 additions and 0 deletions

22
lib/memex/steps/step.ex Normal file
View File

@ -0,0 +1,22 @@
defmodule Memex.Steps.Step do
use Ecto.Schema
import Ecto.Changeset
@primary_key {:id, :binary_id, autogenerate: true}
@foreign_key_type :binary_id
schema "steps" do
field :description, :string
field :position, :integer
field :title, :string
field :pipeline_id, :binary_id
timestamps()
end
@doc false
def changeset(step, attrs) do
step
|> cast(attrs, [:title, :description, :position])
|> validate_required([:title, :description, :position])
end
end