This repository has been archived on 2023-08-30. You can view files and clone it, but cannot push or open issues or pull requests.
l9_stud_bot/database/tg.sql

21 lines
898 B
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- Сведения о пользователях бота Telegram
CREATE TABLE IF NOT EXISTS `tg_users` (
`l9Id` bigint NOT NULL,
-- Идентификатор пользователя системы
`tgId` bigint NOT NULL,
-- ID пользователя в Telegram
`name` TEXT,
-- (optional) Имя пользователя в Telegram
`posTag` varchar(30) DEFAULT 'not_started',
-- Позиция пользователя в диалоге с ботом:
-- (default) not_started - только что вступил в диалог
-- add - добавляет группу
-- conf_{groupId} - пользователь на стадии подтверждения выбранной группы
-- ready - готов к работе
PRIMARY KEY (`l9Id`),
CONSTRAINT `l9_tg` FOREIGN KEY (`l9Id`) REFERENCES `users` (`l9Id`) ON DELETE CASCADE ON UPDATE CASCADE
);