summaryrefslogtreecommitdiff
path: root/sql-files/upgrade_817.sql
blob: 3052543883cf80ea9d6aa739febfda13938bee35 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Upgrade database for version 817 to 0.5.2

#DROP TABLE `charlog`;
#DROP TABLE `interlog`;
#DROP TABLE `guild_storage`;

ALTER TABLE `global_reg_value` DROP COLUMN `type`;
ALTER TABLE `global_reg_value` DROP COLUMN `account_id`;

# --------------------------------------------------------------
# Fix the bug that some fields cannot exceed 127
ALTER TABLE `char` MODIFY `str` int(11) unsigned NOT NULL;
ALTER TABLE `char` MODIFY `agi` int(11) unsigned NOT NULL;
ALTER TABLE `char` MODIFY `vit` int(11) unsigned NOT NULL;
ALTER TABLE `char` MODIFY `int` int(11) unsigned NOT NULL;
ALTER TABLE `char` MODIFY `dex` int(11) unsigned NOT NULL;
ALTER TABLE `char` MODIFY `luk` int(11) unsigned NOT NULL;
ALTER TABLE `char` MODIFY `base_level` int(11) unsigned NOT NULL default '1';
ALTER TABLE `char` MODIFY `job_level` int(11) unsigned NOT NULL default '1';

# --------------------------------------------------------------------
# Bug fix : wrong index
ALTER TABLE `storage` DROP INDEX `char_id`, ADD INDEX (`account_id`);

# ----------------------------------------------------------------
# Add log tables


# Table: `charlog`
#
CREATE TABLE `charlog` (
  `time` datetime NOT NULL default '0000-00-00 00:00:00',
  `char_msg` varchar(255) NOT NULL default 'char select',
  `account_id` int(11) NOT NULL default '0',
  `char_num` tinyint(4) NOT NULL default '0',
  `name` varchar(255) NOT NULL default '',
  `str` int(11) unsigned NOT NULL default '0',
  `agi` int(11) unsigned NOT NULL default '0',
  `vit` int(11) unsigned NOT NULL default '0',
  `int` int(11) unsigned NOT NULL default '0',
  `dex` int(11) unsigned NOT NULL default '0',
  `luk` int(11) unsigned NOT NULL default '0',
  `hair` tinyint(4) NOT NULL default '0',
  `hair_color` int(11) NOT NULL default '0'
) TYPE=MyISAM;

# Table: 'interlog'
# 
CREATE TABLE `interlog` (
  `time` datetime NOT NULL default '0000-00-00 00:00:00',
  `log` varchar(255) NOT NULL default ''
) TYPE=MyISAM; 

# ----------------------------------------------------------
# Add new table guild_storage


# Table: 'guild_storage'
# 
CREATE TABLE `guild_storage` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `guild_id` int(11) NOT NULL default '0',
  `nameid` int(11) NOT NULL default '0',
  `amount` int(11) NOT NULL default '0',
  `equip` mediumint(8) unsigned NOT NULL default '0',
  `identify` smallint(6) NOT NULL default '0',
  `refine` tinyint(3) unsigned NOT NULL default '0',
  `attribute` tinyint(4) NOT NULL default '0',
  `card0` int(11) NOT NULL default '0',
  `card1` int(11) NOT NULL default '0',
  `card2` int(11) NOT NULL default '0',
  `card3` int(11) NOT NULL default '0',
  PRIMARY KEY  (`id`),
  KEY `guild_id` (`guild_id`)
) TYPE=MyISAM; 

# -------------------------------------------------------------------
# Change global_reg_value table
# type = 1   account_reg for all connected map-server ( like Chaos Loki Sakary )
# type = 2   account_reg for current map-server
# type = 3   char_reg for current map-server

ALTER TABLE `global_reg_value` ADD `type` int(11) NOT NULL default '3';
ALTER TABLE `global_reg_value` ADD `account_id` int(11) NOT NULL default '0', ADD INDEX (`account_id`);

ALTER TABLE `guild_member` CHANGE `exp` `exp` BIGINT DEFAULT '0' NOT NULL;

ALTER TABLE `login` CHANGE `email` `email` varchar(100) NOT NULL default 'user@athena';
ALTER TABLE `login` CHANGE `user_pass` `user_pass` varchar(32) NOT NULL default '0';

ALTER TABLE `char` CHANGE `class` `class` int(11) NOT NULL default '0';

DROP TABLE `ragsrvinfo`;

CREATE TABLE `ragsrvinfo` (
  `index` int(11) NOT NULL default '0',
  `name` varchar(255) NOT NULL default '',
  `exp` int(11) NOT NULL default '0',
  `jexp` int(11) NOT NULL default '0',
  `drop` int(11) NOT NULL default '0',
  `motd` varchar(255) NOT NULL default ''
) TYPE=MyISAM;