[Enhancement] Improve handling of large media collections (#272)
* Added compound index for updated media item table for performance * Improved large number display on homepage * Improved UI around large numbers * Centered the content of homepage data cards * Renamed migration
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 448 KiB After Width: | Height: | Size: 471 KiB |
@@ -0,0 +1,8 @@
|
||||
defmodule Pinchflat.Repo.Migrations.ModifyUploadDateIndex do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
drop index("media_items", [:upload_date])
|
||||
create index("media_items", [:uploaded_at])
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,19 @@
|
||||
defmodule Pinchflat.Repo.Migrations.AddIndexesForLargeCollections do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create index(
|
||||
"media_items",
|
||||
[
|
||||
:source_id,
|
||||
:media_filepath,
|
||||
:uploaded_at,
|
||||
:prevent_download,
|
||||
:livestream,
|
||||
:short_form_content,
|
||||
:title
|
||||
],
|
||||
name: "media_items_pending_and_downloaded_index"
|
||||
)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user