#! /bin/csh

echo ""
echo "-----------------------------"
echo "This script is used to compare DB contents of Gazelle and GMM and check that all audited entries (NOT _aud) are up-to-date between Gazelle and GMM."
echo "Here is the process of this script when you execute it :"
echo "1. This script generates a file (audited_dump-gazelle.txt) containing the audited data (not in the _aud tables) inside Gazelle"
echo "2. This script generates a file (audited_dump-gmm.txt) containing the audited data (not in the _aud tables) inside GMM"
echo "3. This script compares the contents of those 2 generated files and display the difference within the console"
echo "Before executing, please read those recommendations :"
echo "   - Set the variables of the Gazelle (CLIENT) and of the GMM (SERVER) accordingly"
echo "   - You can execute it from anywhere if you set the hosts correctly"
echo "-----------------------------"
echo ""


##########################
# Gazelle side - Variables

# Name of the Gazelle database 
setenv gazelle_db_name gazelle-dev
# User of the Gazelle database 
setenv gazelle_db_user gazelle
# Host of the Gazelle database 
setenv gazelle_db_host localhost
# Output file (dump as text) containing the audited information of the Gazelle database 
setenv gazelle_output_dump_file audited_dump-gazelle.txt 


##########################
# GMM side - Variables

# Name of the GMM database 
setenv gmm_db_name gmm-dev
# User of the GMM database 
setenv gmm_db_user gazelle
# Host of the GMM database 
setenv gmm_db_host sumo.irisa.fr
# Output file (dump as text) containing the audited information of the GMM database 
setenv gmm_output_dump_file audited_dump-gmm.txt 
 
 
 
 
 #
 # GAZELLE DATABASE - Dump of audited tables...
 #
 echo "Start Dumping... Gazelle side..."
 echo "Dump of audited tables..." > $gazelle_output_dump_file 
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tf_actor_integration_profile : ' || ( id, actor_id, integration_profile_id) FROM tf_actor_integration_profile ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file 
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tf_actor_integration_profile_option : ' || ( id, actor_integration_profile_id, integration_profile_option_id) FROM tf_actor_integration_profile_option ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tf_actor : ' || ( id, combined, description, keyword, name) FROM tf_actor ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tf_integration_profile_status_type : ' || ( id, description, keyword, name) FROM tf_integration_profile_status_type ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tf_integration_profile_option : ' || ( id, description, keyword, name, reference) FROM tf_integration_profile_option ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tf_integration_profile_option : ' || ( domain_id, integration_profile_id) FROM tf_domain_profile ORDER BY domain_id, integration_profile_id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tf_domain : ' || ( id, description, keyword, name) FROM tf_domain ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tf_integration_profile : ' || ( id, description, keyword, name, integration_profile_status_type_id) FROM tf_integration_profile ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tf_hl7_message_profile : ' || ( id, hl7_version, message_order_control_code, message_type, profile_oid, profile_type, actor_id, domain_id, table_id, transaction_id) FROM tf_hl7_message_profile ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tf_hl7_message_profile_table : ' || ( id, table_content, table_name, table_version) FROM tf_hl7_message_profile_table ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tf_integration_profile_type : ' || ( id, description, keyword, name) FROM tf_integration_profile_type ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tf_transaction : ' || ( id, description, keyword, name, reference, transaction_status_type_id) FROM tf_transaction ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tf_transaction_link : ' || ( id, from_actor_id, to_actor_id, transaction_id) FROM tf_transaction_link ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tf_transaction_status_type : ' || ( id, description, keyword, name) FROM tf_transaction_status_type ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tf_profile_link : ' || ( id, actor_integration_profile_id, transaction_id, transaction_option_type_id) FROM tf_profile_link ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tf_profile_inria_hl7_validation_files : ' || ( id, profile_xslt_file, profile_table_xslt_file, hl7_message_profile_id) FROM tf_profile_inria_hl7_validation_files ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tf_transaction_option_type : ' || ( id, description, keyword, name) FROM tf_transaction_option_type ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tf_integration_profile_type_link : ' || ( integration_profile_type_id, integration_profile_id) FROM tf_integration_profile_type_link ORDER BY integration_profile_type_id, integration_profile_id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tm_conftype_w_ports_wstype_and_sop_class : ' || ( id, port_non_secure, port_secure, configurationtype_id, sop_class_id, web_service_type_id, comment, transport_layer_id) FROM tm_conftype_w_ports_wstype_and_sop_class ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tm_conf_mapping_w_aipo_w_conftypes : ' || ( tm_conf_mapped_id, tm_conftypes_id) FROM tm_conf_mapping_w_aipo_w_conftypes ORDER BY tm_conf_mapped_id, tm_conftypes_id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tm_configuration_mapped_with_aipo : ' || ( id, aipo_id) FROM tm_configuration_mapped_with_aipo ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tm_configuration_type : ' || ( id, category, class_name, type_name, used_for_proxy) FROM tm_configuration_type ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tm_contextual_information : ' || ( id, label, path, value) FROM tm_contextual_information ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tm_object_creator : ' || ( id, description, aipo_id, object_id) FROM tm_object_creator ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tm_object_class_validator : ' || ( validator_class_id, description, name, value, file_type_id) FROM tm_object_class_validator ORDER BY validator_class_id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tm_meta_test : ' || ( id, keyword, short_description) FROM tm_meta_test ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tm_meta_test_test_roles : ' || ( meta_test_id, test_roles_id) FROM tm_meta_test_test_roles ORDER BY meta_test_id, test_roles_id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tm_object_attribute : ' || ( id, description, keyword, object_id) FROM tm_object_attribute ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tm_object_attribute_option : ' || ( id, description, keyword, attribue_id) FROM tm_object_attribute_option ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tm_object_method_validator : ' || ( method_id, description, name, value, validator_class_id) FROM tm_object_method_validator ORDER BY method_id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tm_object_file : ' || ( id, description, object_id, type_id, max, min, uploader) FROM tm_object_file ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tm_object_file_method : ' || ( id, method_id) FROM tm_object_file_method ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tm_object_method_parameter : ' || ( method_id, parameter_id) FROM tm_object_method_parameter ORDER BY method_id, parameter_id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tm_object_file_type : ' || ( id, description, keyword, extensions) FROM tm_object_file_type ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tm_object_instance_validation : ' || ( id, description, value) FROM tm_object_instance_validation ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tm_object_parameter_validator : ' || ( parameter_id, description, value) FROM tm_object_parameter_validator ORDER BY parameter_id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tm_object_type : ' || ( id, default_desc, description, instructions, keyword, object_type_status_id) FROM tm_object_type ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tm_object_type_status : ' || ( id, description, keyword, label_to_display) FROM tm_object_type_status ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tm_object_reader : ' || ( id, description, aipo_id, object_id) FROM tm_object_reader ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tm_role_in_test : ' || ( id, keyword, is_role_played_by_a_tool) FROM tm_role_in_test ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tm_role_in_test_test_participants : ' || ( role_in_test_id, test_participants_id) FROM tm_role_in_test_test_participants ORDER BY role_in_test_id, test_participants_id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tm_sop_class : ' || ( id, keyword, name) FROM tm_sop_class ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tm_test_description : ' || ( id, description ) FROM tm_test_description ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tm_test_type : ' || ( id, description, keyword, label_to_display) FROM tm_test_type ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tm_test : ' || ( id, keyword, name, number_of_tests_to_realize, short_description, version, test_status_id, test_type_id, test_peer_type_id, orchestrable) FROM tm_test ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tm_test_option : ' || ( id, description, keyword, label_to_display) FROM tm_test_option ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tm_test_participants : ' || ( id, is_tested, actor_integration_profile_option_id) FROM tm_test_participants ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tm_test_peer_type : ' || ( id, description, keyword, label_to_display) FROM tm_test_peer_type ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tm_test_roles : ' || ( id, card_max, card_min, url, url_doc, role_in_test_id, test_id, test_option_id, number_of_tests_to_realize) FROM tm_test_roles ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tm_test_steps : ' || ( id, description, message_type, step_index, test_roles_initiator_id, test_roles_responder_id, test_steps_option_id, transaction_id, secured) FROM tm_test_steps ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tm_test_steps_input_ci : ' || ( test_steps_id, contextual_information_id) FROM tm_test_steps_input_ci ORDER BY test_steps_id, contextual_information_id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tm_test_status : ' || ( id, description, keyword, label_to_display) FROM tm_test_status ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tm_test_test_description : ' || ( test_id, test_description_id) FROM tm_test_test_description ORDER BY test_id, test_description_id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tm_test_steps_option : ' || ( id, description, keyword, label_to_display) FROM tm_test_steps_option ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tm_test_steps_output_ci : ' || ( test_steps_id, contextual_information_id) FROM tm_test_steps_output_ci ORDER BY test_steps_id, contextual_information_id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tm_transport_layer_for_config : ' || ( id, keyword, name) FROM tm_transport_layer_for_config ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tm_test_test_steps : ' || ( test_id, test_steps_id) FROM tm_test_test_steps ORDER BY test_id, test_steps_id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 psql -U$gazelle_db_user $gazelle_db_host $gazelle_db_name -c "SELECT 'tm_web_service_type : ' || ( id, description, needs_oid, profile_id) FROM tm_web_service_type ORDER BY id ASC; " | grep -v row | grep -v ligne >> $gazelle_output_dump_file
 echo "Start Dumping... Gazelle side... DONE"
 

#
# GMM DATABASE - Dump of audited tables...
#
echo "Start Dumping... GMM side..."
echo "Dump of audited tables..." > $gmm_output_dump_file 
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tf_actor_integration_profile : ' || ( id, actor_id, integration_profile_id) FROM tf_actor_integration_profile ORDER BY id ASC; " >> $gmm_output_dump_file 
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tf_actor_integration_profile_option : ' || ( id, actor_integration_profile_id, integration_profile_option_id) FROM tf_actor_integration_profile_option ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tf_actor : ' || ( id, combined, description, keyword, name) FROM tf_actor ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tf_integration_profile_status_type : ' || ( id, description, keyword, name) FROM tf_integration_profile_status_type ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tf_integration_profile_option : ' || ( id, description, keyword, name, reference) FROM tf_integration_profile_option ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tf_integration_profile_option : ' || ( domain_id, integration_profile_id) FROM tf_domain_profile ORDER BY domain_id, integration_profile_id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tf_domain : ' || ( id, description, keyword, name) FROM tf_domain ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tf_integration_profile : ' || ( id, description, keyword, name, integration_profile_status_type_id) FROM tf_integration_profile ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tf_hl7_message_profile : ' || ( id, hl7_version, message_order_control_code, message_type, profile_oid, profile_type, actor_id, domain_id, table_id, transaction_id) FROM tf_hl7_message_profile ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tf_hl7_message_profile_table : ' || ( id, table_content, table_name, table_version) FROM tf_hl7_message_profile_table ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tf_integration_profile_type : ' || ( id, description, keyword, name) FROM tf_integration_profile_type ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tf_transaction : ' || ( id, description, keyword, name, reference, transaction_status_type_id) FROM tf_transaction ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tf_transaction_link : ' || ( id, from_actor_id, to_actor_id, transaction_id) FROM tf_transaction_link ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tf_transaction_status_type : ' || ( id, description, keyword, name) FROM tf_transaction_status_type ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tf_profile_link : ' || ( id, actor_integration_profile_id, transaction_id, transaction_option_type_id) FROM tf_profile_link ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tf_profile_inria_hl7_validation_files : ' || ( id, profile_xslt_file, profile_table_xslt_file, hl7_message_profile_id) FROM tf_profile_inria_hl7_validation_files ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tf_transaction_option_type : ' || ( id, description, keyword, name) FROM tf_transaction_option_type ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tf_integration_profile_type_link : ' || ( integration_profile_type_id, integration_profile_id) FROM tf_integration_profile_type_link ORDER BY integration_profile_type_id, integration_profile_id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tm_conftype_w_ports_wstype_and_sop_class : ' || ( id, port_non_secure, port_secure, configurationtype_id, sop_class_id, web_service_type_id, comment, transport_layer_id) FROM tm_conftype_w_ports_wstype_and_sop_class ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tm_conf_mapping_w_aipo_w_conftypes : ' || ( tm_conf_mapped_id, tm_conftypes_id) FROM tm_conf_mapping_w_aipo_w_conftypes ORDER BY tm_conf_mapped_id, tm_conftypes_id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tm_configuration_mapped_with_aipo : ' || ( id, aipo_id) FROM tm_configuration_mapped_with_aipo ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tm_configuration_type : ' || ( id, category, class_name, type_name, used_for_proxy) FROM tm_configuration_type ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tm_contextual_information : ' || ( id, label, path, value) FROM tm_contextual_information ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tm_object_creator : ' || ( id, description, aipo_id, object_id) FROM tm_object_creator ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tm_object_class_validator : ' || ( validator_class_id, description, name, value, file_type_id) FROM tm_object_class_validator ORDER BY validator_class_id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tm_meta_test : ' || ( id, keyword, short_description) FROM tm_meta_test ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tm_meta_test_test_roles : ' || ( meta_test_id, test_roles_id) FROM tm_meta_test_test_roles ORDER BY meta_test_id, test_roles_id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tm_object_attribute : ' || ( id, description, keyword, object_id) FROM tm_object_attribute ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tm_object_attribute_option : ' || ( id, description, keyword, attribue_id) FROM tm_object_attribute_option ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tm_object_method_validator : ' || ( method_id, description, name, value, validator_class_id) FROM tm_object_method_validator ORDER BY method_id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tm_object_file : ' || ( id, description, object_id, type_id, max, min, uploader) FROM tm_object_file ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tm_object_file_method : ' || ( id, method_id) FROM tm_object_file_method ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tm_object_method_parameter : ' || ( method_id, parameter_id) FROM tm_object_method_parameter ORDER BY method_id, parameter_id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tm_object_file_type : ' || ( id, description, keyword, extensions) FROM tm_object_file_type ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tm_object_instance_validation : ' || ( id, description, value) FROM tm_object_instance_validation ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tm_object_parameter_validator : ' || ( parameter_id, description, value) FROM tm_object_parameter_validator ORDER BY parameter_id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tm_object_type : ' || ( id, default_desc, description, instructions, keyword, object_type_status_id) FROM tm_object_type ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tm_object_type_status : ' || ( id, description, keyword, label_to_display) FROM tm_object_type_status ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tm_object_reader : ' || ( id, description, aipo_id, object_id) FROM tm_object_reader ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tm_role_in_test : ' || ( id, keyword, is_role_played_by_a_tool) FROM tm_role_in_test ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tm_role_in_test_test_participants : ' || ( role_in_test_id, test_participants_id) FROM tm_role_in_test_test_participants ORDER BY role_in_test_id, test_participants_id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tm_sop_class : ' || ( id, keyword, name) FROM tm_sop_class ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tm_test_description : ' || ( id, description ) FROM tm_test_description ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tm_test_type : ' || ( id, description, keyword, label_to_display) FROM tm_test_type ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tm_test : ' || ( id, keyword, name, number_of_tests_to_realize, short_description, version, test_status_id, test_type_id, test_peer_type_id, orchestrated) FROM tm_test ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tm_test_option : ' || ( id, description, keyword, label_to_display) FROM tm_test_option ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tm_test_participants : ' || ( id, is_tested, actor_integration_profile_option_id) FROM tm_test_participants ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tm_test_peer_type : ' || ( id, description, keyword, label_to_display) FROM tm_test_peer_type ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tm_test_roles : ' || ( id, card_max, card_min, url, url_doc, role_in_test_id, test_id, test_option_id, number_of_tests_to_realize) FROM tm_test_roles ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tm_test_steps : ' || ( id, description, message_type, step_index, test_roles_initiator_id, test_roles_responder_id, test_steps_option_id, transaction_id, secured) FROM tm_test_steps ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tm_test_steps_input_ci : ' || ( test_steps_id, contextual_information_id) FROM tm_test_steps_input_ci ORDER BY test_steps_id, contextual_information_id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tm_test_status : ' || ( id, description, keyword, label_to_display) FROM tm_test_status ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tm_test_test_description : ' || ( test_id, test_description_id) FROM tm_test_test_description ORDER BY test_id, test_description_id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tm_test_steps_option : ' || ( id, description, keyword, label_to_display) FROM tm_test_steps_option ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tm_test_steps_output_ci : ' || ( test_steps_id, contextual_information_id) FROM tm_test_steps_output_ci ORDER BY test_steps_id, contextual_information_id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tm_transport_layer_for_config : ' || ( id, keyword, name) FROM tm_transport_layer_for_config ORDER BY id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tm_test_test_steps : ' || ( test_id, test_steps_id) FROM tm_test_test_steps ORDER BY test_id, test_steps_id ASC; " >> $gmm_output_dump_file
psql -U$gmm_db_user -h $gmm_db_host $gmm_db_name -c "SELECT 'tm_web_service_type : ' || ( id, description, needs_oid, profile_id) FROM tm_web_service_type ORDER BY id ASC; " >> $gmm_output_dump_file
#scp sumo:/home/jchatel/audited_dump-gmm.txt .
 echo "Start Dumping... GMM side... DONE"
 
 echo ""
 echo "*********"
 echo "Comparison between Gazelle and GMM : "
 echo ""
 diff $gazelle_output_dump_file $gmm_output_dump_file
 
 echo ""
 echo "*********"
# echo "scp sumo:/home/jchatel/audited_dump-gmm.txt ."
 






