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 67FD680D4E; Mon, 19 Sep 2022 07:27:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1663572448; bh=TeeVA7WwMSLBglbA5YmZbGk5y5uw34X/t0VgGjoUe8s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d/2BImW748fSl6+ocTv8DxthKGG7kf9Usy68z8ARmPZCUkY1+bboF6tD7yXOq8NGR u1FNIqo5aHVIHwirSo0qDQuna25pyX9SxMTDk/ADd1k9ZBcw6pVhQDaqiulrgBqbzX aKc9cwFXRpy5DYvmxSo+kvhh7xw8KUJNz4/vEXOTDZhUOC7S2VZcF4/rCzkxIm9u6v y9CeyKC1vThHAL3qDRhEkx/qdaoei74WEdjFAPDzL1OLAKkfdPzJhx+SzFMqX63FoL eK/A6a85tWxy9m+VVpSEXRdL8hRwvMW4DmLEk1U0aGjocYTYVUziLDA6p5K6yQw5ni W97PbH1jgtDWg== From: Muhammad Rizki To: Ammar Faizi Cc: Muhammad Rizki , Alviro Iskandar Setiawan , GNU/Weeb Mailing List Subject: [RFC PATCH v3 12/17] discord: Add database tables for Discord bot Date: Mon, 19 Sep 2022 14:26:36 +0700 Message-Id: <20220919072641.996-13-kiizuha@gnuweeb.org> X-Mailer: git-send-email 2.34.1.windows.1 In-Reply-To: <20220919072641.996-1-kiizuha@gnuweeb.org> References: <20220919072641.996-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