From 74a62b17f4a5e2d26a98b2e05be35503853f4fad Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 30 May 2013 23:49:00 +0530 Subject: [PATCH] [update file data 2 patch] [fix] auto commit on many writes for the duration of the patch --- patches/april_2013/p07_update_file_data_2.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/patches/april_2013/p07_update_file_data_2.py b/patches/april_2013/p07_update_file_data_2.py index 0cb44d0c20..548ba6cdc4 100644 --- a/patches/april_2013/p07_update_file_data_2.py +++ b/patches/april_2013/p07_update_file_data_2.py @@ -2,6 +2,8 @@ import webnotes def execute(): from patches.april_2013.p05_update_file_data import update_file_list, get_single_doctypes + webnotes.conn.auto_commit_on_many_writes = 1 + singles = get_single_doctypes() for doctype in webnotes.conn.sql_list("""select table_name from `information_schema`.`columns` where table_schema=%s and column_name='file_list'""", webnotes.conn.cur_db_name): @@ -13,4 +15,5 @@ def execute(): webnotes.conn.sql("""delete from `tabCustom Field` where fieldname='file_list' and parent=%s""", doctype) - \ No newline at end of file + + webnotes.conn.auto_commit_on_many_writes = 0 \ No newline at end of file