Skip to content

Commit

Permalink
Changed type of JSON due to MySQL storing as blob
Browse files Browse the repository at this point in the history
  • Loading branch information
DoggySazHi committed Feb 20, 2024
1 parent e1d327a commit 38ef466
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/resources/dbinit.sql
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ CREATE TABLE IF NOT EXISTS `message_translation`
`uuid` VARCHAR(36) NOT NULL, -- Surrogate key
`message_id` VARCHAR(36) NOT NULL, -- To which message this translation belongs
`language` VARCHAR(8) NOT NULL, -- ISO 639-1 code of translation
`text` VARCHAR(256) NOT NULL, -- The translated text
`text` VARCHAR(512) NOT NULL, -- The translated text
PRIMARY KEY (`uuid`),
FOREIGN KEY (`message_id`) REFERENCES `message` (`uuid`) ON DELETE CASCADE,
FOREIGN KEY (`language`) REFERENCES `language` (`code`) ON DELETE CASCADE
Expand All @@ -50,9 +50,9 @@ CREATE TABLE IF NOT EXISTS `user_message`
(
`uuid` VARCHAR(36) NOT NULL, -- Surrogate key
`message_id` VARCHAR(36) NOT NULL, -- To which message this translation belongs
`json_msg` JSON NOT NULL, -- The JSON message from Minecraft
`json_msg` VARCHAR(2048) NOT NULL, -- The JSON message from Minecraft
PRIMARY KEY (`uuid`),
FOREIGN KEY (`message_id`) REFERENCES `message` (`uuid`) ON DELETE CASCADE
);

CREATE UNIQUE INDEX `user_message_json_index` ON `user_message` (`json_msg`);
CREATE INDEX `user_message_json_msg_idx` ON `user_message` (json_msg(255));

0 comments on commit 38ef466

Please sign in to comment.