Browse Source

Adjusts bonus_script SQL table keys (#6276)

Fixes #5405.
Adds a normal key index as the uniqueness can be less restrictive.
Removes the primary keys.

Thanks to @Surefirer, @Patotron, and @gen1x8!
Aleos 3 years ago
parent
commit
0eeb464119
2 changed files with 4 additions and 1 deletions
  1. 1 1
      sql-files/main.sql
  2. 3 0
      sql-files/upgrades/upgrade_20211008.sql

+ 1 - 1
sql-files/main.sql

@@ -114,7 +114,7 @@ CREATE TABLE IF NOT EXISTS `bonus_script` (
   `flag` SMALLINT(5) UNSIGNED NOT NULL DEFAULT '0',
   `type` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
   `icon` SMALLINT(3) NOT NULL DEFAULT '-1',
-  PRIMARY KEY (`char_id`, `type`)
+  KEY `char_id` (`char_id`)
 ) ENGINE=InnoDB;
 
 --

+ 3 - 0
sql-files/upgrades/upgrade_20211008.sql

@@ -0,0 +1,3 @@
+ALTER TABLE `bonus_script`
+    DROP PRIMARY KEY,
+    ADD KEY `char_id` (`char_id`);