Skip to content

Commit

Permalink
start with basic seeds creating users and some base resources
Browse files Browse the repository at this point in the history
  • Loading branch information
electronicbites committed Dec 21, 2023
1 parent a0ede33 commit 5bde5f0
Showing 1 changed file with 28 additions and 7 deletions.
35 changes: 28 additions & 7 deletions priv/repo/seeds.exs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,31 @@
#
# mix run priv/repo/seeds.exs
#
# Inside the script, you can read and write to any of your
# repositories directly:
#
# Radiator.Repo.insert!(%Radiator.SomeSchema{})
#
# We recommend using the bang functions (`insert!`, `update!`
# and so on) as they will fail if something goes wrong.
alias Radiator.{Accounts, Outline, Podcast}

{:ok, _user_bob} =
Accounts.register_user(%{email: "[email protected]", password: "supersupersecret"})

{:ok, _user_jim} =
Accounts.register_user(%{email: "[email protected]", password: "supersupersecret"})

{:ok, _node} =
Outline.create_node(%{content: "This is my first node"})

{:ok, _node} =
Outline.create_node(%{content: "Second node"})

{:ok, network} =
Podcast.create_network(%{title: "Podcast network"})

{:ok, _show} =
Podcast.create_show(%{title: "Dev Cafe", network_id: network.id})

{:ok, show} =
Podcast.create_show(%{title: "Tech Weekly", network_id: network.id})

{:ok, _episode} =
Podcast.create_episode(%{title: "past episode", show_id: show.id})

{:ok, _episode} =
Podcast.create_episode(%{title: "current episode", show_id: show.id})

0 comments on commit 5bde5f0

Please sign in to comment.