Sweet, tested it? I'll add it after I've tested it
Yes i tested it
Sweet, tested it? I'll add it after I've tested it
Yes i tested it
Kool just tested it made a few fixes, thanks for that darkhaos credits added.
for i = #childAttributeTables -1, #childAttributeTables do
if config.deleteAccountWithNoPlayer then
text = ">> [DBCLEANUP] " .. DB_NOW.players .. " inactive players and " .. DB_NOW.accounts .. " empty accounts have been deleted from the database."
else
text = ">> [DBCLEANUP] " .. DB_NOW.players .. " inactive players have been deleted from the database."
end
text = ">> [DBCLEANUP] " .. DB_NOW.players .. " inactive players" .. (config.deleteAccountWithNoPlayer and " and " .. DB_NOW.accounts .. " empty accounts" or "") .. " have been deleted from the database."
Be careful with this
Accounts tables should be the last two on the config.
Can be shortened to
for i = #childAttributeTables -1, #childAttributeTables do
schema.mysql from 0.3.6pl1 said:FOREIGN KEY (`account_id`) REFERENCES `accounts`(`id`) ON DELETE CASCADE
that's not the point.Umm.. I don't know what database you use, but on default TFS 0.3.6 mysql database when you delete account from `accounts` it delete all characters from this account and all skills,items... of these characters.
Umm.. I don't know what database you use, but on default TFS 0.3.6 mysql database when you delete account from `accounts` it delete all characters from this account and all skills,items... of these characters.
[Error - GlobalEvent Interface]
data/globalevents/scripts/dbcleaner.lua:onStartup
Description:
data/globalevents/scripts/dbcleaner.lua:88: attempt to call field 'executeQuery'(a nil value)
stack traceback:
data/globalevents/scripts/dbcleaner.lua:88: in function <data/globalevents/scripts/dbcleaner.lua:22>
local childAttributeTables = {
players = {
[1] = {table = "`player_viplist`", idField = "`player_id`"},
[2] = {table = "`player_storage`", idField = "`player_id`"},
[3] = {table = "`player_spells`", idField = "`player_id`"},
[4] = {table = "`player_skills`", idField = "`player_id`"},
[5] = {table = "`player_namelocks`", idField = "`player_id`"},
[6] = {table = "`player_items`", idField = "`player_id`"},
[7] = {table = "`player_depotitems`", idField = "`player_id`"},
[8] = {table = "`players`", idField = "`id`"} -- Keep this as the last item in the array,
[9] = {table = "`houses`", idField = "`owner`"}
Correct?
local childAttributeTables = {
players = {
[1] = {table = "`player_viplist`", idField = "`player_id`"},
[2] = {table = "`player_storage`", idField = "`player_id`"},
[3] = {table = "`player_spells`", idField = "`player_id`"},
[4] = {table = "`player_skills`", idField = "`player_id`"},
[5] = {table = "`player_namelocks`", idField = "`player_id`"},
[6] = {table = "`player_items`", idField = "`player_id`"},
[7] = {table = "`player_depotitems`", idField = "`player_id`"},
[8] = {table = "`houses`", idField = "`owner`"},
[9] = {table = "`house_auctions`", idField = "`player_id`"},
[10] = {table = "`players`", idField = "`id`"} -- Keep this as the last item in the array
--Note: `houses` and `bans` are in the DB triggers for TFS so don't worry about them.
--Also I did not want to put killers, or deaths on here because that is historic data,
--do so at your ouwn risk.
},
accounts = {
[1] = {table = "`accounts`", idField = "`id`"},
[2] = {table = "`account_viplist`", idField = "`account_id`"}
}
}