Skip to content

Commit dad24fc

Browse files
committed
Change database column comments for new installs.
1 parent 46a6cad commit dad24fc

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

structure.sql

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
CREATE TABLE IF NOT EXISTS `user` (
2-
`id` bigint COMMENT 'Unique user identifier',
3-
`is_bot` tinyint(1) DEFAULT 0 COMMENT 'True if this user is a bot',
4-
`first_name` CHAR(255) NOT NULL DEFAULT '' COMMENT 'User''s first name',
5-
`last_name` CHAR(255) DEFAULT NULL COMMENT 'User''s last name',
6-
`username` CHAR(191) DEFAULT NULL COMMENT 'User''s username',
7-
`language_code` CHAR(10) DEFAULT NULL COMMENT 'User''s system language',
2+
`id` bigint COMMENT 'Unique identifier for this user or bot',
3+
`is_bot` tinyint(1) DEFAULT 0 COMMENT 'True, if this user is a bot',
4+
`first_name` CHAR(255) NOT NULL DEFAULT '' COMMENT 'User''s or bot''s first name',
5+
`last_name` CHAR(255) DEFAULT NULL COMMENT 'User''s or bot''s last name',
6+
`username` CHAR(191) DEFAULT NULL COMMENT 'User''s or bot''s username',
7+
`language_code` CHAR(10) DEFAULT NULL COMMENT 'IETF language tag of the user''s language',
88
`created_at` timestamp NULL DEFAULT NULL COMMENT 'Entry date creation',
99
`updated_at` timestamp NULL DEFAULT NULL COMMENT 'Entry date update',
1010

@@ -13,9 +13,9 @@ CREATE TABLE IF NOT EXISTS `user` (
1313
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
1414

1515
CREATE TABLE IF NOT EXISTS `chat` (
16-
`id` bigint COMMENT 'Unique user or chat identifier',
17-
`type` ENUM('private', 'group', 'supergroup', 'channel') NOT NULL COMMENT 'Chat type, either private, group, supergroup or channel',
18-
`title` CHAR(255) DEFAULT '' COMMENT 'Chat (group) title, is null if chat type is private',
16+
`id` bigint COMMENT 'Unique identifier for this chat',
17+
`type` ENUM('private', 'group', 'supergroup', 'channel') NOT NULL COMMENT 'Type of chat, can be either private, group, supergroup or channel',
18+
`title` CHAR(255) DEFAULT '' COMMENT 'Title, for supergroups, channels and group chats',
1919
`username` CHAR(255) DEFAULT NULL COMMENT 'Username, for private chats, supergroups and channels if available',
2020
`first_name` CHAR(255) DEFAULT NULL COMMENT 'First name of the other party in a private chat',
2121
`last_name` CHAR(255) DEFAULT NULL COMMENT 'Last name of the other party in a private chat',
@@ -54,9 +54,9 @@ CREATE TABLE IF NOT EXISTS `inline_query` (
5454

5555
CREATE TABLE IF NOT EXISTS `chosen_inline_result` (
5656
`id` bigint UNSIGNED AUTO_INCREMENT COMMENT 'Unique identifier for this entry',
57-
`result_id` CHAR(255) NOT NULL DEFAULT '' COMMENT 'Identifier for this result',
58-
`user_id` bigint NULL COMMENT 'Unique user identifier',
59-
`location` CHAR(255) NULL DEFAULT NULL COMMENT 'Location object, user''s location',
57+
`result_id` CHAR(255) NOT NULL DEFAULT '' COMMENT 'The unique identifier for the result that was chosen',
58+
`user_id` bigint NULL COMMENT 'The user that chose the result',
59+
`location` CHAR(255) NULL DEFAULT NULL COMMENT 'Sender location, only for bots that require user location',
6060
`inline_message_id` CHAR(255) NULL DEFAULT NULL COMMENT 'Identifier of the sent inline message',
6161
`query` TEXT NOT NULL COMMENT 'The query that was used to obtain the result',
6262
`created_at` timestamp NULL DEFAULT NULL COMMENT 'Entry date creation',
@@ -79,25 +79,25 @@ CREATE TABLE IF NOT EXISTS `message` (
7979
`forward_date` timestamp NULL DEFAULT NULL COMMENT 'date the original message was sent in timestamp format',
8080
`reply_to_chat` bigint NULL DEFAULT NULL COMMENT 'Unique chat identifier',
8181
`reply_to_message` bigint UNSIGNED DEFAULT NULL COMMENT 'Message that this message is reply to',
82-
`edit_date` bigint UNSIGNED DEFAULT NULL COMMENT 'Optional. Date the message was last edited in Unix time',
82+
`edit_date` bigint UNSIGNED DEFAULT NULL COMMENT 'Date the message was last edited in Unix time',
8383
`media_group_id` TEXT COMMENT 'The unique identifier of a media message group this message belongs to',
8484
`author_signature` TEXT COMMENT 'Signature of the post author for messages in channels',
8585
`text` TEXT COMMENT 'For text messages, the actual UTF-8 text of the message max message length 4096 char utf8mb4',
8686
`entities` TEXT COMMENT 'For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text',
8787
`caption_entities` TEXT COMMENT 'For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption',
8888
`audio` TEXT COMMENT 'Audio object. Message is an audio file, information about the file',
8989
`document` TEXT COMMENT 'Document object. Message is a general file, information about the file',
90-
`animation` TEXT COMMENT 'Optional. Message is an animation, information about the animation',
90+
`animation` TEXT COMMENT 'Message is an animation, information about the animation',
9191
`game` TEXT COMMENT 'Game object. Message is a game, information about the game',
9292
`photo` TEXT COMMENT 'Array of PhotoSize objects. Message is a photo, available sizes of the photo',
9393
`sticker` TEXT COMMENT 'Sticker object. Message is a sticker, information about the sticker',
9494
`video` TEXT COMMENT 'Video object. Message is a video, information about the video',
9595
`voice` TEXT COMMENT 'Voice Object. Message is a Voice, information about the Voice',
9696
`video_note` TEXT COMMENT 'VoiceNote Object. Message is a Video Note, information about the Video Note',
97+
`caption` TEXT COMMENT 'For message with caption, the actual UTF-8 text of the caption',
9798
`contact` TEXT COMMENT 'Contact object. Message is a shared contact, information about the contact',
9899
`location` TEXT COMMENT 'Location object. Message is a shared location, information about the location',
99100
`venue` TEXT COMMENT 'Venue object. Message is a Venue, information about the Venue',
100-
`caption` TEXT COMMENT 'For message with caption, the actual UTF-8 text of the caption',
101101
`new_chat_members` TEXT COMMENT 'List of unique user identifiers, new member(s) were added to the group, information about them (one of these members may be the bot itself)',
102102
`left_chat_member` bigint NULL DEFAULT NULL COMMENT 'Unique user identifier, a member was removed from the group, information about them (this member may be the bot itself)',
103103
`new_chat_title` CHAR(255) DEFAULT NULL COMMENT 'A chat title was changed to this value',
@@ -175,11 +175,11 @@ CREATE TABLE IF NOT EXISTS `edited_message` (
175175
CREATE TABLE IF NOT EXISTS `telegram_update` (
176176
`id` bigint UNSIGNED COMMENT 'Update''s unique identifier',
177177
`chat_id` bigint NULL DEFAULT NULL COMMENT 'Unique chat identifier',
178-
`message_id` bigint UNSIGNED DEFAULT NULL COMMENT 'Unique message identifier',
179-
`inline_query_id` bigint UNSIGNED DEFAULT NULL COMMENT 'Unique inline query identifier',
180-
`chosen_inline_result_id` bigint UNSIGNED DEFAULT NULL COMMENT 'Local chosen inline result identifier',
181-
`callback_query_id` bigint UNSIGNED DEFAULT NULL COMMENT 'Unique callback query identifier',
182-
`edited_message_id` bigint UNSIGNED DEFAULT NULL COMMENT 'Local edited message identifier',
178+
`message_id` bigint UNSIGNED DEFAULT NULL COMMENT 'New incoming message of any kind - text, photo, sticker, etc.',
179+
`edited_message_id` bigint UNSIGNED DEFAULT NULL COMMENT 'New version of a message that is known to the bot and was edited',
180+
`inline_query_id` bigint UNSIGNED DEFAULT NULL COMMENT 'New incoming inline query',
181+
`chosen_inline_result_id` bigint UNSIGNED DEFAULT NULL COMMENT 'The result of an inline query that was chosen by a user and sent to their chat partner',
182+
`callback_query_id` bigint UNSIGNED DEFAULT NULL COMMENT 'New incoming callback query',
183183

184184
PRIMARY KEY (`id`),
185185
KEY `message_id` (`chat_id`, `message_id`),

utils/db-schema-update/0.54.0-unreleased.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
ALTER TABLE `chat` ADD COLUMN `first_name` CHAR(255) DEFAULT NULL COMMENT 'First name of the other party in a private chat' AFTER `username`;
22
ALTER TABLE `chat` ADD COLUMN `last_name` CHAR(255) DEFAULT NULL COMMENT 'Last name of the other party in a private chat' AFTER `first_name`;
3-
ALTER TABLE `message` ADD COLUMN `animation` TEXT NULL COMMENT 'Optional. Message is an animation, information about the animation' AFTER `document`;
3+
ALTER TABLE `message` ADD COLUMN `animation` TEXT NULL COMMENT 'Message is an animation, information about the animation' AFTER `document`;
44
ALTER TABLE `message` ADD COLUMN `forward_signature` TEXT COMMENT 'For messages forwarded from channels, signature of the post author if present' AFTER `forward_from_message_id`;
5-
ALTER TABLE `message` ADD COLUMN `edit_date` bigint UNSIGNED DEFAULT NULL COMMENT 'Optional. Date the message was last edited in Unix time' AFTER `reply_to_message`;
5+
ALTER TABLE `message` ADD COLUMN `edit_date` bigint UNSIGNED DEFAULT NULL COMMENT 'Date the message was last edited in Unix time' AFTER `reply_to_message`;
66
ALTER TABLE `message` ADD COLUMN `author_signature` TEXT COMMENT 'Signature of the post author for messages in channels' AFTER `media_group_id`;
77
ALTER TABLE `message` ADD COLUMN `caption_entities` TEXT COMMENT 'For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption';
88
ALTER TABLE `message` ADD COLUMN `invoice` TEXT NULL COMMENT 'Message is an invoice for a payment, information about the invoice' AFTER `pinned_message`;

0 commit comments

Comments
 (0)