From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NO_DNS_FOR_FROM,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from localhost.localdomain (unknown [101.128.125.100]) by gnuweeb.org (Postfix) with ESMTPSA id 1C02E80DD3; Tue, 13 Sep 2022 10:26:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1663064783; bh=TeeVA7WwMSLBglbA5YmZbGk5y5uw34X/t0VgGjoUe8s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ARBwpUoJMvhhueHlpPjOV2sEKKmNPtLHoXbZgSk1aHMMoN0QJTo63HW8ITmsTMW61 WQfYYPhmv2j9ESxymfekuLOBH4EsveO3yAkDLKcBJLesR+oAlI4JPcllufbTSIyMSd uf6ceE4OLkT0MK6ILZIHLXyUTZc+wszcWoi2mKLroa8g06hfIlH5cwBY72e10+nQsB wzdIeFULeTkxGabGuaHaTf28mW0/y/IjICWWA9W/K85MhbNvA7wMN0XhxRmg7HIqx2 snS3lKNnC4aWIiz8APmXyqhEA7AOGTDN1ioLrtIJocBcXNJUqwt/iX2ugWgYuoII4W g9iB2lPPa+/0A== From: Muhammad Rizki To: Ammar Faizi Cc: Muhammad Rizki , Alviro Iskandar Setiawan , GNU/Weeb Mailing List Subject: [RFC PATCH v2 12/17] discord: Add database tables for Discord bot Date: Tue, 13 Sep 2022 17:24:53 +0700 Message-Id: <20220913102458.615-13-kiizuha@gnuweeb.org> X-Mailer: git-send-email 2.34.1.windows.1 In-Reply-To: <20220913102458.615-1-kiizuha@gnuweeb.org> References: <20220913102458.615-1-kiizuha@gnuweeb.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Add some tables for Discord bot in the same database with Telegram bot in db.sql Signed-off-by: Muhammad Rizki --- daemon/db.sql | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/daemon/db.sql b/daemon/db.sql index c55c464..d7665db 100644 --- a/daemon/db.sql +++ b/daemon/db.sql @@ -59,4 +59,60 @@ CREATE TABLE `tg_broadcasts` ( KEY `created_at` (`created_at`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; +-- [ SPLITTER ] ------------------------------------------------------------------------------ + +DROP TABLE IF EXISTS `dc_emails`; +CREATE TABLE `dc_emails` ( + `id` bigint unsigned NOT NULL AUTO_INCREMENT, + `message_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, + `created_at` datetime NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `message_id` (`message_id`), + KEY `created_at` (`created_at`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; + + +DROP TABLE IF EXISTS `dc_mail_msg`; +CREATE TABLE `dc_mail_msg` ( + `id` bigint unsigned NOT NULL AUTO_INCREMENT, + `email_id` bigint unsigned NOT NULL, + `channel_id` bigint NOT NULL, + `dc_msg_id` bigint unsigned NOT NULL, + `created_at` datetime NOT NULL, + PRIMARY KEY (`id`), + KEY `email_id` (`email_id`), + KEY `channel_id` (`channel_id`), + KEY `dc_msg_id` (`dc_msg_id`), + KEY `created_at` (`created_at`), + CONSTRAINT `dc_mail_msg_ibfk_2` FOREIGN KEY (`email_id`) REFERENCES `dc_emails` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; + + +DROP TABLE IF EXISTS `dc_atoms`; +CREATE TABLE `dc_atoms` ( + `id` bigint unsigned NOT NULL AUTO_INCREMENT, + `url` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, + `created_at` datetime NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `url` (`url`), + KEY `created_at` (`created_at`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; + + +DROP TABLE IF EXISTS `dc_broadcasts`; +CREATE TABLE `dc_broadcasts` ( + `id` bigint unsigned NOT NULL AUTO_INCREMENT, + `guild_id` BIGINT UNSIGNED NOT NULL, + `channel_id` BIGINT UNSIGNED NOT NULL, + `channel_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, + `channel_link` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_ci NOT NULL, + `created_at` datetime NOT NULL, + PRIMARY KEY (`id`), + KEY `guild_id` (`guild_id`), + UNIQUE KEY `channel_id` (`channel_id`), + KEY `channel_name` (`channel_name`), + KEY `channel_link` (`channel_link`), + KEY `created_at` (`created_at`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci; + -- 2022-07-07 14:25:28 -- Muhammad Rizki