port over some more
This commit is contained in:
25
lib/odinsea/database/schema/inventory_log.ex
Normal file
25
lib/odinsea/database/schema/inventory_log.ex
Normal file
@@ -0,0 +1,25 @@
|
||||
defmodule Odinsea.Database.Schema.InventoryLog do
|
||||
@moduledoc """
|
||||
Ecto schema for the inventorylog table.
|
||||
Represents inventory transaction logs.
|
||||
"""
|
||||
|
||||
use Ecto.Schema
|
||||
import Ecto.Changeset
|
||||
|
||||
@primary_key {:inventorylogid, :id, autogenerate: true}
|
||||
|
||||
schema "inventorylog" do
|
||||
field :inventoryitemid, :integer, default: 0
|
||||
field :msg, :string
|
||||
end
|
||||
|
||||
@doc """
|
||||
Changeset for creating an inventory log entry.
|
||||
"""
|
||||
def changeset(inventory_log, attrs) do
|
||||
inventory_log
|
||||
|> cast(attrs, [:inventoryitemid, :msg])
|
||||
|> validate_required([:inventoryitemid, :msg])
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user