port over some more
This commit is contained in:
26
lib/odinsea/database/schema/ip_log.ex
Normal file
26
lib/odinsea/database/schema/ip_log.ex
Normal file
@@ -0,0 +1,26 @@
|
||||
defmodule Odinsea.Database.Schema.IpLog do
|
||||
@moduledoc """
|
||||
Ecto schema for the iplog table.
|
||||
Represents IP address login logs.
|
||||
"""
|
||||
|
||||
use Ecto.Schema
|
||||
import Ecto.Changeset
|
||||
|
||||
@primary_key {:id, :id, autogenerate: true}
|
||||
|
||||
schema "iplog" do
|
||||
field :accid, :integer
|
||||
field :ip, :string
|
||||
field :time, :string
|
||||
end
|
||||
|
||||
@doc """
|
||||
Changeset for creating an IP log entry.
|
||||
"""
|
||||
def changeset(ip_log, attrs) do
|
||||
ip_log
|
||||
|> cast(attrs, [:accid, :ip, :time])
|
||||
|> validate_required([:accid, :ip])
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user