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