live_beats/priv/repo/seeds.exs

29 lines
794 B
Elixir
Raw Normal View History

2021-09-02 18:00:57 +00:00
# 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.
2021-10-29 16:12:23 +00:00
2021-11-02 03:25:28 +00:00
# for title <- ~w(Chill Pop Hip-hop Electronic) do
# {:ok, _} = LiveBeats.MediaLibrary.create_genre(%{title: title})
2021-11-01 19:57:53 +00:00
# end
2021-11-02 03:25:28 +00:00
2021-11-05 19:57:33 +00:00
# for i <- 1..200 do
# filename = Ecto.UUID.generate()
# {:ok, _} =
# LiveBeats.Repo.insert(%LiveBeats.MediaLibrary.Song{
# artist: "Bonobo",
# title: "Black Sands #{i}",
# duration: 180_000,
# mp3_filename: filename,
# mp3_path: "uploads/songs/#{filename}"
# })
# end