mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-11 16:51:29 +00:00
Make sure character soft deletes do not reserve name once deleted, add optional retro script to run for servers who had soft deletes running prior to this commit
This commit is contained in:
parent
c6ba29f2e5
commit
c82d08cf11
@ -371,6 +371,7 @@ bool Database::DeleteCharacter(char *character_name) {
|
||||
UPDATE
|
||||
character_data
|
||||
SET
|
||||
name = SUBSTRING(CONCAT(name, '-deleted-', UNIX_TIMESTAMP()), 1, 64),
|
||||
deleted_at = NOW()
|
||||
WHERE
|
||||
id = '{}'
|
||||
|
||||
12
utils/sql/git/optional/2020_01_26_soft_delete_retro.sql
Normal file
12
utils/sql/git/optional/2020_01_26_soft_delete_retro.sql
Normal file
@ -0,0 +1,12 @@
|
||||
-- Run this to un-reserve deleted characters
|
||||
UPDATE
|
||||
character_data
|
||||
SET
|
||||
name = SUBSTRING(
|
||||
CONCAT(name, '-deleted-', UNIX_TIMESTAMP()),
|
||||
1,
|
||||
64
|
||||
)
|
||||
WHERE
|
||||
deleted_at IS NOT NULL
|
||||
AND name NOT LIKE '%-deleted-%';
|
||||
Loading…
x
Reference in New Issue
Block a user