Fix warning

This commit is contained in:
Shadowfacts 2019-11-08 22:33:24 -05:00
parent 0d0c749b68
commit e5ea6b3e1b
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
1 changed files with 46 additions and 48 deletions

View File

@ -4,7 +4,6 @@ defmodule Frenzy.Repo.Migrations.FeedsConvertPipelineStagesToPipelines do
import Ecto.Query
def up do
pipeline_entries =
Repo.all(
from(stage in "pipeline_stages",
join: feed in "feeds",
@ -50,8 +49,7 @@ defmodule Frenzy.Repo.Migrations.FeedsConvertPipelineStagesToPipelines do
]}
end)
|> Enum.each(fn {feed_id, pipeline_entry} ->
{_, [%{id: pipeline_id}]} =
Repo.insert_all("pipelines", [pipeline_entry], returning: [:id])
{_, [%{id: pipeline_id}]} = Repo.insert_all("pipelines", [pipeline_entry], returning: [:id])
feed_query = from(f in "feeds", where: f.id == ^feed_id)
Repo.update_all(feed_query, set: [pipeline_id: pipeline_id])