init commit
This commit is contained in:
18
lib/here_i_am/devices/device.ex
Normal file
18
lib/here_i_am/devices/device.ex
Normal file
@@ -0,0 +1,18 @@
|
||||
defmodule HereIAm.Devices.Device do
|
||||
use Ecto.Schema
|
||||
import Ecto.Changeset
|
||||
|
||||
schema "devices" do
|
||||
field :ip_address, :string
|
||||
field :audio, :string
|
||||
|
||||
timestamps(type: :utc_datetime)
|
||||
end
|
||||
|
||||
@doc false
|
||||
def changeset(device, attrs) do
|
||||
device
|
||||
|> cast(attrs, [:ip_address, :audio])
|
||||
|> validate_required([:ip_address, :audio])
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user