正在显示
1 个修改的文件
包含
4 行增加
和
4 行删除
@@ -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) |
请
注册
或
登录
后发表评论