fix: use sql.NullTime for last_played to handle NULL scan
COALESCE(last_played, '') returned empty string which can't scan into time.Time. Removed COALESCE, use sql.NullTime instead. Format to string only when Valid.
This commit is contained in:
1 parent
b643aee5a3
commit
2db6e09aa3
3 files changed
+33
-21
No files matched your search
@@ -97,7 +97,7 @@ SELECT
|
||||
af.bitrate,
|
||||
af.file_size,
|
||||
af.play_count,
|
||||
COALESCE(af.last_played, '') AS last_played
|
||||
af.last_played
|
||||
FROM audio_files af
|
||||
JOIN recordings r ON af.recording_id = r.id
|
||||
JOIN artist_credit ac ON r.artist_credit_id = ac.id
|
||||
@@ -163,7 +163,7 @@ SELECT
|
||||
af.bitrate,
|
||||
af.file_size,
|
||||
af.play_count,
|
||||
COALESCE(af.last_played, '') AS last_played
|
||||
af.last_played
|
||||
FROM audio_files af
|
||||
JOIN recordings r ON af.recording_id = r.id
|
||||
JOIN artist_credit ac ON r.artist_credit_id = ac.id
|
||||
|
||||
Reference in new issue
Block a user