From c14d53067ba378e3c3a9adf67ac8067643429fc0 Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Tue, 9 Jul 2024 13:30:51 +0200 Subject: [PATCH] Comments/Replies * add default values to comments table so replying doesn't cause errors --- setup/db_structure.sql | 6 +++--- setup/updates/1720523764_01.sql | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 setup/updates/1720523764_01.sql diff --git a/setup/db_structure.sql b/setup/db_structure.sql index a05d85d8..2b41a58b 100644 --- a/setup/db_structure.sql +++ b/setup/db_structure.sql @@ -415,8 +415,8 @@ DROP TABLE IF EXISTS `aowow_comments`; /*!40101 SET character_set_client = utf8mb4 */; CREATE TABLE `aowow_comments` ( `id` int unsigned NOT NULL AUTO_INCREMENT COMMENT 'Comment ID', - `type` smallint unsigned NOT NULL COMMENT 'Type of Page', - `typeId` mediumint NOT NULL COMMENT 'ID Of Page', + `type` smallint unsigned NOT NULL DEFAULT 0 COMMENT 'Type of Page', + `typeId` mediumint NOT NULL DEFAULT 0 COMMENT 'ID Of Page', `userId` int unsigned DEFAULT NULL COMMENT 'User ID', `roles` smallint unsigned NOT NULL, `body` text NOT NULL COMMENT 'Comment text', @@ -3320,7 +3320,7 @@ UNLOCK TABLES; LOCK TABLES `aowow_dbversion` WRITE; /*!40000 ALTER TABLE `aowow_dbversion` DISABLE KEYS */; -INSERT INTO `aowow_dbversion` VALUES (1720455279,0,NULL,NULL); +INSERT INTO `aowow_dbversion` VALUES (1720523765,0,NULL,NULL); /*!40000 ALTER TABLE `aowow_dbversion` ENABLE KEYS */; UNLOCK TABLES; diff --git a/setup/updates/1720523764_01.sql b/setup/updates/1720523764_01.sql new file mode 100644 index 00000000..2d588c5b --- /dev/null +++ b/setup/updates/1720523764_01.sql @@ -0,0 +1,3 @@ +ALTER TABLE `aowow_comments` + MODIFY COLUMN `type` smallint unsigned NOT NULL DEFAULT 0 COMMENT 'Type of Page', + MODIFY COLUMN `typeId` mediumint NOT NULL DEFAULT 0 COMMENT 'ID Of Page';