diff options
author | Sunil Shetye | 2025-06-11 23:34:50 +0530 |
---|---|---|
committer | Sunil Shetye | 2025-06-11 23:35:18 +0530 |
commit | 11f7483b67638433135c0e19c663dee25edee985 (patch) | |
tree | ec4829933a2c9ebaa2638fd24c4cd76c532d5312 | |
parent | 7a7d8a54f5fad5d787fee5ea6a05c395a7667ffa (diff) | |
download | Common-Interface-Project-11f7483b67638433135c0e19c663dee25edee985.tar.gz Common-Interface-Project-11f7483b67638433135c0e19c663dee25edee985.tar.bz2 Common-Interface-Project-11f7483b67638433135c0e19c663dee25edee985.zip |
delete from statesave table after gallery images are updated
-rw-r--r-- | blocks/update_media.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/blocks/update_media.py b/blocks/update_media.py index dcfdb5c0..1500c4f7 100644 --- a/blocks/update_media.py +++ b/blocks/update_media.py @@ -69,6 +69,11 @@ def join_and_copy_images(db_path, statesave_table, gallery_table): print("All image copy operations completed.") + sql = f"DELETE FROM {statesave_table} WHERE description IN ( SELECT description FROM {gallery_table} );" + cursor.execute(sql) + print(f"Rows deleted: {cursor.rowcount}") + conn.commit() + except sqlite3.Error as e: print(f"An error occurred while querying the database: {e}") |