Skip to content

Commit

Permalink
fix seeds
Browse files Browse the repository at this point in the history
  • Loading branch information
sorax committed Nov 24, 2024
1 parent 45cc526 commit 8b62715
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions priv/repo/seeds.exs
Original file line number Diff line number Diff line change
Expand Up @@ -53,39 +53,48 @@ alias Radiator.Outline.NodeRepository
})

{:ok, node1} =
NodeRepository.create_node(%{"content" => "Node 1", "episode_id" => current_episode.id})
NodeRepository.create_node(%{
"content" => "Node 1",
"show_id" => current_episode.show_id,
"episode_id" => current_episode.id
})

{:ok, node2} =
NodeRepository.create_node(%{
"content" => "Node 2",
"show_id" => current_episode.show_id,
"episode_id" => current_episode.id,
"prev_id" => node1.uuid
})

{:ok, node3} =
NodeRepository.create_node(%{
"content" => "Node 3",
"show_id" => current_episode.show_id,
"episode_id" => current_episode.id,
"prev_id" => node2.uuid
})

{:ok, _node4} =
NodeRepository.create_node(%{
"content" => "Node 4",
"show_id" => current_episode.show_id,
"episode_id" => current_episode.id,
"prev_id" => node3.uuid
})

{:ok, node21} =
NodeRepository.create_node(%{
"content" => "Node 2.1",
"show_id" => current_episode.show_id,
"episode_id" => current_episode.id,
"parent_id" => node2.uuid
})

{:ok, _node22} =
NodeRepository.create_node(%{
"content" => "Node 2.2",
"show_id" => current_episode.show_id,
"episode_id" => current_episode.id,
"parent_id" => node2.uuid,
"prev_id" => node21.uuid
Expand All @@ -94,17 +103,23 @@ alias Radiator.Outline.NodeRepository
{:ok, node211} =
NodeRepository.create_node(%{
"content" => "Node 2.1.1",
"show_id" => current_episode.show_id,
"episode_id" => current_episode.id,
"parent_id" => node21.uuid
})

{:ok, _node212} =
NodeRepository.create_node(%{
"content" => "Node 2.1.2",
"show_id" => current_episode.show_id,
"episode_id" => current_episode.id,
"parent_id" => node21.uuid,
"prev_id" => node211.uuid
})

{:ok, _past_parent_node} =
NodeRepository.create_node(%{"content" => "Old Content", "episode_id" => past_episode.id})
NodeRepository.create_node(%{
"content" => "Old Content",
"show_id" => current_episode.show_id,
"episode_id" => past_episode.id
})

0 comments on commit 8b62715

Please sign in to comment.