add device_limit in tariffs

This commit is contained in:
Vladless
2025-05-16 07:09:18 +03:00
parent 9a042c638a
commit 4d337e3df5
9 changed files with 84 additions and 30 deletions
+3
View File
@@ -200,12 +200,15 @@ CREATE TABLE IF NOT EXISTS tariffs (
duration_days INTEGER NOT NULL CHECK (duration_days > 0),
price_rub INTEGER NOT NULL CHECK (price_rub >= 0),
traffic_limit BIGINT,
device_limit INTEGER,
is_active BOOLEAN NOT NULL DEFAULT TRUE,
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
ALTER TABLE servers ADD COLUMN IF NOT EXISTS tariff_group TEXT;
ALTER TABLE tariffs
ADD COLUMN IF NOT EXISTS device_limit INTEGER;
DO $$