From 3ecf877ba3f6d92bc323522bd166248464f83f79 Mon Sep 17 00:00:00 2001
From: Shido <the.keikun@gmail.com>
Date: Fri, 30 May 2014 10:13:58 +0800
Subject: SQL Re-Organization.

Signed-off-by: KeiKun <the.keikun@gmail.com>
---
 sql-files/logs.sql | 255 +++++++++++++++++++++++++++++------------------------
 1 file changed, 142 insertions(+), 113 deletions(-)

(limited to 'sql-files/logs.sql')

diff --git a/sql-files/logs.sql b/sql-files/logs.sql
index a281d632e..3d5f56710 100644
--- a/sql-files/logs.sql
+++ b/sql-files/logs.sql
@@ -1,128 +1,157 @@
-#PickLog types (M)onsters Drop, (P)layers Drop/Take, Mobs Drop (L)oot Drop/Take,
-# Players (T)rade Give/Take, Players (V)ending Sell/Take, (S)hop Sell/Take, (N)PC Give/Take,
-# (C)onsumable Items, (A)dministrators Create/Delete, Sto(R)age, (G)uild Storage,
-# (E)mail attachment,(B)uying Store, Pr(O)duced Items/Ingredients, Auct(I)oned Items,
-# (X) Other, (D) Stolen from mobs, (U) MVP Prizes
-
-#Database: ragnarok
-#Table: picklog
-CREATE TABLE `picklog` (
-  `id` int(11) NOT NULL auto_increment,
-  `time` datetime NOT NULL default '0000-00-00 00:00:00',
-  `char_id` int(11) NOT NULL default '0',
-  `type` enum('M','P','L','T','V','S','N','C','A','R','G','E','B','O','I','X','D','U') NOT NULL default 'P',
-  `nameid` int(11) NOT NULL default '0',
-  `amount` int(11) NOT NULL default '1',
-  `refine` tinyint(3) unsigned 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',
-  `unique_id` bigint(20) unsigned NOT NULL default '0',
-  `map` varchar(11) NOT NULL default '',
-  PRIMARY KEY  (`id`),
-  INDEX (`type`)
-) ENGINE=MyISAM AUTO_INCREMENT=1 ;
+-- PickLog Types
+--	(M)onsters Drop
+--	(P)layers Drop/Take
+--	Mobs Drop (L)oot Drop/Take
+--	Players (T)rade Give/Take
+--	Players (V)ending Sell/Take
+--	(S)hop Sell/Take
+--	(N)PC Give/Take
+--	(C)onsumable Items
+--	(A)dministrators Create/Delete
+--	Sto(R)age
+--	(G)uild Storage
+--	(E)mail attachment
+--	(B)uying Store
+--	Pr(O)duced Items/Ingredients
+--	Auct(I)oned Items
+--	(X) Other
+--	(D) Stolen from mobs
+--	(U) MVP Prizes
 
-#ZenyLog types (M)onsters,(T)rade,(V)ending Sell/Buy,(S)hop Sell/Buy,(N)PC Change amount,(A)dministrators,(E)Mail,(B)uying Store
-#Database: ragnarok
-#Table: zenylog
-CREATE TABLE `zenylog` (
-  `id` int(11) NOT NULL auto_increment,
-  `time` datetime NOT NULL default '0000-00-00 00:00:00',
-  `char_id` int(11) NOT NULL default '0',
-  `src_id` int(11) NOT NULL default '0',
-  `type` enum('T','V','P','M','S','N','D','C','A','E','I','B') NOT NULL default 'S',
-  `amount` int(11) NOT NULL default '0',
-  `map` varchar(11) NOT NULL default '',
-  PRIMARY KEY  (`id`),
-  INDEX (`type`)
-) ENGINE=MyISAM AUTO_INCREMENT=1 ;
+--
+-- Table structure for table `atcommandlog`
+--
 
-#Database: ragnarok
-#Table: branchlog
-CREATE TABLE `branchlog` (
-  `branch_id` mediumint(9) unsigned NOT NULL auto_increment,
-  `branch_date` datetime NOT NULL default '0000-00-00 00:00:00',
-  `account_id` int(11) NOT NULL default '0',
-  `char_id` int(11) NOT NULL default '0',
-  `char_name` varchar(25) NOT NULL default '',
-  `map` varchar(11) NOT NULL default '',
-  PRIMARY KEY  (`branch_id`),
+CREATE TABLE IF NOT EXISTS `atcommandlog` (
+  `atcommand_id` MEDIUMINT(9) UNSIGNED NOT NULL AUTO_INCREMENT,
+  `atcommand_date` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
+  `account_id` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+  `char_id` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+  `char_name` VARCHAR(25) NOT NULL DEFAULT '',
+  `map` VARCHAR(11) NOT NULL DEFAULT '',
+  `command` VARCHAR(255) NOT NULL DEFAULT '',
+  PRIMARY KEY (`atcommand_id`),
   INDEX (`account_id`),
   INDEX (`char_id`)
 ) ENGINE=MyISAM AUTO_INCREMENT=1 ;
 
-#Database: ragnarok
-#Table: mvplog
-CREATE TABLE `mvplog` (
-  `mvp_id` mediumint(9) unsigned NOT NULL auto_increment,
-  `mvp_date` datetime NOT NULL default '0000-00-00 00:00:00',
-  `kill_char_id` int(11) NOT NULL default '0',
-  `monster_id` smallint(6) NOT NULL default '0',
-  `prize` int(11) NOT NULL default '0',
-  `mvpexp` mediumint(9) NOT NULL default '0',
-  `map` varchar(11) NOT NULL default '',
-  PRIMARY KEY  (`mvp_id`)
-) ENGINE=MyISAM AUTO_INCREMENT=1 ;
+--
+-- Table structure for table `branchlog`
+--
 
-#Database: ragnarok
-#Table: atcommandlog
-CREATE TABLE `atcommandlog` (
-  `atcommand_id` mediumint(9) unsigned NOT NULL auto_increment,
-  `atcommand_date` datetime NOT NULL default '0000-00-00 00:00:00',
-  `account_id` int(11) unsigned NOT NULL default '0',
-  `char_id` int(11) unsigned NOT NULL default '0',
-  `char_name` varchar(25) NOT NULL default '',
-  `map` varchar(11) NOT NULL default '',
-  `command` varchar(255) NOT NULL default '',
-  PRIMARY KEY  (`atcommand_id`),
+CREATE TABLE IF NOT EXISTS `branchlog` (
+  `branch_id` MEDIUMINT(9) UNSIGNED NOT NULL AUTO_INCREMENT,
+  `branch_date` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
+  `account_id` INT(11) NOT NULL DEFAULT '0',
+  `char_id` INT(11) NOT NULL DEFAULT '0',
+  `char_name` VARCHAR(25) NOT NULL DEFAULT '',
+  `map` VARCHAR(11) NOT NULL DEFAULT '',
+  PRIMARY KEY(`branch_id`),
   INDEX (`account_id`),
   INDEX (`char_id`)
-) ENGINE=MyISAM AUTO_INCREMENT=1 ;
+) ENGINE=MyISAM AUTO_INCREMENT=1;
 
-#Database: ragnarok
-#Table: npclog
-CREATE TABLE `npclog` (
-  `npc_id` mediumint(9) unsigned NOT NULL auto_increment,
-  `npc_date` datetime NOT NULL default '0000-00-00 00:00:00',
-  `account_id` int(11) unsigned NOT NULL default '0',
-  `char_id` int(11) unsigned NOT NULL default '0',
-  `char_name` varchar(25) NOT NULL default '',
-  `map` varchar(11) NOT NULL default '',
-  `mes` varchar(255) NOT NULL default '',
-  PRIMARY KEY  (`npc_id`),
-  INDEX (`account_id`),
-  INDEX (`char_id`)
-) ENGINE=MyISAM AUTO_INCREMENT=1 ;
+--
+-- Table structure for table `chatlog`
+--
 
-#ChatLog types Gl(O)bal,(W)hisper,(P)arty,(G)uild,(M)ain chat
-#Database: ragnarok
-#Table: chatlog
-CREATE TABLE `chatlog` (
-  `id` bigint(20) NOT NULL auto_increment,
-  `time` datetime NOT NULL default '0000-00-00 00:00:00',
-  `type` enum('O','W','P','G','M') NOT NULL default 'O',
-  `type_id` int(11) NOT NULL default '0',
-  `src_charid` int(11) NOT NULL default '0',
-  `src_accountid` int(11) NOT NULL default '0',
-  `src_map` varchar(11) NOT NULL default '',
-  `src_map_x` smallint(4) NOT NULL default '0',
-  `src_map_y` smallint(4) NOT NULL default '0',
-  `dst_charname` varchar(25) NOT NULL default '',
-  `message` varchar(150) NOT NULL default '',
-  PRIMARY KEY  (`id`),
+CREATE TABLE IF NOT EXISTS `chatlog` (
+  `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
+  `time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
+  `type` ENUM('O','W','P','G','M') NOT NULL DEFAULT 'O',
+  `type_id` INT(11) NOT NULL DEFAULT '0',
+  `src_charid` INT(11) NOT NULL DEFAULT '0',
+  `src_accountid` INT(11) NOT NULL DEFAULT '0',
+  `src_map` VARCHAR(11) NOT NULL DEFAULT '',
+  `src_map_x` SMALLINT(4) NOT NULL DEFAULT '0',
+  `src_map_y` SMALLINT(4) NOT NULL DEFAULT '0',
+  `dst_charname` VARCHAR(25) NOT NULL DEFAULT '',
+  `message` VARCHAR(150) NOT NULL DEFAULT '',
+  PRIMARY KEY (`id`),
   INDEX (`src_accountid`),
   INDEX (`src_charid`)
-) ENGINE=MyISAM AUTO_INCREMENT=1 ;
+) ENGINE=MyISAM AUTO_INCREMENT=1;
+
+--
+-- Table structure for table `loginlog`
+--
 
-#Database: ragnarok
-#Table: loginlog
-CREATE TABLE `loginlog` (
-  `time` datetime NOT NULL default '0000-00-00 00:00:00',
-  `ip` varchar(15) NOT NULL default '',
-  `user` varchar(23) NOT NULL default '',
-  `rcode` tinyint(4) NOT NULL default '0',
-  `log` varchar(255) NOT NULL default '',
+CREATE TABLE IF NOT EXISTS `loginlog` (
+  `time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
+  `ip` VARCHAR(15) NOT NULL DEFAULT '',
+  `user` VARCHAR(23) NOT NULL DEFAULT '',
+  `rcode` TINYINT(4) NOT NULL DEFAULT '0',
+  `log` VARCHAR(255) NOT NULL DEFAULT '',
   INDEX (`ip`)
-) ENGINE=MyISAM ;
+) ENGINE=MyISAM;
+
+--
+-- Table structure for table `mvplog`
+--
+
+CREATE TABLE IF NOT EXISTS `mvplog` (
+  `mvp_id` MEDIUMINT(9) UNSIGNED NOT NULL AUTO_INCREMENT,
+  `mvp_date` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
+  `kill_char_id` INT(11) NOT NULL DEFAULT '0',
+  `monster_id` SMALLINT(6) NOT NULL DEFAULT '0',
+  `prize` INT(11) NOT NULL DEFAULT '0',
+  `mvpexp` MEDIUMINT(9) NOT NULL DEFAULT '0',
+  `map` VARCHAR(11) NOT NULL DEFAULT '',
+  PRIMARY KEY (`mvp_id`)
+) ENGINE=MyISAM AUTO_INCREMENT=1;
+
+--
+-- Table structure for table `npclog`
+--
+
+CREATE TABLE IF NOT EXISTS `npclog` (
+  `npc_id` MEDIUMINT(9) UNSIGNED NOT NULL AUTO_INCREMENT,
+  `npc_date` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
+  `account_id` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+  `char_id` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+  `char_name` VARCHAR(25) NOT NULL DEFAULT '',
+  `map` VARCHAR(11) NOT NULL DEFAULT '',
+  `mes` VARCHAR(255) NOT NULL DEFAULT '',
+  PRIMARY KEY (`npc_id`),
+  INDEX (`account_id`),
+  INDEX (`char_id`)
+) ENGINE=MyISAM AUTO_INCREMENT=1;
+
+--
+-- Table structure for table `picklog`
+--
+
+CREATE TABLE IF NOT EXISTS `picklog` (
+  `id` INT(11) NOT NULL AUTO_INCREMENT,
+  `time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
+  `char_id` INT(11) NOT NULL DEFAULT '0',
+  `type` ENUM('M','P','L','T','V','S','N','C','A','R','G','E','B','O','I','X','D','U') NOT NULL DEFAULT 'P',
+  `nameid` INT(11) NOT NULL DEFAULT '0',
+  `amount` INT(11) NOT NULL DEFAULT '1',
+  `refine` TINYINT(3) UNSIGNED 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',
+  `unique_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+  `map` VARCHAR(11) NOT NULL DEFAULT '',
+  PRIMARY KEY (`id`),
+  INDEX (`type`)
+) ENGINE=MyISAM AUTO_INCREMENT=1;
+
+--
+-- Table structure for table `zenylog`
+--
+
+CREATE TABLE IF NOT EXISTS `zenylog` (
+  `id` INT(11) NOT NULL AUTO_INCREMENT,
+  `time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
+  `char_id` INT(11) NOT NULL DEFAULT '0',
+  `src_id` INT(11) NOT NULL DEFAULT '0',
+  `type` ENUM('T','V','P','M','S','N','D','C','A','E','I','B') NOT NULL DEFAULT 'S',
+  `amount` INT(11) NOT NULL DEFAULT '0',
+  `map` VARCHAR(11) NOT NULL DEFAULT '',
+  PRIMARY KEY (`id`),
+  INDEX (`type`)
+) ENGINE=MyISAM AUTO_INCREMENT=1;
+
-- 
cgit v1.2.3-70-g09d2


From f62ce0c0bae2c1b674aca5c1d7918ec97d9a7a74 Mon Sep 17 00:00:00 2001
From: Haru <haru@dotalux.com>
Date: Thu, 17 Jul 2014 21:32:55 +0200
Subject: Fixed minor issues in the sql files from 3ecf877b

Signed-off-by: Haru <haru@dotalux.com>
---
 sql-files/logs.sql | 36 ++++++++++++++++++------------------
 sql-files/main.sql | 22 +++++++++++-----------
 2 files changed, 29 insertions(+), 29 deletions(-)

(limited to 'sql-files/logs.sql')

diff --git a/sql-files/logs.sql b/sql-files/logs.sql
index 3d5f56710..fe875ec62 100644
--- a/sql-files/logs.sql
+++ b/sql-files/logs.sql
@@ -1,22 +1,22 @@
 -- PickLog Types
---	(M)onsters Drop
---	(P)layers Drop/Take
---	Mobs Drop (L)oot Drop/Take
---	Players (T)rade Give/Take
---	Players (V)ending Sell/Take
---	(S)hop Sell/Take
---	(N)PC Give/Take
---	(C)onsumable Items
---	(A)dministrators Create/Delete
---	Sto(R)age
---	(G)uild Storage
---	(E)mail attachment
---	(B)uying Store
---	Pr(O)duced Items/Ingredients
---	Auct(I)oned Items
---	(X) Other
---	(D) Stolen from mobs
---	(U) MVP Prizes
+-- (M)onsters Drop
+-- (P)layers Drop/Take
+-- Mobs Drop (L)oot Drop/Take
+-- Players (T)rade Give/Take
+-- Players (V)ending Sell/Take
+-- (S)hop Sell/Take
+-- (N)PC Give/Take
+-- (C)onsumable Items
+-- (A)dministrators Create/Delete
+-- Sto(R)age
+-- (G)uild Storage
+-- (E)mail attachment
+-- (B)uying Store
+-- Pr(O)duced Items/Ingredients
+-- Auct(I)oned Items
+-- (X) Other
+-- (D) Stolen from mobs
+-- (U) MVP Prizes
 
 --
 -- Table structure for table `atcommandlog`
diff --git a/sql-files/main.sql b/sql-files/main.sql
index 22cba1660..68b7fb52a 100644
--- a/sql-files/main.sql
+++ b/sql-files/main.sql
@@ -271,12 +271,12 @@ CREATE TABLE IF NOT EXISTS `friends` (
 --
 
 CREATE TABLE IF NOT EXISTS `hotkey` (
-	`char_id` INT(11) NOT NULL,
-	`hotkey` TINYINT(2) UNSIGNED NOT NULL,
-	`type` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
-	`itemskill_id` INT(11) UNSIGNED NOT NULL DEFAULT '0',
-	`skill_lvl` TINYINT(4) UNSIGNED NOT NULL DEFAULT '0',
-	PRIMARY KEY (`char_id`,`hotkey`)
+  `char_id` INT(11) NOT NULL,
+  `hotkey` TINYINT(2) UNSIGNED NOT NULL,
+  `type` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
+  `itemskill_id` INT(11) UNSIGNED NOT NULL DEFAULT '0',
+  `skill_lvl` TINYINT(4) UNSIGNED NOT NULL DEFAULT '0',
+  PRIMARY KEY (`char_id`,`hotkey`)
 ) ENGINE=MyISAM;
 
 --
@@ -485,16 +485,16 @@ CREATE TABLE IF NOT EXISTS `homunculus` (
 ) ENGINE=MyISAM;
 
 -- 
--- Table structure for table `INTerlog`
+-- Table structure for table `interlog`
 --
 
-CREATE TABLE IF NOT EXISTS `INTerlog` (
+CREATE TABLE IF NOT EXISTS `interlog` (
   `time` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
   `log` VARCHAR(255) NOT NULL DEFAULT ''
 ) ENGINE=MyISAM; 
 
 --
--- Table structure for table `INTerreg`
+-- Table structure for table `interreg`
 --
 
 CREATE TABLE IF NOT EXISTS `interreg` (
@@ -566,7 +566,7 @@ CREATE TABLE IF NOT EXISTS `login` (
 ) ENGINE=MyISAM AUTO_INCREMENT=2000000; 
 
 -- added standard accounts for servers, VERY INSECURE!!!
--- inserted INTo the table called login which is above
+-- inserted into the table called login which is above
 
 INSERT INTO `login` (`account_id`, `userid`, `user_pass`, `sex`, `email`) VALUES ('1', 's1', 'p1', 'S','athena@athena.com');
 
@@ -710,7 +710,7 @@ CREATE TABLE IF NOT EXISTS `pet` (
   `level` SMALLINT(4) UNSIGNED NOT NULL DEFAULT '0',
   `egg_id` SMALLINT(11) UNSIGNED NOT NULL DEFAULT '0',
   `equip` MEDIUMINT(8) UNSIGNED NOT NULL DEFAULT '0',
-  `INTimate` SMALLINT(9) UNSIGNED NOT NULL DEFAULT '0',
+  `intimate` SMALLINT(9) UNSIGNED NOT NULL DEFAULT '0',
   `hungry` SMALLINT(9) UNSIGNED NOT NULL DEFAULT '0',
   `rename_flag` TINYINT(4) UNSIGNED NOT NULL DEFAULT '0',
   `incubate` INT(11) UNSIGNED NOT NULL DEFAULT '0',
-- 
cgit v1.2.3-70-g09d2

