Skip to content

Instantly share code, notes, and snippets.

@jasmo2
Created August 4, 2020 23:51
Show Gist options
  • Save jasmo2/6e664166e3d9f18c133c67d0ee1684c8 to your computer and use it in GitHub Desktop.
Save jasmo2/6e664166e3d9f18c133c67d0ee1684c8 to your computer and use it in GitHub Desktop.
alter table(:qa_job) do
add :body, :jsonb
add :input, :jsonb
add :output, :jsonb
end
schema "qa_job" do
belongs_to :media, Media
field :priority, :integer, default: 10
field :status, Types.JobStatusType
embeds_one :input, QAJob.Input
embeds_one :body, QAJob.Body
embeds_one :output, QAJob.Output, on_replace: :update
timestamps type: :utc_datetime_usec
end
defmodule QAJob.Input do
embedded_schema do
field :meta, AtomJson
field :pivot_media_url, :string
field :inspections, {:array, AtomJson}
field :accumulated_feature_flags
end
end
defmodule QAJob.Body do
embedded_schema do
field :pivot_media_url, :string
embeds_many :inspections, Inspection
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment