sharedferret/Sparkle-Turntable-Bot — comment on commit 2c4f900312f44bfce9040acdca7ab74f0c284e64
File:  line 0
By sharedferret:

This sequence of SQL queries will migrate your data to the new table layout.

INSERT INTO USERS (id, name, lastseen) SELECT djid, djname, started FROM SONGLIST ORDER BY started asc ON DUPLICATE KEY UPDATE lastseen = SONGLIST.started;

INSERT INTO USERS (id, name, lastseen) SELECT djid, djname, started FROM CHATLOG ORDER BY started asc ON DUPLICATE KEY UPDATE lastseen = SONGLIST.started;

ALTER TABLE SONGLIST DROP COLUMN djname;

ALTER TABLE CHATLOG DROP COLUMN user;