From db09f2786ec43f95e7afb2c0f3a207cfdcc716de Mon Sep 17 00:00:00 2001 From: oscarz Date: Sun, 23 Mar 2025 16:02:24 +0800 Subject: [PATCH] modify scripts --- aabook/src/alter_table.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aabook/src/alter_table.py b/aabook/src/alter_table.py index 78fba71..1fdb849 100644 --- a/aabook/src/alter_table.py +++ b/aabook/src/alter_table.py @@ -48,12 +48,12 @@ def check_dirty_chapters(): for i in range(100): table_name = f'{tbl_name_chapters_prefix}_{i}' try: - cursor.execute(f"SELECT count(*) FROM {table_name} WHERE created_at >= '2025-03-23 10:20:00' and created_at <= '2025-03-23 11:20:00' ") + cursor.execute(f"SELECT count(*) FROM {table_name} WHERE updated_at >= '2025-03-23 10:20:00' and updated_at <= '2025-03-23 11:20:00' ") row = cursor.fetchone() if row: dirty_chapters_all += row[0] - cursor.execute(f"SELECT count(*) FROM {table_name} WHERE created_at >= '2025-03-23 10:20:00' and created_at <= '2025-03-23 11:20:00' and content like '%aabook%' ") + cursor.execute(f"SELECT count(*) FROM {table_name} WHERE updated_at >= '2025-03-23 10:20:00' and updated_at <= '2025-03-23 11:20:00' and content like '%aabook%' ") row = cursor.fetchone() if row: dirty_chapters += row[0] @@ -70,7 +70,7 @@ def update_dirty_chapters(): for i in range(100): table_name = f'{tbl_name_chapters_prefix}_{i}' try: - cursor.execute(f"update {table_name} set has_content = 0 WHERE created_at >= '2025-03-23 10:20:00' and created_at <= '2025-03-23 11:20:00' ") + cursor.execute(f"update {table_name} set has_content = 0 WHERE updated_at >= '2025-03-23 10:20:00' and updated_at <= '2025-03-23 11:20:00' ") updated_rows = cursor.rowcount print(f"update {table_name}, affected rows: {updated_rows}")