support more recente teloxide version

This commit is contained in:
2023-03-05 17:33:53 +03:00
parent efede10312
commit 3f348d32cc
11 changed files with 647 additions and 126 deletions

28
db/001_initial.sql Normal file
View File

@ -0,0 +1,28 @@
CREATE TABLE IF NOT EXISTS users (
`user_id` integer NOT NULL PRIMARY KEY AUTOINCREMENT,
`chat_id` integer NOT NULL UNIQUE,
`name` VARCHAR(64) NOT NULL,
created_at datetime NOT NULL
);
CREATE TABLE IF NOT EXISTS parameters (
`param_id` integer NOT NULL PRIMARY KEY AUTOINCREMENT,
`user_id` integer NOT NULL,
`key` VARCHAR(64) NOT NULL,
`value` VARCHAR(64) NOT NULL,
FOREIGN KEY(user_id)
REFERENCES users(user_id)
ON DELETE CASCADE
);
CREATE UNIQUE INDEX IF NOT EXISTS actions_action_id_user_id_idx
ON parameters (`user_id`, `key`);
CREATE TABLE IF NOT EXISTS actions (
`action_id` integer NOT NULL PRIMARY KEY AUTOINCREMENT,
`user_id` integer NOT NULL,
`name` VARCHAR(64) NOT NULL,
FOREIGN KEY(user_id)
REFERENCES users(user_id)
ON DELETE CASCADE
);