chore(*.sql): use sql-formatter for sql formatting

This commit is contained in:
Cory Dransfeldt 2025-06-14 17:10:41 -07:00
parent 753f3433ce
commit a650f1d3e8
No known key found for this signature in database
63 changed files with 4432 additions and 2358 deletions

View file

@ -2,12 +2,22 @@ CREATE OR REPLACE VIEW optimized_concerts AS
SELECT
c.id,
c.date,
CASE WHEN c.artist IS NOT NULL THEN
json_build_object('name', a.name_string, 'url', a.slug)
ELSE
json_build_object('name', c.artist_name_string, 'url', NULL)
CASE
WHEN c.artist IS NOT NULL THEN json_build_object('name', a.name_string, 'url', a.slug)
ELSE json_build_object('name', c.artist_name_string, 'url', NULL)
END AS artist,
json_build_object('name', v.name, 'name_short', trim(split_part(v.name, ',', 1)), 'latitude', v.latitude, 'longitude', v.longitude, 'notes', v.notes) AS venue,
json_build_object(
'name',
v.name,
'name_short',
trim(split_part(v.name, ',', 1)),
'latitude',
v.latitude,
'longitude',
v.longitude,
'notes',
v.notes
) AS venue,
c.notes AS concert_notes
FROM
concerts c