try fix uid unique error
All checks were successful
Build and Deploy MITM Webserver / traffic_target (push) Successful in 0s
Build and Deploy MITM Webserver / build (push) Successful in 11s

This commit is contained in:
2026-04-12 20:19:52 +02:00
parent 89f1f00b16
commit b974b45bb2
2 changed files with 4 additions and 1 deletions

View File

@@ -234,6 +234,8 @@ class DatabasePool:
ADD COLUMN IF NOT EXISTS capture_observations JSONB
"""
)
await conn.execute("DROP INDEX IF EXISTS idx_packets_packet_uid")
await conn.execute("CREATE INDEX IF NOT EXISTS idx_packets_packet_uid ON packets(packet_uid)")
logger.info("DB pool initialized")
except Exception:
logger.exception("Failed to create DB pool")

View File

@@ -102,7 +102,8 @@ CREATE TABLE IF NOT EXISTS packets (
);
ALTER TABLE packets ADD COLUMN IF NOT EXISTS capture_observations JSONB;
CREATE UNIQUE INDEX IF NOT EXISTS idx_packets_correlation_key ON packets(correlation_key);
CREATE UNIQUE INDEX IF NOT EXISTS idx_packets_packet_uid ON packets(packet_uid);
DROP INDEX IF EXISTS idx_packets_packet_uid;
CREATE INDEX IF NOT EXISTS idx_packets_packet_uid ON packets(packet_uid);
CREATE INDEX IF NOT EXISTS idx_packets_flow_id ON packets(flow_id);
EOF