defmodule Odinsea.Database.Schema.HyperrockLocation do @moduledoc """ Ecto schema for the hyperrocklocations table. Represents hyper teleport rock locations for characters. """ use Ecto.Schema import Ecto.Changeset @primary_key {:trockid, :id, autogenerate: true} schema "hyperrocklocations" do field :characterid, :integer field :mapid, :integer belongs_to :character, Odinsea.Database.Schema.Character, foreign_key: :characterid, references: :id, define_field: false end @doc """ Changeset for creating/updating a hyper teleport rock location. """ def changeset(hyperrock_location, attrs) do hyperrock_location |> cast(attrs, [:characterid, :mapid]) |> validate_required([:characterid, :mapid]) end end