mirror of
https://github.com/civsocit/olgram.git
synced 2023-07-22 01:29:12 +03:00
banned migration
This commit is contained in:
parent
68502b7756
commit
603ae506f2
11
olgram/migrations/models/6_20220119000000_banned.sql
Normal file
11
olgram/migrations/models/6_20220119000000_banned.sql
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
-- upgrade --
|
||||||
|
CREATE TABLE IF NOT EXISTS "bot_banned_user" (
|
||||||
|
"id" BIGSERIAL NOT NULL PRIMARY KEY,
|
||||||
|
"telegram_id" BIGINT NOT NULL,
|
||||||
|
"username" VARCHAR(100),
|
||||||
|
"bot_id" INT NOT NULL REFERENCES "bot" ("id") ON DELETE CASCADE
|
||||||
|
);
|
||||||
|
CREATE INDEX IF NOT EXISTS "idx_bot_banned__telegra_915aca" ON "bot_banned_user" ("telegram_id");
|
||||||
|
-- downgrade --
|
||||||
|
DROP TABLE IF EXISTS "bot_banned_user";
|
||||||
|
DROP INDEX IF EXISTS "idx_bot_banned__telegra_915aca";
|
Loading…
Reference in New Issue
Block a user