提交 5be0bb87b5b9246d4fe985a54c93ee59aa789c5b

作者 nheweijun
1 个父辈 8e446e18

修复数据刷新时有多行的问题

@@ -329,14 +329,14 @@ class Api(ApiTemplate): @@ -329,14 +329,14 @@ class Api(ApiTemplate):
329 # 删除不存在的表 329 # 删除不存在的表
330 for n in origin_common_tables_name: 330 for n in origin_common_tables_name:
331 if n not in real_common_tables_name: 331 if n not in real_common_tables_name:
332 - table = Table.query.filter_by(name=n).filter_by(database_guid=database_guid).one_or_none()  
333 - if table: 332 + tables = Table.query.filter_by(name=n).filter_by(database_guid=database_guid).all()
  333 + for table in tables:
334 db.session.delete(table) 334 db.session.delete(table)
335 335
336 def edit_common_table(self,data_session,database_guid,real_common_tables_name,origin_common_tables_name,this_time): 336 def edit_common_table(self,data_session,database_guid,real_common_tables_name,origin_common_tables_name,this_time):
337 for table_name in origin_common_tables_name: 337 for table_name in origin_common_tables_name:
338 - table = Table.query.filter_by(name=table_name).filter_by(database_guid=database_guid).one_or_none()  
339 - if table: 338 + tables = Table.query.filter_by(name=table_name).filter_by(database_guid=database_guid).all()
  339 + for table in tables:
340 if table_name not in real_common_tables_name: 340 if table_name not in real_common_tables_name:
341 StructurePrint.print("{}非空间表减少!".format(table_name)) 341 StructurePrint.print("{}非空间表减少!".format(table_name))
342 db.session.delete(table) 342 db.session.delete(table)
注册登录 后发表评论