some changes?
This commit is contained in:
@ -1,5 +1,3 @@
|
||||
BEGIN;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS users (
|
||||
`user_id` integer NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
`chat_id` integer NOT NULL UNIQUE,
|
||||
@ -29,8 +27,6 @@ CREATE TABLE IF NOT EXISTS actions (
|
||||
ON DELETE CASCADE
|
||||
);
|
||||
|
||||
COMMIT;
|
||||
|
||||
-- drop index actions_action_id_user_id_idx;
|
||||
-- drop table users;
|
||||
-- drop table parameters;
|
||||
|
||||
12
db/002_subscribers.sql
Normal file
12
db/002_subscribers.sql
Normal file
@ -0,0 +1,12 @@
|
||||
CREATE TABLE IF NOT EXISTS `subscribers` (
|
||||
`subscriber_id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
`user_id` INTEGER NOT NULL,
|
||||
`kind` VARCHAR(16) NOT NULL,
|
||||
`arguments` JSON NOT NULL DEFAULT '{}',
|
||||
FOREIGN KEY(`user_id`)
|
||||
REFERENCES users(user_id)
|
||||
ON DELETE CASCADE
|
||||
);
|
||||
|
||||
CREATE UNIQUE INDEX IF NOT EXISTS subscribers_kind_user_id
|
||||
ON subscribers (`kind`, `user_id`);
|
||||
Reference in New Issue
Block a user