superbasic question -- changing a user's username [RESOLVED]
It seems implausible, but a search of the Help forum turned up zero posts/threads about what I would assume would be a fairly common task: changing a user's username once he/she has already been added. LOTS of questions about the admin/admin un/pw combo and about migrating users and database from install to install, but nothing about simply changing someone's name.
How exactly is this done? I've tried interacting directly with the database itself (via "db.view"), and issuing "update TABLENAME set username='newusername' where username='oldusername' " statements.... but I'm getting lots of foreign key errors when I try to do this. Trying to update the username in the USER table, it gripes about a FK in the USER_ROLE table.... but I get similar error when I try to update USER_ROLE too. Ditto for tables like Playlist, Custom_Avatar, etc -- key constraints preclude changing the username. Nor does there seem to be a way via SS's main interface itself. I try going to Settings, and then choosing a user from the dropdown..... but all I can change is the user's password, or delete the user entirely.
To answer what I'm anticipating to be a common response/question ("why don't you just delete the user and create a new one?")........... I don't want to do that because I'd like to preserve the user's info (Star ratings, reviews/comments, upload and download totals, etc.). Deleting and recreating loses all that information entirely. Plus, I don't want to have to ask the user for his/her password when recreating the account (or asking them to redo it themselves).
Renaming a user should be a simple process by the admin that should be transparent to the end user. And, I admit... it's somewhat surprising that there is not a central "User" table that contains ONLY user_id and username fields, with all other subsonic tables utilising the user_id, rather than the username itself. This is rather RDBMS/Normalisation 101 stuff, IMHO...
Anyone have any ideas?
Thanks,
Supra92
How exactly is this done? I've tried interacting directly with the database itself (via "db.view"), and issuing "update TABLENAME set username='newusername' where username='oldusername' " statements.... but I'm getting lots of foreign key errors when I try to do this. Trying to update the username in the USER table, it gripes about a FK in the USER_ROLE table.... but I get similar error when I try to update USER_ROLE too. Ditto for tables like Playlist, Custom_Avatar, etc -- key constraints preclude changing the username. Nor does there seem to be a way via SS's main interface itself. I try going to Settings, and then choosing a user from the dropdown..... but all I can change is the user's password, or delete the user entirely.
To answer what I'm anticipating to be a common response/question ("why don't you just delete the user and create a new one?")........... I don't want to do that because I'd like to preserve the user's info (Star ratings, reviews/comments, upload and download totals, etc.). Deleting and recreating loses all that information entirely. Plus, I don't want to have to ask the user for his/her password when recreating the account (or asking them to redo it themselves).
Renaming a user should be a simple process by the admin that should be transparent to the end user. And, I admit... it's somewhat surprising that there is not a central "User" table that contains ONLY user_id and username fields, with all other subsonic tables utilising the user_id, rather than the username itself. This is rather RDBMS/Normalisation 101 stuff, IMHO...
Anyone have any ideas?
Thanks,
Supra92