* fix erronous foreign key constraint revealed by MySQL 8.4
This commit is contained in:
Sarjuuk
2024-05-21 17:43:04 +02:00
parent 90b04865f5
commit 7d5930865c
2 changed files with 9 additions and 2 deletions

View File

@@ -209,7 +209,7 @@ CREATE TABLE `aowow_account_weightscales` (
`name` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL, `name` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL,
`class` tinyint(3) unsigned NOT NULL DEFAULT 0, `class` tinyint(3) unsigned NOT NULL DEFAULT 0,
`icon` varchar(48) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', `icon` varchar(48) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
PRIMARY KEY (`id`,`userId`), PRIMARY KEY (`id`),
KEY `FK_acc_weights` (`userId`), KEY `FK_acc_weights` (`userId`),
CONSTRAINT `FK_acc_weights` FOREIGN KEY (`userId`) REFERENCES `aowow_account` (`id`) ON DELETE CASCADE ON UPDATE CASCADE CONSTRAINT `FK_acc_weights` FOREIGN KEY (`userId`) REFERENCES `aowow_account` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPACT; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPACT;
@@ -3250,7 +3250,7 @@ UNLOCK TABLES;
LOCK TABLES `aowow_dbversion` WRITE; LOCK TABLES `aowow_dbversion` WRITE;
/*!40000 ALTER TABLE `aowow_dbversion` DISABLE KEYS */; /*!40000 ALTER TABLE `aowow_dbversion` DISABLE KEYS */;
INSERT INTO `aowow_dbversion` VALUES (1709133536,0,NULL,NULL); INSERT INTO `aowow_dbversion` VALUES (1716305877,0,NULL,NULL);
/*!40000 ALTER TABLE `aowow_dbversion` ENABLE KEYS */; /*!40000 ALTER TABLE `aowow_dbversion` ENABLE KEYS */;
UNLOCK TABLES; UNLOCK TABLES;

View File

@@ -0,0 +1,7 @@
SET foreign_key_checks = 0;
ALTER TABLE `aowow_account_weightscales`
DROP PRIMARY KEY,
ADD PRIMARY KEY (`id`);
SET foreign_key_checks = 1;