robalb / morsechat

an online morse code chat
http://morse.halb.it/
GNU General Public License v3.0
62 stars 4 forks source link

update old settings in database #42

Closed robalb closed 2 years ago

robalb commented 2 years ago

updating the json schema was a bad idea, now every user setting must be updated to reflect the schema changes

update users set settings = ( SELECT JSON_REPLACE((select settings from users where username='BROKEN'), '$.keybinds', (select JSON_EXTRACT((select settings from users where username="WORKING"), '$.keybinds') as newkey) ) as new) where username='BROKEN';