Added upload date index field to media_items
This commit is contained in:
parent
112c6a4f14
commit
0c71501e51
2 changed files with 13 additions and 0 deletions
|
|
@ -24,6 +24,7 @@ defmodule Pinchflat.Media.MediaItem do
|
||||||
:source_id,
|
:source_id,
|
||||||
:short_form_content,
|
:short_form_content,
|
||||||
:upload_date,
|
:upload_date,
|
||||||
|
:upload_date_index,
|
||||||
:duration_seconds,
|
:duration_seconds,
|
||||||
# these fields are captured only on download
|
# these fields are captured only on download
|
||||||
:media_downloaded_at,
|
:media_downloaded_at,
|
||||||
|
|
@ -66,6 +67,7 @@ defmodule Pinchflat.Media.MediaItem do
|
||||||
field :media_downloaded_at, :utc_datetime
|
field :media_downloaded_at, :utc_datetime
|
||||||
field :media_redownloaded_at, :utc_datetime
|
field :media_redownloaded_at, :utc_datetime
|
||||||
field :upload_date, :date
|
field :upload_date, :date
|
||||||
|
field :upload_date_index, :integer, default: 0
|
||||||
field :duration_seconds, :integer
|
field :duration_seconds, :integer
|
||||||
|
|
||||||
field :media_filepath, :string
|
field :media_filepath, :string
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
defmodule Pinchflat.Repo.Migrations.AddUploadDateIndexToMediaItems do
|
||||||
|
use Ecto.Migration
|
||||||
|
|
||||||
|
def change do
|
||||||
|
alter table(:media_items) do
|
||||||
|
add :upload_date_index, :integer, null: false, default: 0
|
||||||
|
end
|
||||||
|
|
||||||
|
create index("media_items", [:upload_date])
|
||||||
|
end
|
||||||
|
end
|
||||||
Loading…
Reference in a new issue