qwen_agent/drop_mem0_tables.py
朱潮 425f3c5bb4 chore: replace Chinese comments and log messages with English
Convert all Chinese comments, docstrings, logger/print output,
HTTPException detail messages, and API response messages to English
across the entire codebase. Functional zh/ja localized strings
(e.g. prompt templates, timezone display names, date formats) are
preserved as-is.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-30 19:45:35 +08:00

28 lines
604 B
Python

#!/usr/bin/env python
"""Drop all mem0-related tables"""
import psycopg2
from utils.settings import CHECKPOINT_DB_URL
conn = psycopg2.connect(CHECKPOINT_DB_URL)
cursor = conn.cursor()
# Find all tables starting with mem0
cursor.execute("""
SELECT tablename FROM pg_tables
WHERE schemaname = 'public' AND tablename LIKE 'mem0_%'
""")
tables = cursor.fetchall()
print('Found tables:', tables)
# Drop each table
for (table,) in tables:
cursor.execute(f'DROP TABLE IF EXISTS {table} CASCADE')
print(f'Dropped: {table}')
conn.commit()
cursor.close()
conn.close()
print('Drop completed')