Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MBS-13832: Don't skip PDF files for frontiest check #3417

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion admin/sql/caa/CreateViews.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ SELECT cover_art.*,
JOIN cover_art_archive.cover_art ca_front USING (id)
WHERE ca_front.release = cover_art.release
AND type_id = 1
AND mime_type != 'application/pdf'
ORDER BY ca_front.ordering
LIMIT 1), FALSE) AS is_front,
coalesce(cover_art.id = (SELECT id FROM cover_art_archive.cover_art_type
Expand Down
1 change: 0 additions & 1 deletion admin/sql/eaa/CreateViews.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ SELECT event_art.*,
JOIN event_art_archive.event_art ea_front USING (id)
WHERE ea_front.event = event_art.event
AND type_id = 1
AND mime_type != 'application/pdf'
ORDER BY ea_front.ordering
LIMIT 1), FALSE) AS is_front,
array(SELECT art_type.name
Expand Down
46 changes: 46 additions & 0 deletions admin/sql/updates/20241125-mbs-13832.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
\set ON_ERROR_STOP 1

BEGIN;

-- CAA view
CREATE OR REPLACE VIEW index_listing AS
SELECT cover_art.*,
(edit.close_time IS NOT NULL) AS approved,
coalesce(cover_art.id = (SELECT id FROM cover_art_archive.cover_art_type
JOIN cover_art_archive.cover_art ca_front USING (id)
WHERE ca_front.release = cover_art.release
AND type_id = 1
ORDER BY ca_front.ordering
LIMIT 1), FALSE) AS is_front,
coalesce(cover_art.id = (SELECT id FROM cover_art_archive.cover_art_type
JOIN cover_art_archive.cover_art ca_front USING (id)
WHERE ca_front.release = cover_art.release
AND type_id = 2
ORDER BY ca_front.ordering
LIMIT 1), FALSE) AS is_back,
array(SELECT art_type.name
FROM cover_art_archive.cover_art_type
JOIN cover_art_archive.art_type ON cover_art_type.type_id = art_type.id
WHERE cover_art_type.id = cover_art.id) AS types
FROM cover_art_archive.cover_art
LEFT JOIN musicbrainz.edit ON edit.id = cover_art.edit;

-- EAA view
CREATE OR REPLACE VIEW index_listing AS
SELECT event_art.*,
(edit.close_time IS NOT NULL) AS approved,
coalesce(event_art.id = (SELECT id FROM event_art_archive.event_art_type
JOIN event_art_archive.event_art ea_front USING (id)
WHERE ea_front.event = event_art.event
AND type_id = 1
ORDER BY ea_front.ordering
LIMIT 1), FALSE) AS is_front,
array(SELECT art_type.name
FROM event_art_archive.event_art_type
JOIN event_art_archive.art_type ON event_art_type.type_id = art_type.id
WHERE event_art_type.id = event_art.id) AS types
FROM event_art_archive.event_art
LEFT JOIN musicbrainz.edit ON edit.id = event_art.edit;


COMMIT;
52 changes: 52 additions & 0 deletions admin/sql/updates/schema-change/30.all.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
-- Generated by CompileSchemaScripts.pl from:
-- 20241125-mbs-13832.sql
\set ON_ERROR_STOP 1
BEGIN;
SET search_path = musicbrainz, public;
SET LOCAL statement_timeout = 0;
--------------------------------------------------------------------------------
SELECT '20241125-mbs-13832.sql';


-- CAA view
CREATE OR REPLACE VIEW index_listing AS
SELECT cover_art.*,
(edit.close_time IS NOT NULL) AS approved,
coalesce(cover_art.id = (SELECT id FROM cover_art_archive.cover_art_type
JOIN cover_art_archive.cover_art ca_front USING (id)
WHERE ca_front.release = cover_art.release
AND type_id = 1
ORDER BY ca_front.ordering
LIMIT 1), FALSE) AS is_front,
coalesce(cover_art.id = (SELECT id FROM cover_art_archive.cover_art_type
JOIN cover_art_archive.cover_art ca_front USING (id)
WHERE ca_front.release = cover_art.release
AND type_id = 2
ORDER BY ca_front.ordering
LIMIT 1), FALSE) AS is_back,
array(SELECT art_type.name
FROM cover_art_archive.cover_art_type
JOIN cover_art_archive.art_type ON cover_art_type.type_id = art_type.id
WHERE cover_art_type.id = cover_art.id) AS types
FROM cover_art_archive.cover_art
LEFT JOIN musicbrainz.edit ON edit.id = cover_art.edit;

-- EAA view
CREATE OR REPLACE VIEW index_listing AS
SELECT event_art.*,
(edit.close_time IS NOT NULL) AS approved,
coalesce(event_art.id = (SELECT id FROM event_art_archive.event_art_type
JOIN event_art_archive.event_art ea_front USING (id)
WHERE ea_front.event = event_art.event
AND type_id = 1
ORDER BY ea_front.ordering
LIMIT 1), FALSE) AS is_front,
array(SELECT art_type.name
FROM event_art_archive.event_art_type
JOIN event_art_archive.art_type ON event_art_type.type_id = art_type.id
WHERE event_art_type.id = event_art.id) AS types
FROM event_art_archive.event_art
LEFT JOIN musicbrainz.edit ON edit.id = event_art.edit;


COMMIT;
5 changes: 5 additions & 0 deletions upgrade.json
Original file line number Diff line number Diff line change
Expand Up @@ -230,5 +230,10 @@
"20240223-mbs-13421-fks.sql",
"20240319-mbs-13514.sql"
]
},
"30": {
"all": [
"20241125-mbs-13832.sql"
]
}
}