Add PostgreSQL, user/squad management, remove private domains from docs
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
CREATE TABLE IF NOT EXISTS telegram_users (
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
telegram_id BIGINT NOT NULL UNIQUE,
|
||||
username TEXT,
|
||||
first_name TEXT,
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS vpn_users (
|
||||
id BIGSERIAL PRIMARY KEY,
|
||||
telegram_id BIGINT,
|
||||
remnawave_uuid UUID NOT NULL UNIQUE,
|
||||
remnawave_username VARCHAR(36) NOT NULL,
|
||||
external_squad_uuid UUID,
|
||||
internal_squad_uuids UUID[] NOT NULL DEFAULT '{}',
|
||||
expire_at TIMESTAMPTZ,
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
||||
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_vpn_users_telegram ON vpn_users(telegram_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_vpn_users_username ON vpn_users(remnawave_username);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS admin_wizard (
|
||||
admin_telegram_id BIGINT PRIMARY KEY,
|
||||
step TEXT NOT NULL,
|
||||
data JSONB NOT NULL DEFAULT '{}',
|
||||
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
||||
);
|
||||
Reference in New Issue
Block a user