v1.8.3: добавлена директория migrations/ и migrations_runner.py для SQL-миграций
Tests / test (push) Has been cancelled
Tests / test-max-bot (push) Has been cancelled

This commit is contained in:
2026-06-02 18:56:32 +03:00
parent e7f670f21c
commit 8c1486da8b
3 changed files with 86 additions and 0 deletions
@@ -0,0 +1,22 @@
-- Миграция: consent_revoked_date + bot_processing_logs
-- Дата: 02.06.2026
-- Описание: Добавление поля consent_revoked_date в bot_users и создание таблицы bot_processing_logs
-- 1. Consent revoked date
ALTER TABLE bot_users ADD COLUMN IF NOT EXISTS consent_revoked_date TIMESTAMP NULL;
-- 2. BotProcessingLog table
CREATE TABLE IF NOT EXISTS bot_processing_logs (
id BIGSERIAL PRIMARY KEY,
user_id BIGINT NOT NULL REFERENCES bot_users(id) ON DELETE CASCADE,
conversation_id BIGINT REFERENCES bot_conversations(id) ON DELETE SET NULL,
step VARCHAR(50) NOT NULL,
status VARCHAR(20) DEFAULT 'ok',
message TEXT,
detail TEXT,
created_at TIMESTAMP DEFAULT now()
);
-- Индексы для производительности
CREATE INDEX IF NOT EXISTS idx_bot_processing_logs_user_id ON bot_processing_logs(user_id);
CREATE INDEX IF NOT EXISTS idx_bot_processing_logs_conversation_id ON bot_processing_logs(conversation_id);