Skip to content
Permalink
Browse files

Made mob sprite column unique (#4239)

Make the Sprite column for the SQL monster databases unique.

Fixes #4223.

Thanks to @Indigo000!
  • Loading branch information...
Lemongrass3110 committed Jul 8, 2019
1 parent 8bb6b11 commit d80e111e5faaa887e3031f12ffcfdbd8f28209ea
Showing with 31 additions and 8 deletions.
  1. +3 −2 sql-files/mob_db.sql
  2. +3 −2 sql-files/mob_db2.sql
  3. +3 −2 sql-files/mob_db2_re.sql
  4. +3 −2 sql-files/mob_db_re.sql
  5. +19 −0 sql-files/upgrades/upgrade_20190628.sql
@@ -5,7 +5,7 @@
DROP TABLE IF EXISTS `mob_db`;
CREATE TABLE `mob_db` (
`ID` mediumint(9) unsigned NOT NULL default '0',
`Sprite` text NOT NULL,
`Sprite` varchar(24) NOT NULL,
`kName` text NOT NULL,
`iName` text NOT NULL,
`LV` tinyint(6) unsigned NOT NULL default '0',
@@ -61,7 +61,8 @@ CREATE TABLE `mob_db` (
`Drop9per` smallint(9) unsigned NOT NULL default '0',
`DropCardid` smallint(5) unsigned NOT NULL default '0',
`DropCardper` smallint(9) unsigned NOT NULL default '0',
PRIMARY KEY (`ID`)
PRIMARY KEY (`ID`),
UNIQUE KEY (`Sprite`)
) ENGINE=MyISAM;

# Monster Database
@@ -5,7 +5,7 @@
DROP TABLE IF EXISTS `mob_db2`;
CREATE TABLE `mob_db2` (
`ID` mediumint(9) unsigned NOT NULL default '0',
`Sprite` text NOT NULL,
`Sprite` varchar(24) NOT NULL,
`kName` text NOT NULL,
`iName` text NOT NULL,
`LV` tinyint(6) unsigned NOT NULL default '0',
@@ -61,7 +61,8 @@ CREATE TABLE `mob_db2` (
`Drop9per` smallint(9) unsigned NOT NULL default '0',
`DropCardid` smallint(5) unsigned NOT NULL default '0',
`DropCardper` smallint(9) unsigned NOT NULL default '0',
PRIMARY KEY (`ID`)
PRIMARY KEY (`ID`),
UNIQUE KEY (`Sprite`)
) ENGINE=MyISAM;

# Monster Additional Database
@@ -5,7 +5,7 @@
DROP TABLE IF EXISTS `mob_db2_re`;
CREATE TABLE `mob_db2_re` (
`ID` mediumint(9) unsigned NOT NULL default '0',
`Sprite` text NOT NULL,
`Sprite` varchar(24) NOT NULL,
`kName` text NOT NULL,
`iName` text NOT NULL,
`LV` tinyint(6) unsigned NOT NULL default '0',
@@ -61,7 +61,8 @@ CREATE TABLE `mob_db2_re` (
`Drop9per` smallint(9) unsigned NOT NULL default '0',
`DropCardid` smallint(5) unsigned NOT NULL default '0',
`DropCardper` smallint(9) unsigned NOT NULL default '0',
PRIMARY KEY (`ID`)
PRIMARY KEY (`ID`),
UNIQUE KEY (`Sprite`)
) ENGINE=MyISAM;

# Monsters Additional Database
@@ -5,7 +5,7 @@
DROP TABLE IF EXISTS `mob_db_re`;
CREATE TABLE `mob_db_re` (
`ID` mediumint(9) unsigned NOT NULL default '0',
`Sprite` text NOT NULL,
`Sprite` varchar(24) NOT NULL,
`kName` text NOT NULL,
`iName` text NOT NULL,
`LV` tinyint(6) unsigned NOT NULL default '0',
@@ -61,7 +61,8 @@ CREATE TABLE `mob_db_re` (
`Drop9per` smallint(9) unsigned NOT NULL default '0',
`DropCardid` smallint(5) unsigned NOT NULL default '0',
`DropCardper` smallint(9) unsigned NOT NULL default '0',
PRIMARY KEY (`ID`)
PRIMARY KEY (`ID`),
UNIQUE KEY (`Sprite`)
) ENGINE=MyISAM;

# Monster Database
@@ -0,0 +1,19 @@
ALTER TABLE `mob_db`
MODIFY `Sprite` varchar(24) NOT NULL,
ADD UNIQUE KEY (`Sprite`)
;

ALTER TABLE `mob_db_re`
MODIFY `Sprite` varchar(24) NOT NULL,
ADD UNIQUE KEY (`Sprite`)
;

ALTER TABLE `mob_db2`
MODIFY `Sprite` varchar(24) NOT NULL,
ADD UNIQUE KEY (`Sprite`)
;

ALTER TABLE `mob_db2_re`
MODIFY `Sprite` varchar(24) NOT NULL,
ADD UNIQUE KEY (`Sprite`)
;

0 comments on commit d80e111

Please sign in to comment.
You can’t perform that action at this time.