defmodule DaProductApp.Activity.CustomEventLog do use Ecto.Schema import Ecto.Changeset schema "custom_event_log" do field :transaction_id, :integer field :event_name, :string field :event_value, :string field :device_id, :string field :date_added, :utc_datetime field :event_id, :integer field :payload, :map field :refrence_id, :string # Make sure this line exists timestamps() end def changeset(custom_event_log, attrs) do custom_event_log |> cast(attrs, [:transaction_id, :event_name, :event_value, :device_id, :date_added, :event_id, :payload, :refrence_id]) |> validate_required([:event_name, :event_value, :date_added, :event_id]) end end