From 82ce223f1521e0292bbee12f318a659dd2842cee Mon Sep 17 00:00:00 2001 From: Andreas Granig Date: Tue, 26 Mar 2013 20:58:44 +0000 Subject: [PATCH] Use export fields for marker. --- db_scripts/diff/13288.down | 7 +++++++ db_scripts/diff/13288.up | 8 ++++++++ 2 files changed, 15 insertions(+) create mode 100644 db_scripts/diff/13288.down create mode 100644 db_scripts/diff/13288.up diff --git a/db_scripts/diff/13288.down b/db_scripts/diff/13288.down new file mode 100644 index 00000000..874c6407 --- /dev/null +++ b/db_scripts/diff/13288.down @@ -0,0 +1,7 @@ +USE accounting; + +SET AUTOCOMMIT=0; + +UPDATE cdr SET export_status='unexported', exported_at=NULL; + +COMMIT; diff --git a/db_scripts/diff/13288.up b/db_scripts/diff/13288.up new file mode 100644 index 00000000..6d56b2c5 --- /dev/null +++ b/db_scripts/diff/13288.up @@ -0,0 +1,8 @@ +USE accounting; + +SET AUTOCOMMIT=0; + +SELECT acc_id FROM mark WHERE collector='exporter-lastid' INTO @lastid; +UPDATE cdr SET export_status='ok', exported_at=NOW() WHERE id <= @lastid; + +COMMIT;