CharDB Schema/Cleanup: cleanup channels table:

* rename columns (remove m_ prefix and convert to lowerCamel case);
* rename prepared statements to conform to standards (there is no CLEAN statement).
This commit is contained in:
Azazel committed 2011-03-11 17:18:17 +06:00
1 parent 20b44e82d5
commit 3973d1b454
6 files changed
+33 -18

No files matched your search

+8 -2
View File
@@ -4431,14 +4431,20 @@ bool ChatHandler::HandleChannelSetOwnership(const char *args)
{
if(chn)
chn->SetOwnership(true);
CharacterDatabase.PExecute("UPDATE channels SET m_ownership = 1 WHERE m_name LIKE '%s'", channel);
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_CHANNEL_OWNERSHIP);
stmt->setUInt8 (0, 1);
stmt->setString(1, channel);
CharacterDatabase.Execute(stmt);
PSendSysMessage(LANG_CHANNEL_ENABLE_OWNERSHIP, channel);
}
else if (strcmp(argstr, "off") == 0)
{
if(chn)
chn->SetOwnership(false);
CharacterDatabase.PExecute("UPDATE channels SET m_ownership = 0 WHERE m_name LIKE '%s'", channel);
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SET_CHANNEL_OWNERSHIP);
stmt->setUInt8 (0, 0);
stmt->setString(1, channel);
CharacterDatabase.Execute(stmt);
PSendSysMessage(LANG_CHANNEL_DISABLE_OWNERSHIP, channel);
}
else