浏览代码

导出改为增量导出数据,方便打包一体导出

zhangfan 2 月之前
父节点
当前提交
956bb5eceb
共有 1 个文件被更改,包括 12 次插入11 次删除
  1. 12 11
      crossborder/export/export_sql.py

+ 12 - 11
crossborder/export/export_sql.py

@@ -123,14 +123,15 @@ def export_tables():
         't_yujin_crossborder_commodity_country',
         't_yujin_crossborder_commodity_trade',
         't_yujin_crossborder_country_trade',
-        't_yujin_crossborder_region_trade'
+        't_yujin_crossborder_region_trade',
+        't_yujin_crossborder_monthly_summary'
     ]
 
     # 需全量导出的表
-    full_tables = [
-        't_yujin_crossborder_yearly_summary',
-        't_yujin_crossborder_monthly_summary'
-    ]
+    # full_tables = [
+    #     't_yujin_crossborder_yearly_summary',
+    #     't_yujin_crossborder_monthly_summary'
+    # ]
 
     # 省份交叉表
     prov_tables = [
@@ -157,12 +158,12 @@ def export_tables():
             log.error(f"导出表 {table} 时出错: {str(e)}")
 
     # 导出全量表
-    for table in full_tables:
-        try:
-            export_file = EXPORT_DIR / f"{table}_{latest_month}.sql"
-            export_table(table, f"SELECT * FROM `{table}`", export_file, skip_fields)
-        except Exception as e:
-            log.error(f"导出表 {table} 时出错: {str(e)}")
+    # for table in full_tables:
+    #     try:
+    #         export_file = EXPORT_DIR / f"{table}_{latest_month}.sql"
+    #         export_table(table, f"SELECT * FROM `{table}`", export_file, skip_fields)
+    #     except Exception as e:
+    #         log.error(f"导出表 {table} 时出错: {str(e)}")
 
     # 导出省份表(最新月数据)
     for table in prov_tables: