30 lines
697 B
Elixir
30 lines
697 B
Elixir
defmodule Bright.Streams.Vod do
|
|
use Ecto.Schema
|
|
import Ecto.Changeset
|
|
|
|
schema "vods" do
|
|
field :s3_cdn_url, :string
|
|
field :s3_upload_id, :string
|
|
field :s3_key, :string
|
|
field :s3_bucket, :string
|
|
field :mux_asset_id, :string
|
|
field :mux_playback_id, :string
|
|
field :ipfs_cid, :string
|
|
field :torrent, :string
|
|
field :notes, :string
|
|
|
|
belongs_to :stream, Bright.Streams.Stream
|
|
|
|
timestamps(type: :utc_datetime)
|
|
end
|
|
|
|
@doc false
|
|
def changeset(vod, attrs) do
|
|
vod
|
|
|> cast(attrs, [:s3_cdn_url, :s3_upload_id, :s3_key, :s3_bucket, :mux_asset_id, :mux_playback_id, :ipfs_cid, :torrent, :stream_id])
|
|
|> validate_required([:stream_id])
|
|
end
|
|
|
|
|
|
end
|