diff --git a/database/migrations/2014_05_19_151759_create_forum_table_categories.php b/database/migrations/2014_05_19_151759_create_forum_table_categories.php deleted file mode 100644 index 9b563627f..000000000 --- a/database/migrations/2014_05_19_151759_create_forum_table_categories.php +++ /dev/null @@ -1,33 +0,0 @@ -increments('id'); - $table->integer('parent_category')->unsigned(); - $table->string('title'); - $table->string('subtitle'); - $table->integer('weight'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('forum_categories'); - } -} diff --git a/database/migrations/2014_05_19_152425_create_forum_table_threads.php b/database/migrations/2014_05_19_152425_create_forum_table_threads.php deleted file mode 100644 index e0605b910..000000000 --- a/database/migrations/2014_05_19_152425_create_forum_table_threads.php +++ /dev/null @@ -1,37 +0,0 @@ -increments('id'); - $table->integer('parent_category')->unsigned(); - $table->foreignIdFor(config('forum.integration.user_model'), 'author_id'); - $table->string('title'); - $table->boolean('pinned'); - $table->boolean('locked'); - - $table->timestamps(); - $table->softDeletes(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('forum_threads'); - } -} diff --git a/database/migrations/2014_05_19_152611_create_forum_table_posts.php b/database/migrations/2014_05_19_152611_create_forum_table_posts.php deleted file mode 100644 index 8d46190af..000000000 --- a/database/migrations/2014_05_19_152611_create_forum_table_posts.php +++ /dev/null @@ -1,35 +0,0 @@ -increments('id'); - $table->integer('parent_thread')->unsigned(); - $table->foreignIdFor(config('forum.integration.user_model'), 'author_id'); - $table->text('content'); - - $table->timestamps(); - $table->softDeletes(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('forum_posts'); - } -} diff --git a/database/migrations/2015_04_14_180344_create_forum_table_threads_read.php b/database/migrations/2015_04_14_180344_create_forum_table_threads_read.php deleted file mode 100644 index 42cb94d57..000000000 --- a/database/migrations/2015_04_14_180344_create_forum_table_threads_read.php +++ /dev/null @@ -1,31 +0,0 @@ -integer('thread_id')->unsigned(); - $table->foreignIdFor(config('forum.integration.user_model'), 'user_id'); - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::drop('forum_threads_read'); - } -} diff --git a/database/migrations/2015_07_22_181406_update_forum_table_categories.php b/database/migrations/2015_07_22_181406_update_forum_table_categories.php deleted file mode 100644 index 4e488ead9..000000000 --- a/database/migrations/2015_07_22_181406_update_forum_table_categories.php +++ /dev/null @@ -1,45 +0,0 @@ -renameColumn('parent_category', 'category_id'); - $table->renameColumn('subtitle', 'description'); - }); - - Schema::table('forum_categories', function (Blueprint $table) { - $table->integer('category_id')->default(0)->change(); - $table->string('description')->nullable()->change(); - $table->integer('weight')->default(0)->change(); - - $table->boolean('enable_threads')->default(0); - $table->boolean('private')->default(0); - - $table->timestamps(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('forum_categories', function (Blueprint $table) { - $table->renameColumn('category_id', 'parent_category'); - $table->dropColumn(['created_at', 'updated_at', 'enable_threads', 'private']); - $table->renameColumn('description', 'subtitle'); - }); - } -} diff --git a/database/migrations/2015_07_22_181409_update_forum_table_threads.php b/database/migrations/2015_07_22_181409_update_forum_table_threads.php deleted file mode 100644 index 37e3096ef..000000000 --- a/database/migrations/2015_07_22_181409_update_forum_table_threads.php +++ /dev/null @@ -1,31 +0,0 @@ -renameColumn('parent_category', 'category_id'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('forum_threads', function (Blueprint $table) { - $table->renameColumn('category_id', 'parent_category'); - }); - } -} diff --git a/database/migrations/2015_07_22_181417_update_forum_table_posts.php b/database/migrations/2015_07_22_181417_update_forum_table_posts.php deleted file mode 100644 index 134152435..000000000 --- a/database/migrations/2015_07_22_181417_update_forum_table_posts.php +++ /dev/null @@ -1,32 +0,0 @@ -renameColumn('parent_thread', 'thread_id'); - $table->integer('post_id')->after('content')->unsigned()->nullable(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('forum_posts', function (Blueprint $table) { - $table->renameColumn('thread_id', 'parent_thread'); - }); - } -} diff --git a/database/migrations/2016_05_24_114302_add_defaults_to_forum_table_threads_columns.php b/database/migrations/2016_05_24_114302_add_defaults_to_forum_table_threads_columns.php deleted file mode 100644 index 775417b82..000000000 --- a/database/migrations/2016_05_24_114302_add_defaults_to_forum_table_threads_columns.php +++ /dev/null @@ -1,33 +0,0 @@ -boolean('pinned')->nullable()->default(0)->change(); - $table->boolean('locked')->nullable()->default(0)->change(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('forum_threads', function (Blueprint $table) { - $table->boolean('pinned')->nullable(false)->default(null)->change(); - $table->boolean('locked')->nullable(false)->default(null)->change(); - }); - } -} diff --git a/database/migrations/2016_07_09_111441_add_counts_to_categories_table.php b/database/migrations/2016_07_09_111441_add_counts_to_categories_table.php deleted file mode 100644 index 020fe0b26..000000000 --- a/database/migrations/2016_07_09_111441_add_counts_to_categories_table.php +++ /dev/null @@ -1,33 +0,0 @@ -integer('post_count')->after('enable_threads')->default(0); - $table->integer('thread_count')->after('enable_threads')->default(0); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('forum_categories', function (Blueprint $table) { - $table->dropColumn(['thread_count', 'post_count']); - }); - } -} diff --git a/database/migrations/2016_07_09_122706_add_counts_to_threads_table.php b/database/migrations/2016_07_09_122706_add_counts_to_threads_table.php deleted file mode 100644 index 1d2a25c50..000000000 --- a/database/migrations/2016_07_09_122706_add_counts_to_threads_table.php +++ /dev/null @@ -1,31 +0,0 @@ -integer('reply_count')->after('locked')->default(0); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('forum_threads', function (Blueprint $table) { - $table->dropColumn('reply_count'); - }); - } -} diff --git a/database/migrations/2016_07_10_134700_add_sequence_to_posts_table.php b/database/migrations/2016_07_10_134700_add_sequence_to_posts_table.php deleted file mode 100644 index 04bf7a8a0..000000000 --- a/database/migrations/2016_07_10_134700_add_sequence_to_posts_table.php +++ /dev/null @@ -1,31 +0,0 @@ -integer('sequence')->after('post_id')->unsigned()->default(0); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('forum_posts', function (Blueprint $table) { - $table->dropColumn('sequence'); - }); - } -} diff --git a/database/migrations/2018_11_04_211718_update_categories_table.php b/database/migrations/2018_11_04_211718_update_categories_table.php deleted file mode 100644 index cf369086a..000000000 --- a/database/migrations/2018_11_04_211718_update_categories_table.php +++ /dev/null @@ -1,35 +0,0 @@ -nestedSet(); - $table->dropColumn(['category_id', 'weight']); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('forum_categories', function (Blueprint $table) { - $table->dropNestedSet(); - $table->integer('category_id')->unsigned(); - $table->integer('weight'); - }); - } -} diff --git a/database/migrations/2019_09_07_210904_update_forum_category_booleans.php b/database/migrations/2019_09_07_210904_update_forum_category_booleans.php deleted file mode 100644 index 4e2b46fab..000000000 --- a/database/migrations/2019_09_07_210904_update_forum_category_booleans.php +++ /dev/null @@ -1,34 +0,0 @@ -renameColumn('enable_threads', 'accepts_threads'); - $table->renameColumn('private', 'is_private'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('forum_categories', function (Blueprint $table) { - $table->renameColumn('accepts_threads', 'enable_threads'); - $table->renameColumn('is_private', 'private'); - }); - } -} diff --git a/database/migrations/2019_09_07_230148_add_color_to_categories.php b/database/migrations/2019_09_07_230148_add_color_to_categories.php deleted file mode 100644 index 3dd1f3684..000000000 --- a/database/migrations/2019_09_07_230148_add_color_to_categories.php +++ /dev/null @@ -1,32 +0,0 @@ -string('color')->nullable(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('forum_categories', function (Blueprint $table) { - $table->dropColumn('color'); - }); - } -} diff --git a/database/migrations/2020_03_22_050710_add_thread_ids_to_categories.php b/database/migrations/2020_03_22_050710_add_thread_ids_to_categories.php deleted file mode 100644 index 678bd0d5d..000000000 --- a/database/migrations/2020_03_22_050710_add_thread_ids_to_categories.php +++ /dev/null @@ -1,34 +0,0 @@ -integer('newest_thread_id')->after('accepts_threads')->unsigned()->nullable(); - $table->integer('latest_active_thread_id')->after('newest_thread_id')->unsigned()->nullable(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('forum_categories', function (Blueprint $table) { - $table->dropColumn('newest_thread_id'); - $table->dropColumn('latest_active_thread_id'); - }); - } -} diff --git a/database/migrations/2020_03_22_055827_add_post_id_to_threads.php b/database/migrations/2020_03_22_055827_add_post_id_to_threads.php deleted file mode 100644 index b5cb8b813..000000000 --- a/database/migrations/2020_03_22_055827_add_post_id_to_threads.php +++ /dev/null @@ -1,32 +0,0 @@ -integer('last_post_id')->after('locked')->unsigned()->nullable(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('forum_threads', function (Blueprint $table) { - $table->dropColumn('last_post_id'); - }); - } -} diff --git a/database/migrations/2020_12_02_233754_add_first_post_id_to_threads.php b/database/migrations/2020_12_02_233754_add_first_post_id_to_threads.php deleted file mode 100644 index 75f844f87..000000000 --- a/database/migrations/2020_12_02_233754_add_first_post_id_to_threads.php +++ /dev/null @@ -1,32 +0,0 @@ -integer('first_post_id')->after('locked')->unsigned()->nullable(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('forum_threads', function (Blueprint $table) { - $table->dropColumn('first_post_id'); - }); - } -} diff --git a/database/migrations/2021_07_31_094750_add_fk_indices.php b/database/migrations/2021_07_31_094750_add_fk_indices.php deleted file mode 100644 index 98053ac0e..000000000 --- a/database/migrations/2021_07_31_094750_add_fk_indices.php +++ /dev/null @@ -1,40 +0,0 @@ -index('category_id'); - }); - - Schema::table('forum_posts', function (Blueprint $table) { - $table->index('thread_id'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('forum_threads', function (Blueprint $table) { - $table->dropIndex('forum_threads_category_id_index'); - }); - - Schema::table('forum_posts', function (Blueprint $table) { - $table->dropIndex('forum_posts_thread_id_index'); - }); - } -} diff --git a/database/schema/mysql-schema.sql b/database/schema/mysql-schema.sql index 35eb18d15..8367655b2 100644 --- a/database/schema/mysql-schema.sql +++ b/database/schema/mysql-schema.sql @@ -329,6 +329,76 @@ CREATE TABLE `firewall` ( UNIQUE KEY `firewall_ip_address_unique` (`ip_address`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci ROW_FORMAT=DYNAMIC; /*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `forum_categories`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `forum_categories` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `title` varchar(255) NOT NULL, + `description` varchar(255) DEFAULT NULL, + `accepts_threads` tinyint(1) NOT NULL DEFAULT 0, + `newest_thread_id` int(10) unsigned DEFAULT NULL, + `latest_active_thread_id` int(10) unsigned DEFAULT NULL, + `thread_count` int(11) NOT NULL DEFAULT 0, + `post_count` int(11) NOT NULL DEFAULT 0, + `is_private` tinyint(1) NOT NULL DEFAULT 0, + `created_at` timestamp NULL DEFAULT NULL, + `updated_at` timestamp NULL DEFAULT NULL, + `_lft` int(10) unsigned NOT NULL DEFAULT 0, + `_rgt` int(10) unsigned NOT NULL DEFAULT 0, + `parent_id` int(10) unsigned DEFAULT NULL, + `color` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `forum_categories__lft__rgt_parent_id_index` (`_lft`,`_rgt`,`parent_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci ROW_FORMAT=DYNAMIC; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `forum_posts`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `forum_posts` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `thread_id` int(10) unsigned NOT NULL, + `author_id` bigint(20) unsigned NOT NULL, + `content` text NOT NULL, + `post_id` int(10) unsigned DEFAULT NULL, + `sequence` int(10) unsigned NOT NULL DEFAULT 0, + `created_at` timestamp NULL DEFAULT NULL, + `updated_at` timestamp NULL DEFAULT NULL, + `deleted_at` timestamp NULL DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `forum_posts_thread_id_index` (`thread_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci ROW_FORMAT=DYNAMIC; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `forum_threads`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `forum_threads` ( + `id` int(10) unsigned NOT NULL AUTO_INCREMENT, + `category_id` int(10) unsigned NOT NULL, + `author_id` bigint(20) unsigned NOT NULL, + `title` varchar(255) NOT NULL, + `pinned` tinyint(1) DEFAULT 0, + `locked` tinyint(1) DEFAULT 0, + `first_post_id` int(10) unsigned DEFAULT NULL, + `last_post_id` int(10) unsigned DEFAULT NULL, + `reply_count` int(11) NOT NULL DEFAULT 0, + `created_at` timestamp NULL DEFAULT NULL, + `updated_at` timestamp NULL DEFAULT NULL, + `deleted_at` timestamp NULL DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `forum_threads_category_id_index` (`category_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci ROW_FORMAT=DYNAMIC; +/*!40101 SET character_set_client = @saved_cs_client */; +DROP TABLE IF EXISTS `forum_threads_read`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `forum_threads_read` ( + `thread_id` int(10) unsigned NOT NULL, + `user_id` bigint(20) unsigned NOT NULL, + `created_at` timestamp NULL DEFAULT NULL, + `updated_at` timestamp NULL DEFAULT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci ROW_FORMAT=DYNAMIC; +/*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `forumpost`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -1680,3 +1750,21 @@ INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (92,'2024_01_12_193 INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (93,'2024_01_12_194256_add_back_timestamps_column_to__predb_crcs_table',2); INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (94,'2024_02_13_234425_add_indexes_to_movieinfo_table',3); INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (95,'2024_02_25_162628_add_id_column_to_steam_apps_table',4); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (96,'2014_05_19_151759_create_forum_table_categories',5); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (97,'2014_05_19_152425_create_forum_table_threads',5); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (98,'2014_05_19_152611_create_forum_table_posts',5); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (99,'2015_04_14_180344_create_forum_table_threads_read',5); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (100,'2015_07_22_181406_update_forum_table_categories',5); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (101,'2015_07_22_181409_update_forum_table_threads',5); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (102,'2015_07_22_181417_update_forum_table_posts',5); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (103,'2016_05_24_114302_add_defaults_to_forum_table_threads_columns',5); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (104,'2016_07_09_111441_add_counts_to_categories_table',5); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (105,'2016_07_09_122706_add_counts_to_threads_table',5); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (106,'2016_07_10_134700_add_sequence_to_posts_table',5); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (107,'2018_11_04_211718_update_categories_table',5); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (108,'2019_09_07_210904_update_forum_category_booleans',5); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (109,'2019_09_07_230148_add_color_to_categories',5); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (110,'2020_03_22_050710_add_thread_ids_to_categories',5); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (111,'2020_03_22_055827_add_post_id_to_threads',5); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (112,'2020_12_02_233754_add_first_post_id_to_threads',5); +INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (113,'2021_07_31_094750_add_fk_indices',5);