1
1
CREATE TABLE IF NOT EXISTS ` user` (
2
- ` id` bigint NULL DEFAULT NULL COMMENT ' Unique user identifier' ,
2
+ ` id` bigint COMMENT ' Unique user identifier' ,
3
3
` first_name` CHAR (255 ) NOT NULL DEFAULT ' ' COMMENT ' User first name' ,
4
4
` last_name` CHAR (255 ) DEFAULT NULL COMMENT ' User last name' ,
5
5
` username` CHAR (255 ) DEFAULT NULL COMMENT ' User username' ,
@@ -10,7 +10,7 @@ CREATE TABLE IF NOT EXISTS `user` (
10
10
) ENGINE= InnoDB DEFAULT CHARSET= utf8 COLLATE= utf8_general_ci;
11
11
12
12
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' ,
14
14
` type` ENUM(' private' , ' group' , ' supergroup' , ' channel' ) NOT NULL COMMENT ' chat type private, group, supergroup or channel' ,
15
15
` title` CHAR (255 ) DEFAULT ' ' COMMENT ' chat title null if case of single chat with the bot' ,
16
16
` created_at` timestamp NULL DEFAULT NULL COMMENT ' Entry date creation' ,
@@ -20,8 +20,8 @@ CREATE TABLE IF NOT EXISTS `chat` (
20
20
) ENGINE= InnoDB DEFAULT CHARSET= utf8 COLLATE= utf8_general_ci;
21
21
22
22
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' ,
25
25
PRIMARY KEY (` user_id` , ` chat_id` ),
26
26
FOREIGN KEY (` user_id` ) REFERENCES ` user` (` id` )
27
27
ON DELETE CASCADE ON UPDATE CASCADE,
@@ -31,7 +31,7 @@ CREATE TABLE IF NOT EXISTS `user_chat` (
31
31
32
32
33
33
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.' ,
35
35
` user_id` bigint NULL COMMENT ' Sender' ,
36
36
` query` CHAR (255 ) NOT NULL DEFAULT ' ' COMMENT ' Text of the query' ,
37
37
` offset` CHAR (255 ) NOT NULL DEFAULT ' ' COMMENT ' Offset of the result' ,
@@ -45,7 +45,7 @@ CREATE TABLE IF NOT EXISTS `inline_query` (
45
45
) ENGINE= InnoDB DEFAULT CHARSET= utf8 COLLATE= utf8_general_ci;
46
46
47
47
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.' ,
49
49
` result_id` CHAR (255 ) NOT NULL DEFAULT ' ' COMMENT ' Id of the chosen result' ,
50
50
` user_id` bigint NULL COMMENT ' Sender' ,
51
51
` query` CHAR (255 ) NOT NULL DEFAULT ' ' COMMENT ' Text of the query' ,
@@ -59,7 +59,7 @@ CREATE TABLE IF NOT EXISTS `chosen_inline_query` (
59
59
) ENGINE= InnoDB DEFAULT CHARSET= utf8 COLLATE= utf8_general_ci;
60
60
61
61
CREATE TABLE IF NOT EXISTS ` message` (
62
- ` id` bigint UNSIGNED NULL COMMENT ' Unique message identifier' ,
62
+ ` id` bigint UNSIGNED COMMENT ' Unique message identifier' ,
63
63
` user_id` bigint NULL COMMENT ' User identifier' ,
64
64
` chat_id` bigint NULL DEFAULT NULL COMMENT ' Chat identifier.' ,
65
65
` date` timestamp NULL DEFAULT NULL COMMENT ' Date the message was sent in timestamp format' ,
@@ -115,7 +115,7 @@ CREATE TABLE IF NOT EXISTS `message` (
115
115
116
116
117
117
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.' ,
119
119
` message_id` bigint UNSIGNED DEFAULT NULL COMMENT ' Unique message identifier' ,
120
120
` inline_query_id` bigint UNSIGNED DEFAULT NULL COMMENT ' The query unique identifier.' ,
121
121
` chosen_inline_query_id` bigint UNSIGNED DEFAULT NULL COMMENT ' The chosen query unique identifier.' ,
0 commit comments