live_beats/priv/repo/seeds.exs
2021-11-01 23:25:28 -04:00

24 lines
647 B
Elixir

# Script for populating the database. You can run it as:
#
# mix run priv/repo/seeds.exs
#
# Inside the script, you can read and write to any of your
# repositories directly:
#
# LiveBeats.Repo.insert!(%LiveBeats.SomeSchema{})
#
# We recommend using the bang functions (`insert!`, `update!`
# and so on) as they will fail if something goes wrong.
# for title <- ~w(Chill Pop Hip-hop Electronic) do
# {:ok, _} = LiveBeats.MediaLibrary.create_genre(%{title: title})
# end
for i <- 1..20 do
{:ok, _} =
LiveBeats.MediaLibrary.create_song(%{
artist: "Bonobo",
title: "Black Sands #{i}",
duration: 180_000
})
end