Skip to content

Commit 3cddf7b

Browse files
committed
Merge pull request #115 from MBoretto/structure
2 parents 7cc8cfc + 146ddc9 commit 3cddf7b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

structure.sql

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CREATE TABLE IF NOT EXISTS `user` (
2-
`id` bigint NULL DEFAULT NULL COMMENT 'Unique user identifier',
2+
`id` bigint COMMENT 'Unique user identifier',
33
`first_name` CHAR(255) NOT NULL DEFAULT '' COMMENT 'User first name',
44
`last_name` CHAR(255) DEFAULT NULL COMMENT 'User last name',
55
`username` CHAR(255) DEFAULT NULL COMMENT 'User username',
@@ -10,7 +10,7 @@ CREATE TABLE IF NOT EXISTS `user` (
1010
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
1111

1212
CREATE TABLE IF NOT EXISTS `chat` (
13-
`id` bigint NULL DEFAULT NULL COMMENT 'Unique user or chat identifier',
13+
`id` bigint COMMENT 'Unique user or chat identifier',
1414
`type` ENUM('private', 'group', 'supergroup', 'channel') NOT NULL COMMENT 'chat type private, group, supergroup or channel',
1515
`title` CHAR(255) DEFAULT '' COMMENT 'chat title null if case of single chat with the bot',
1616
`created_at` timestamp NULL DEFAULT NULL COMMENT 'Entry date creation',
@@ -20,8 +20,8 @@ CREATE TABLE IF NOT EXISTS `chat` (
2020
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
2121

2222
CREATE TABLE IF NOT EXISTS `user_chat` (
23-
`user_id` bigint NULL DEFAULT NULL COMMENT 'Unique user identifier',
24-
`chat_id` bigint NULL DEFAULT NULL COMMENT 'Unique user or chat identifier',
23+
`user_id` bigint COMMENT 'Unique user identifier',
24+
`chat_id` bigint COMMENT 'Unique user or chat identifier',
2525
PRIMARY KEY (`user_id`, `chat_id`),
2626
FOREIGN KEY (`user_id`) REFERENCES `user` (`id`)
2727
ON DELETE CASCADE ON UPDATE CASCADE,
@@ -31,7 +31,7 @@ CREATE TABLE IF NOT EXISTS `user_chat` (
3131

3232

3333
CREATE TABLE IF NOT EXISTS `inline_query` (
34-
`id` bigint UNSIGNED NULL COMMENT 'Unique identifier for this query.',
34+
`id` bigint UNSIGNED COMMENT 'Unique identifier for this query.',
3535
`user_id` bigint NULL COMMENT 'Sender',
3636
`query` CHAR(255) NOT NULL DEFAULT '' COMMENT 'Text of the query',
3737
`offset` CHAR(255) NOT NULL DEFAULT '' COMMENT 'Offset of the result',
@@ -45,7 +45,7 @@ CREATE TABLE IF NOT EXISTS `inline_query` (
4545
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
4646

4747
CREATE TABLE IF NOT EXISTS `chosen_inline_query` (
48-
`id` bigint UNSIGNED NULL AUTO_INCREMENT COMMENT 'Unique identifier for chosen query.',
48+
`id` bigint UNSIGNED AUTO_INCREMENT COMMENT 'Unique identifier for chosen query.',
4949
`result_id` CHAR(255) NOT NULL DEFAULT '' COMMENT 'Id of the chosen result',
5050
`user_id` bigint NULL COMMENT 'Sender',
5151
`query` CHAR(255) NOT NULL DEFAULT '' COMMENT 'Text of the query',
@@ -59,7 +59,7 @@ CREATE TABLE IF NOT EXISTS `chosen_inline_query` (
5959
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
6060

6161
CREATE TABLE IF NOT EXISTS `message` (
62-
`id` bigint UNSIGNED NULL COMMENT 'Unique message identifier',
62+
`id` bigint UNSIGNED COMMENT 'Unique message identifier',
6363
`user_id` bigint NULL COMMENT 'User identifier',
6464
`chat_id` bigint NULL DEFAULT NULL COMMENT 'Chat identifier.',
6565
`date` timestamp NULL DEFAULT NULL COMMENT 'Date the message was sent in timestamp format',
@@ -115,7 +115,7 @@ CREATE TABLE IF NOT EXISTS `message` (
115115

116116

117117
CREATE TABLE IF NOT EXISTS `telegram_update` (
118-
`id` bigint UNSIGNED NULL COMMENT 'The update\'s unique identifier.',
118+
`id` bigint UNSIGNED COMMENT 'The update\'s unique identifier.',
119119
`message_id` bigint UNSIGNED DEFAULT NULL COMMENT 'Unique message identifier',
120120
`inline_query_id` bigint UNSIGNED DEFAULT NULL COMMENT 'The query unique identifier.',
121121
`chosen_inline_query_id` bigint UNSIGNED DEFAULT NULL COMMENT 'The chosen query unique identifier.',

0 commit comments

Comments
 (0)