port over some more
This commit is contained in:
27
lib/odinsea/database/schema/reactor_drop.ex
Normal file
27
lib/odinsea/database/schema/reactor_drop.ex
Normal file
@@ -0,0 +1,27 @@
|
||||
defmodule Odinsea.Database.Schema.ReactorDrop do
|
||||
@moduledoc """
|
||||
Ecto schema for the reactordrops table.
|
||||
Represents reactor (map object) drop tables.
|
||||
"""
|
||||
|
||||
use Ecto.Schema
|
||||
import Ecto.Changeset
|
||||
|
||||
@primary_key {:reactordropid, :id, autogenerate: true}
|
||||
|
||||
schema "reactordrops" do
|
||||
field :reactorid, :integer
|
||||
field :itemid, :integer
|
||||
field :chance, :integer
|
||||
field :questid, :integer, default: -1
|
||||
end
|
||||
|
||||
@doc """
|
||||
Changeset for creating/updating a reactor drop.
|
||||
"""
|
||||
def changeset(reactor_drop, attrs) do
|
||||
reactor_drop
|
||||
|> cast(attrs, [:reactorid, :itemid, :chance, :questid])
|
||||
|> validate_required([:reactorid, :itemid, :chance])
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user