This function is used to compare the specified object and return the DDL comparison.
(trans_id, source_sid, source_did, source_scid,
target_sid, target_did, target_scid, source_oid,
target_oid, node_type, comp_status)
| 709 | ) |
| 710 | @pga_login_required |
| 711 | def ddl_compare(trans_id, source_sid, source_did, source_scid, |
| 712 | target_sid, target_did, target_scid, source_oid, |
| 713 | target_oid, node_type, comp_status): |
| 714 | """ |
| 715 | This function is used to compare the specified object and return the |
| 716 | DDL comparison. |
| 717 | """ |
| 718 | # Check the transaction and connection status |
| 719 | _, error_msg, _, _ = \ |
| 720 | check_transaction_status(trans_id) |
| 721 | |
| 722 | if error_msg == ERROR_MSG_TRANS_ID_NOT_FOUND: |
| 723 | return make_json_response(success=0, errormsg=error_msg, status=404) |
| 724 | |
| 725 | view = SchemaDiffRegistry.get_node_view(node_type) |
| 726 | if view and hasattr(view, 'ddl_compare'): |
| 727 | sql = view.ddl_compare(source_sid=source_sid, source_did=source_did, |
| 728 | source_scid=source_scid, target_sid=target_sid, |
| 729 | target_did=target_did, target_scid=target_scid, |
| 730 | source_oid=source_oid, target_oid=target_oid, |
| 731 | comp_status=comp_status) |
| 732 | return ajax_response( |
| 733 | status=200, |
| 734 | response={'source_ddl': sql['source_ddl'], |
| 735 | 'target_ddl': sql['target_ddl'], |
| 736 | 'diff_ddl': sql['diff_ddl']} |
| 737 | ) |
| 738 | |
| 739 | msg = gettext('Selected object is not supported for DDL comparison.') |
| 740 | |
| 741 | return ajax_response( |
| 742 | status=200, |
| 743 | response={'source_ddl': msg, |
| 744 | 'target_ddl': msg, |
| 745 | 'diff_ddl': msg |
| 746 | } |
| 747 | ) |
| 748 | |
| 749 | |
| 750 | def check_version_compatibility(sid, tid): |
nothing calls this directly
no test coverage detected