1
0
mirror of https://github.com/spl0k/supysonic.git synced 2024-09-20 03:11:04 +00:00
supysonic/schema/migration/20171022.postgresql.sql
spl0k 4eb7386c99 Playlists improvements
They don't mess up the the track order anymore
A same track can now be added more than once to a playlist

Closes #61
2017-10-22 22:05:17 +02:00

12 lines
232 B
SQL

START TRANSACTION;
ALTER TABLE playlist ADD tracks TEXT;
UPDATE playlist SET tracks = (
SELECT array_to_string(array_agg(track_id), ',')
FROM playlist_track
WHERE playlist_id = playlist.id);
DROP TABLE playlist_track;
COMMIT;