Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
TelegramBot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
TelegramBot
Commits
c917fa71
Commit
c917fa71
authored
Mar 04, 2016
by
MBoretto
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'structure' into feature/smartinterface
parents
7238e75f
146ddc95
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
structure.sql
structure.sql
+8
-8
No files found.
structure.sql
View file @
c917fa71
CREATE
TABLE
IF
NOT
EXISTS
`user`
(
`id`
bigint
NULL
DEFAULT
NULL
COMMENT
'Unique user identifier'
,
`id`
bigint
COMMENT
'Unique user identifier'
,
`first_name`
CHAR
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'User first name'
,
`last_name`
CHAR
(
255
)
DEFAULT
NULL
COMMENT
'User last name'
,
`username`
CHAR
(
255
)
DEFAULT
NULL
COMMENT
'User username'
,
...
...
@@ -10,7 +10,7 @@ CREATE TABLE IF NOT EXISTS `user` (
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
COLLATE
=
utf8_general_ci
;
CREATE
TABLE
IF
NOT
EXISTS
`chat`
(
`id`
bigint
NULL
DEFAULT
NULL
COMMENT
'Unique user or chat identifier'
,
`id`
bigint
COMMENT
'Unique user or chat identifier'
,
`type`
ENUM
(
'private'
,
'group'
,
'supergroup'
,
'channel'
)
NOT
NULL
COMMENT
'chat type private, group, supergroup or channel'
,
`title`
CHAR
(
255
)
DEFAULT
''
COMMENT
'chat title null if case of single chat with the bot'
,
`created_at`
timestamp
NULL
DEFAULT
NULL
COMMENT
'Entry date creation'
,
...
...
@@ -20,8 +20,8 @@ CREATE TABLE IF NOT EXISTS `chat` (
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
COLLATE
=
utf8_general_ci
;
CREATE
TABLE
IF
NOT
EXISTS
`user_chat`
(
`user_id`
bigint
NULL
DEFAULT
NULL
COMMENT
'Unique user identifier'
,
`chat_id`
bigint
NULL
DEFAULT
NULL
COMMENT
'Unique user or chat identifier'
,
`user_id`
bigint
COMMENT
'Unique user identifier'
,
`chat_id`
bigint
COMMENT
'Unique user or chat identifier'
,
PRIMARY
KEY
(
`user_id`
,
`chat_id`
),
FOREIGN
KEY
(
`user_id`
)
REFERENCES
`user`
(
`id`
)
ON
DELETE
CASCADE
ON
UPDATE
CASCADE
,
...
...
@@ -31,7 +31,7 @@ CREATE TABLE IF NOT EXISTS `user_chat` (
CREATE
TABLE
IF
NOT
EXISTS
`inline_query`
(
`id`
bigint
UNSIGNED
NULL
COMMENT
'Unique identifier for this query.'
,
`id`
bigint
UNSIGNED
COMMENT
'Unique identifier for this query.'
,
`user_id`
bigint
NULL
COMMENT
'Sender'
,
`query`
CHAR
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'Text of the query'
,
`offset`
CHAR
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'Offset of the result'
,
...
...
@@ -45,7 +45,7 @@ CREATE TABLE IF NOT EXISTS `inline_query` (
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
COLLATE
=
utf8_general_ci
;
CREATE
TABLE
IF
NOT
EXISTS
`chosen_inline_query`
(
`id`
bigint
UNSIGNED
NULL
AUTO_INCREMENT
COMMENT
'Unique identifier for chosen query.'
,
`id`
bigint
UNSIGNED
AUTO_INCREMENT
COMMENT
'Unique identifier for chosen query.'
,
`result_id`
CHAR
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'Id of the chosen result'
,
`user_id`
bigint
NULL
COMMENT
'Sender'
,
`query`
CHAR
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'Text of the query'
,
...
...
@@ -59,7 +59,7 @@ CREATE TABLE IF NOT EXISTS `chosen_inline_query` (
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
COLLATE
=
utf8_general_ci
;
CREATE
TABLE
IF
NOT
EXISTS
`message`
(
`id`
bigint
UNSIGNED
NULL
COMMENT
'Unique message identifier'
,
`id`
bigint
UNSIGNED
COMMENT
'Unique message identifier'
,
`user_id`
bigint
NULL
COMMENT
'User identifier'
,
`chat_id`
bigint
NULL
DEFAULT
NULL
COMMENT
'Chat identifier.'
,
`date`
timestamp
NULL
DEFAULT
NULL
COMMENT
'Date the message was sent in timestamp format'
,
...
...
@@ -115,7 +115,7 @@ CREATE TABLE IF NOT EXISTS `message` (
CREATE
TABLE
IF
NOT
EXISTS
`telegram_update`
(
`id`
bigint
UNSIGNED
NULL
COMMENT
'The update
\'
s unique identifier.'
,
`id`
bigint
UNSIGNED
COMMENT
'The update
\'
s unique identifier.'
,
`message_id`
bigint
UNSIGNED
DEFAULT
NULL
COMMENT
'Unique message identifier'
,
`inline_query_id`
bigint
UNSIGNED
DEFAULT
NULL
COMMENT
'The query unique identifier.'
,
`chosen_inline_query_id`
bigint
UNSIGNED
DEFAULT
NULL
COMMENT
'The chosen query unique identifier.'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment