bot
This commit is contained in:
@@ -76,6 +76,7 @@ class CVEHandler:
|
||||
cwe_ids TEXT,
|
||||
affected_products TEXT,
|
||||
raw_data TEXT,
|
||||
discord_notified INTEGER DEFAULT 0,
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
|
||||
)
|
||||
@@ -98,6 +99,18 @@ class CVEHandler:
|
||||
cursor.execute("CREATE INDEX IF NOT EXISTS idx_published_date ON cve_cache(published_date DESC)")
|
||||
cursor.execute("CREATE INDEX IF NOT EXISTS idx_cvss_score ON cve_cache(cvss_score DESC)")
|
||||
cursor.execute("CREATE INDEX IF NOT EXISTS idx_updated_at ON cve_cache(updated_at DESC)")
|
||||
cursor.execute("CREATE INDEX IF NOT EXISTS idx_discord_notified ON cve_cache(discord_notified)")
|
||||
|
||||
cursor.execute("PRAGMA table_info(cve_cache)")
|
||||
columns = [col[1] for col in cursor.fetchall()]
|
||||
|
||||
if 'discord_notified' not in columns:
|
||||
logger.info("Adding discord_notified column to existing table...")
|
||||
cursor.execute("""
|
||||
ALTER TABLE cve_cache
|
||||
ADD COLUMN discord_notified INTEGER DEFAULT 0
|
||||
""")
|
||||
logger.info("✓ Column added successfully")
|
||||
|
||||
logger.info(f"Database initialized at {self.db_path}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user