This commit is contained in:
22
trunk/dist/sql/maintenance/20080213maintenance.sql
vendored
Normal file
22
trunk/dist/sql/maintenance/20080213maintenance.sql
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
-- These queries will cleanup your tables from an already
|
||||
-- fixed bug where a player that deleted a friend
|
||||
-- stood in the ex-friend contacts list.
|
||||
--
|
||||
-- If your L2J server setup was born after Core release 1711
|
||||
-- you won't need to run this script. Else you might want to
|
||||
-- run it just once. (Running it again shouldn't have any
|
||||
-- effect.)
|
||||
|
||||
CREATE TABLE tmp_friends(char_id INT, friend_id INT);
|
||||
|
||||
INSERT INTO tmp_friends
|
||||
(char_id, friend_id)
|
||||
SELECT CF1.char_id, CF1.friend_id FROM character_friends AS CF1 WHERE CF1.char_id NOT IN
|
||||
(SELECT CF2.friend_id FROM character_friends AS CF2 WHERE CF2.char_id = CF1.friend_id);
|
||||
|
||||
DELETE FROM character_friends using character_friends
|
||||
INNER JOIN tmp_friends AS TF
|
||||
ON character_friends.char_id = TF.char_id
|
||||
AND character_friends.friend_id = TF.friend_id;
|
||||
|
||||
DROP TABLE tmp_friends;
|
1
trunk/dist/sql/maintenance/20110831maintenance.sql
vendored
Normal file
1
trunk/dist/sql/maintenance/20110831maintenance.sql
vendored
Normal file
@@ -0,0 +1 @@
|
||||
UPDATE `characters` SET `createDate`=FROM_UNIXTIME(`createTime`/1000, '%Y-%m%-%d');
|
7
trunk/dist/sql/maintenance/20120428maintenance.sql
vendored
Normal file
7
trunk/dist/sql/maintenance/20120428maintenance.sql
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
UPDATE characters SET accesslevel = 8 WHERE accesslevel >= 127;
|
||||
UPDATE characters SET accesslevel = 7 WHERE accesslevel = 1;
|
||||
UPDATE characters SET accesslevel = 6 WHERE accesslevel = 2;
|
||||
UPDATE characters SET accesslevel = 5 WHERE accesslevel = 3;
|
||||
UPDATE characters SET accesslevel = 3 WHERE accesslevel = 5;
|
||||
UPDATE characters SET accesslevel = 2 WHERE accesslevel = 6;
|
||||
UPDATE characters SET accesslevel = 1 WHERE accesslevel = 7;
|
23
trunk/dist/sql/maintenance/documentation.txt
vendored
Normal file
23
trunk/dist/sql/maintenance/documentation.txt
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
There are SQL sequences that should not neccessarily be performed every time you
|
||||
update your database structure. Rather, these queries should be executed once or
|
||||
from time to time. Essentially, an .sql file should appear under 'maintenance'
|
||||
instead of the old 'updates' folder provided that:
|
||||
|
||||
- Its execution isn't mandatory to keep L2J setups working past any core revision
|
||||
number. (e.g. orphans cleanup)
|
||||
|
||||
- Its execution were time consuming and could slowdown regular database update tasks.
|
||||
(e.g. complex sub/queries, joins)
|
||||
|
||||
- Its execution could allow administrators to perform optimization, maintenance,
|
||||
repair or recovery tasks whenever they needed to.
|
||||
|
||||
Any SQL maintenance should be named like that:
|
||||
|
||||
YYYYMMDDmaintenance.sql
|
||||
|
||||
See the updates directory documentation for further details of the naming convention.
|
||||
|
||||
Additionally, it would be desirable that any maintenance script could hold internal
|
||||
documentation describing their specific purpose, execution scenario and any other
|
||||
information that could be of interest for the administrator.
|
Reference in New Issue
Block a user