Add infrastructure to persist scrobble tracks to database
Unused for now.
This commit is contained in:
@@ -20,11 +20,11 @@ defmodule LastFm.Track do
|
|||||||
last_fm_data: map()
|
last_fm_data: map()
|
||||||
}
|
}
|
||||||
|
|
||||||
embedded_schema do
|
@primary_key {:scrobbled_at_uts, :integer, autogenerate: false}
|
||||||
|
schema "scrobbled_tracks" do
|
||||||
field :musicbrainz_id, :string
|
field :musicbrainz_id, :string
|
||||||
field :title, :string
|
field :title, :string
|
||||||
field :cover_url, :string
|
field :cover_url, :string
|
||||||
field :scrobbled_at_uts, :integer
|
|
||||||
field :scrobbled_at_label, :string
|
field :scrobbled_at_label, :string
|
||||||
|
|
||||||
embeds_one :artist, Artist
|
embeds_one :artist, Artist
|
||||||
|
|||||||
@@ -0,0 +1,16 @@
|
|||||||
|
defmodule MusicLibrary.Repo.Migrations.CreateScrobbledTracks do
|
||||||
|
use Ecto.Migration
|
||||||
|
|
||||||
|
def change do
|
||||||
|
create table(:scrobbled_tracks, primary_key: false) do
|
||||||
|
add :scrobbled_at_uts, :integer, primary_key: true
|
||||||
|
add :musicbrainz_id, :string
|
||||||
|
add :title, :string
|
||||||
|
add :cover_url, :string
|
||||||
|
add :scrobbled_at_label, :string
|
||||||
|
add :artist, :map
|
||||||
|
add :album, :map
|
||||||
|
add :last_fm_data, :map
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user