mirror of
https://github.com/x1xhlol/system-prompts-and-models-of-ai-tools.git
synced 2026-06-17 23:09:35 +00:00
fix(db): prevent duplicate audit seed on repeated init_db() calls
Guard: only seed audit chain if audit_log is empty. Prevents chain breaks when server restarts re-run init_db().
This commit is contained in:
parent
b56a2f388b
commit
8075e63c7e
@ -544,7 +544,10 @@ def _seed_sample_data(conn):
|
||||
'["صفقة أرامكو: تأخر RFP","تجديد Oracle: انتهاء العقد في 30 يوم"]',
|
||||
'["أغلق خصم البنك الأهلي — 25%","ادفع تجديد Oracle قبل الانتهاء","جدول kickoff مع Deloitte"]')""")
|
||||
|
||||
# Audit chain seed
|
||||
# Audit chain seed — only insert if no entries exist yet
|
||||
existing = conn.execute("SELECT COUNT(*) FROM audit_log").fetchone()[0]
|
||||
if existing > 0:
|
||||
return
|
||||
prev = "GENESIS"
|
||||
entries = [
|
||||
("dealix","revenue","lead_created","admin-001","lead-001","{}"),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user