From 61520e5dfcedb2f93be0f743ea645893ba78dea1 Mon Sep 17 00:00:00 2001 From: Deepthi Date: Mon, 29 Mar 2021 17:25:43 +0530 Subject: [PATCH] ods tables creation from manju --- .../MMT_Create_ODS_Tables_v0.4_20210327.sql | 1968 +++++++++++++++++ ...T_ODS_Create_constraints_v0,1_20210310.sql | 425 ++++ ...DS_create_FK_constraints_v0.1_20210311.sql | 250 +++ ...T_ODS_create_master_data_v0.1_20210310.sql | 15 + ...T_create_primary_key_ODS_v0.1_20210310.sql | 52 + 5 files changed, 2710 insertions(+) create mode 100644 MMT_SQL/ods/db_create_scripts/MMT_Create_ODS_Tables_v0.4_20210327.sql create mode 100644 MMT_SQL/ods/db_create_scripts/MMT_ODS_Create_constraints_v0,1_20210310.sql create mode 100644 MMT_SQL/ods/db_create_scripts/MMT_ODS_create_FK_constraints_v0.1_20210311.sql create mode 100644 MMT_SQL/ods/db_create_scripts/MMT_ODS_create_master_data_v0.1_20210310.sql create mode 100644 MMT_SQL/ods/db_create_scripts/MMT_create_primary_key_ODS_v0.1_20210310.sql diff --git a/MMT_SQL/ods/db_create_scripts/MMT_Create_ODS_Tables_v0.4_20210327.sql b/MMT_SQL/ods/db_create_scripts/MMT_Create_ODS_Tables_v0.4_20210327.sql new file mode 100644 index 0000000..494ae89 --- /dev/null +++ b/MMT_SQL/ods/db_create_scripts/MMT_Create_ODS_Tables_v0.4_20210327.sql @@ -0,0 +1,1968 @@ + + +/* Script creates ALL the tables requried for the MMT ODS, there are no constraints on the table */ +/* ADDED IHT on 23rd March 2021 */ + +-- drop table test_master + +CREATE TABLE test_master ( + syspk serial NOT NULL, -- PK + client_id smallint not null, -- UKA1 + function_id smallint not null, -- UKA2 + Test_Name text NOT NULL, -- UKA3 + Test_Type text NOT NULL, + Test_Description text NULL, + Created_by text NULL, + Create_timestamp timestamp NULL default now() +); + +-- drop table test_lab_location_master + +CREATE TABLE test_lab_location_master ( + syspk serial NOT NULL, -- PK + client_id smallint not null, -- UKA1 + function_id smallint not null, -- UKA2 + Location_Name text NOT NULL, -- UKA3 + Soil_Type text, + Created_by text NULL, + Create_timestamp timestamp NULL default now() +) ; + +drop table test_instance; + +CREATE TABLE test_instance ( + syspk serial NOT NULL, -- PK + client_id smallint not null, -- UKA1 + function_id smallint not null, -- UKA2 + Test_master_Id int , + Test_File_Ref_No int , + Test_File_Format text, + Test_File_Sheet_Format text , + Date_of_test date , + Job_Order_No text NULL, + Test_Tractor_ID int DEFAULT NULL, + Tractor_model text, + Tractor_make text, + Tractor_Sr_No text, + Generation text, + Test_Location_ID int DEFAULT NULL, + Test_Location_name text, + Test_Type text, + Test_Name text, + Test_condition text, + Objective_of_test text, + Background_of_test text, + Test_Standard_Ref text, + Test_Standard_desc text, + Test_Standard_id int, + Acceptance_Criteria text, + Project_Group text, + Customer_Name text, + No_of_Sample text, + Sample_Receipt_Date date DEFAULT NULL, + Test_Start_Date date DEFAULT NULL, + Test_End_Date date DEFAULT NULL, + Type_of_Soil text, + soil_Moisture_Content_pct decimal(12,4) DEFAULT NULL, + Soil_Cone_Index decimal(12,4) DEFAULT NULL, + soil_Bulk_Density_g_per_cc decimal(12,4) DEFAULT NULL, + Field_Condition text, + Season text, + type_of_Road text, + Gradient_slope_1_Degree int DEFAULT NULL, + Gradient_slope_2_Degree int DEFAULT NULL, + tractor_Hitch_Type text, + Tractor_Hitch_Ht_mm int DEFAULT NULL, + Tractor_RWheel_C2H_dist_mm int DEFAULT NULL, + Test_Engineer text, + Test_Operator text, + Remarks text, + Test_report_No text, + Test_Report_Date date DEFAULT NULL, + Report_Title text, + Report_Prepared_By text, + Report_Reviewed_By text, + Report_Approved_by text, + Report_template_No text, + Report_template_Replaces text, + Report_template_Rev_No text, + Report_Template_Rev_Date text, + Created_by text NULL, + Create_timestamp timestamp NULL default now() +) ; + +drop table test_instance_images; + +CREATE TABLE test_instance_images ( + SYSPK serial NOT Null, -- PK + client_id int Not Null, -- UKA1 + function_id int Not Null, -- UKA2 + Test_instance_Id int , + Srl_No int null, -- UKA4 + image bytea Null, + Test_File_Ref_No int Null, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + created_by text null, + create_timestamp timestamp Not Null default now() +); + +drop table test_instance_tractor_info; + +CREATE TABLE test_instance_tractor_info ( + syspk serial NOT NULL, -- PK + client_id smallint not null, -- UKA1 + function_id smallint not null, -- UKA2 + Test_instance_id int NULL, -- UKA3 + Tractor_Model text NULL, -- UKA4 + Test_File_Ref_No int NULL, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Tractor_Make text , + Tractor_Sr_No text, + Tractor_Engine_HP int DEFAULT NULL, + Tractor_Platform text, + Configuration text, + Generation text, + Domestic_Export text, + Mahindra_Model_YN text NULL, + Test_Tractor_YN text NULL, + FIP_Type text, + Hour_Meter_Reading int DEFAULT NULL, + Steering_Type text, + Transmission_Type text, + Transmission_Disc_Diam text, + Wheel_Drive_Type text DEFAULT NULL, + Gear_Ratio decimal(12,4) DEFAULT NULL, + EGR_YN text, + Brake_Type text, + Brake_Free_Play_LH int DEFAULT NULL, + Brake_Free_Play_RH int DEFAULT NULL, + PTO_Type text, + Standard_PTO_Speed_RPM int DEFAULT NULL, + EPTO_Speed_RPM int DEFAULT NULL, + PTO_Power_HP numeric, + Ballast_Condition text null, + Ballasted_Tractor_Accessories text DEFAULT NULL, + Mechanical_Ballast_Rear text DEFAULT NULL, + Mechanical_Ballast_Rear_in_kg int DEFAULT NULL, + Water_Ballast_Rear_75_PCT text DEFAULT NULL, + Mechanical_Ballast_Front text DEFAULT NULL, + Mechanical_Ballast_Front_Kg int DEFAULT NULL, + Front_bumper_weight_kg int DEFAULT NULL, + Total_Ballast_Weight int DEFAULT NULL, + Tractor_Weight_Front_kg int DEFAULT NULL, + Tractor_Weight_Rear_kg int DEFAULT NULL, + Tractor_Weight_Total_kg int DEFAULT NULL, + Unballasted_Max_Speed_kmph decimal(12,4) DEFAULT NULL, + Road_Ballasted_Max_speed_kmph decimal(12,4) DEFAULT NULL, + Wheel_Base_mm int DEFAULT NULL, + Wheel_Track_mm int, + Overall_Height_mm int, + Rear_Tractor_WIdth_mm int, + Turning_Circle_Diameter_mm int, + Weight_reactions_front_kg int, + Weight_reactions_rear_kg int, + Hitch_Height_mm int DEFAULT NULL, + Created_by text NULL, + Create_timestamp timestamp NULL default now() +); + +drop table test_instance_engine_info; + +CREATE TABLE test_instance_engine_info ( + syspk serial NOT NULL, -- PK + client_id smallint NOT NULL, -- UKA1 + function_id smallint NOT NULL, -- UKA2 + Test_Instance_ID int NULL, -- UKA3 + Test_instance_Tractor_ID int NULL, -- UKA4 + Test_File_Ref_No int NULL, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Tractor_Model text, + Tractor_Make text , + Engine_Make text, + Engine_Type text, + Engine_Model text, + Engine_Serial_No text, + Low_Idle_Declared text, + Low_idle_Observed int DEFAULT NULL, + High_Idle_Declared text, + High_idle_Observed int DEFAULT NULL, + Rated_RPM int DEFAULT NULL, + Rated_RPM_Observed int NULL, + Engine_set_RPM int NULL, + Engine_Power_HP int NULL, + PTO_Power_HP int NULL, + Engine_to_PTO_Ratio_540_PTO text DEFAULT NULL, + Engine_to_PTO_Ratio_540E_PTO text DEFAULT NULL, + Engine_Cylinder_No int DEFAULT NULL, + Engine_Cylinder_Stroke_mm int DEFAULT NULL, + Engine_Cylinder_Bore_mm decimal(12,4) DEFAULT NULL, + Engine_Cylinder_Capacity_ltr int DEFAULT NULL, + Created_by text NULL, + Create_timestamp timestamp NULL default now() +) ; + + drop table test_instance_implement_info; + +CREATE TABLE test_instance_implement_info ( + syspk serial NOT NULL, + client_id smallint NOT NULL, + function_id smallint NOT NULL, + Test_instance_ID int NULL, + Name_of_Implement text NULL, + Test_File_Ref_No int NULL, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Type_of_Implement text, + Make_of_Implement text, + No_of_Disc_blades_bottoms text DEFAULT NULL, + Type_of_disc_blades_bottoms text, + size_of_bottoms_blades_mm int DEFAULT NULL, + size_of_bottoms_blades2_mm int, + size_of_bottoms_blades3_mm int, + Spacing_of_bottoms_flanges_mm int DEFAULT NULL, + Cutting_Width_m text, + Implement_Weight_kg int DEFAULT NULL, + Hitch_Category text, + Span_For_Mounted_Implement_mm int DEFAULT NULL, + Mast_Height_For_Mounted_Implement_mm text DEFAULT NULL, + Type_of_Cage_wheel_HCW_FCW text, + Cage_wheel_Dia_mm int DEFAULT NULL, + Cage_wheel_width_mm int DEFAULT NULL, + Cage_Wheel_weight_kg int DEFAULT NULL, + Cage_Wheel_Inner_ring_Dia_mm int DEFAULT NULL, + Cage_Wheel_Outer_ring_Dia_mm int DEFAULT NULL, + Cage_Wheel_center_ring_Dia_mm int DEFAULT NULL, + Dist_btwn_Fender_to_FCW_inner_ring_mm int DEFAULT NULL, + Dist_btwn_LHS_FCW_to_RHS_FCW_mm int DEFAULT NULL, + Dist_btwn_IW_ring_to_CW_mounting_ring_mm int DEFAULT NULL, + No_of_angles_on_cage_wheel int DEFAULT NULL, + No_of_days_of_water_logging int DEFAULT NULL, + Depth_of_water_mm int DEFAULT NULL, + Implement_Image_Ref_Id int DEFAULT NULL, + Length_mm int DEFAULT NULL, + Width_mm int DEFAULT NULL, + Height_mm int DEFAULT NULL, + Gross_mass_kg int DEFAULT NULL, + No_and_types_of_lugs text DEFAULT NULL, + Size_of_angle_section_mm int DEFAULT NULL, + Size_of_angle_section2_mm int, + Size_of_angle_section3_mm int, + Length_of_lugs_mm int DEFAULT NULL, + Spacing_of_lugs_mm int DEFAULT NULL, + Created_by text NULL, + Create_timestamp timestamp NULL default now() +); + +drop table test_instance_trailer_info; + +CREATE TABLE test_instance_trailer_info ( + syspk serial NOT NULL, + client_id smallint NOT NULL, + function_id smallint NOT NULL, + Test_instance_ID int NULL, + Type_Of_Trailer text NULL, + No_Of_Axle int DEFAULT NULL, + Test_File_Ref_No int NULL, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + No_Of_Wheels int DEFAULT NULL, + Trailer_Hitch_Ht_above_ground_lvl_mm int DEFAULT NULL, + Make_model_of_trailer text, + Trailer_platform_length_mm int DEFAULT NULL, + Trailer_platform_Width_mm int DEFAULT NULL, + Trailer_platform_Height_mm int DEFAULT NULL, + Tire_size text, + Inflation_pressure_psi int DEFAULT NULL, + Track_width_of_trailer_mm int DEFAULT NULL, + Hzntl_Dist_of_hitch_pt_from_trailer_face_mm int DEFAULT NULL, + Tractor_RWC_to_Hitch_Pt_Center_Dist_mm int DEFAULT NULL, + Dist_from_Trailer_front_axle_Dist_from_hitch_pt_mm int DEFAULT NULL, + Dist_from_tractor_RWC_to_trailer_RWC_mm int DEFAULT NULL, + Trailer_empty_Weight_Kg int DEFAULT NULL, + Trailer_Gross_Weight_Kg int DEFAULT NULL, + Created_by text NULL, + Create_timestamp timestamp NULL default now() +) ; + +drop table test_instance_tyre_info; + +CREATE TABLE test_instance_tyre_info ( + syspk serial NOT NULL, + client_id smallint NOT NULL, + function_id smallint NOT NULL, + Test_Instance_ID int NULL, + Test_Instance_Tractor_ID int NULL, + Tyre_Type text NULL, + Test_File_Ref_No int NULL, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Tractor_Model text, + Tractor_Make text , + Tyre_Make text NULL, + Tyre_Size text NULL, + Tyre_Ply_Rating int DEFAULT NULL, + tyre_Load_Carrying_Capacity text, + tyre_Pressure_psi decimal(12,4) DEFAULT NULL, + tyre_Pressure_kg_per_cm2 decimal(12,4) DEFAULT NULL, + tyre_Number_of_lug int DEFAULT NULL, + tyre_Number_of_no_load_lug_30m int DEFAULT NULL, + tyre_Lug_Height decimal(12,4) DEFAULT NULL, + tyre_Dynamic_rolling_radius_mm decimal(12,4) DEFAULT NULL, + tyre_Wheel_Rim_Make_and_Size text, + Created_by text NULL, + Create_timestamp timestamp NULL default now() +) ; + +drop table test_instance_gear_speed_chart; + +CREATE TABLE test_instance_gear_speed_chart ( + syspk serial NOT NULL, + client_id smallint not null, + function_id smallint not null, + Test_Instance_ID int NULL, + Tyre_condition text NULL, + Forward_Reverse text NULL, + Gear text NULL, + Test_instance_Tractor_ID int, + Test_File_Ref_No int NULL, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Tractor_Model text, + Tractor_Make text , + speed_kmph decimal(12,4), + Created_by text NULL, + Create_timestamp timestamp NULL default now() +) ; + +DROP TABLE test_instance_tractor_info_misc; + +CREATE TABLE test_instance_tractor_info_misc ( + syspk serial NOT NULL, + client_id smallint not null, + function_id smallint not null, + Test_Instance_ID int NULL, + Test_instance_Tractor_ID int, + Test_File_Ref_No int NULL, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Tractor_Model text, + Tractor_Make text , + Capacity_of_fuel_tank_ltr text null, + Make_type_and_model_of_injection_pump text, + Manufacturers_production_setting text, + Make_type_and_model_of_injectors text, + Make_type_and_model_of_magneto_coil_and_distributor text, + Make_type_and_model_of_carburetor text, + Ignition_or_injection_timing text, + Aircleaner_Make_model text, + Aircleaner_type text, + Precleaner_make_model text, + Precleaner_type text, + Hydraulic_Type text, + Pump_speed_at_rated_engine_speed_rpm int, + Pump_HP int, + Oil text, + Lift_Rod_Type_LH text, + Lift_Rod_Type_RH text, + Lift_Rod_Length_LH int, + Lift_Rod_Length_RH int, + Lower_Link_Length_LH int, + Lower_Link_Length_RH int, + Created_by text NULL, + Create_timestamp timestamp NULL default now() + ); + +DROP TABLE test_instance_Wheels_info; + +CREATE TABLE test_instance_Wheels_info ( + syspk serial NOT NULL, + client_id smallint not null, + function_id smallint not null, + Test_Instance_ID int NULL, + Steered_Driving_wheel text, + Test_instance_Tractor_ID int, + Test_File_Ref_No int NULL, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Tractor_Model text, + Tractor_Make text , + Location_of_driving_wheel text, + Make_of_tyres text, + Wheel_Types text, + Wheel_Size text, + Maximum_permissible_load_kg decimal(12,4), + Ply_rating int, + Track_wIdth_max_mm int, + Track_wIdth_min_mm int, + Inflation_pressure_kg_per_cm2 decimal(12,4), + Created_by text NULL, + Create_timestamp timestamp NULL default now() + ); + + DROP TABLE test_instance_fuel_lubricant_info; + + CREATE TABLE test_instance_fuel_lubricant_info ( + syspk serial NOT NULL, + client_id smallint not null, + function_id smallint not null, + Test_Instance_ID int NULL, + fuel_lubricant_unit text, + Test_File_Ref_No int NULL, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Test_instance_Tractor_ID int, + Tractor_Model text, + Tractor_Make text , + Trade_name text, + fuel_lubricant_Type text, + octane_per_Cetane_Number int, + Viscocity text, + Density_At_15C text, + Created_by text NULL, + Create_timestamp timestamp NULL default now() + ); + + DROP TABLE test_instance_equipment_info; + +CREATE TABLE test_instance_equipment_info ( + syspk serial NOT NULL, + client_id smallint not null, + function_id smallint not null, + Test_Instance_ID int NULL, + Srl_No int, + Test_File_Ref_No int, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Test_instance_Tractor_ID int, + Tractor_Model text, + Tractor_Make text , + instrument_Name text, + instrument_Serial_No text, + Calibration_Due_Date date, + Created_by text NULL, + Create_timestamp timestamp NULL default now() + ); + + DROP TABLE test_instance_measurement_uncertainty; + +CREATE TABLE test_instance_measurement_uncertainty ( + syspk serial NOT NULL, + client_id smallint not null, + function_id smallint not null, + Test_Instance_ID int NULL, + Test_file_Ref_No int, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Test_instance_Tractor_ID int, + Tractor_Model text, + Tractor_Make text, + Load_cell text, + RPM_Meter text, + Speed text, + Fuel_flow_meter text, + Created_by text NULL, + Create_timestamp timestamp NULL default now() + ); + + DROP TABLE test_instance_atmospheric_info; + +CREATE TABLE test_instance_atmospheric_info ( + syspk serial NOT NULL, + client_id smallint not null, + function_id smallint not null, + Test_Instance_ID int NULL, + Test_file_Ref_No int, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Test_instance_Tractor_ID int, + Tractor_Model text, + Tractor_Make text, + Ambient_temp_C numeric, + humidity_Pct numeric, + Pressure_kPa numeric, + wind_velocity_kmph numeric, + Background_Noise_dBA numeric, + Created_by text NULL, + Create_timestamp timestamp NULL default now() + ); + + drop tble test_instance_drawbar_info; + +CREATE TABLE test_instance_drawbar_info ( + syspk serial NOT NULL, + client_id smallint not null, + function_id smallint not null, + Test_Instance_ID int NULL, + Test_instance_Tractor_ID int, + Test_File_Ref_No int, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Tractor_Model text, + Tractor_Make text, + Drawbar_type text, + Test_condition text, + Drawbar_type_name text, + Drawbar_type_info text, + Height_above_ground_max_mm numeric, + Height_above_ground_min_mm numeric, + Position_related_to_PTO text, + Wheel_Base text, + Required_pull_in_kg numeric, + Actual_Pull_in_kg numeric, + Required_Power_in_hp numeric, + actual_power_in_hp numeric, + Calculated_hitch_height_mm numeric, + actual_hitch_height_mm numeric, + weight_Front_kg int, + weight_rear_kg int, + weight_total_kg int, + Created_by text NULL, + Create_timestamp timestamp NULL default now() + ); + + + drop TABLE test_instance_weight_reaction; + + CREATE TABLE test_instance_weight_reaction ( + SYSPK serial NOT Null, + Client_Id int Not Null, + Function_Id int Not Null, + Test_Instance_Id int Not Null, + Test Condition text Not Null, + Test_File_Ref_No int Not Null, + Test_File_Format text Not Null, + Test_File_Sheet_Format text Not Null, + Test_Instance_Tractor_Id int Null, + Tractor_Model text Null, + Tractor_Make text Null, + Total_Weight_kg int Null, + High_Idle_RPM int Null, + Front_Reaction_kg int Null, + Rear_Reaction_kg int Null, + Left_Reaction_FL_RL_kg int Null, + Right_reaction_FR_RR_kg int Null, + Front_Left_Reaction_kg int Null, + Front_Right_Reactionkg int Null, + Rear_Left_Reaction_kg int Null, + Rear_Right_Reactionkg int Null, + Distance_of_lifting_point_from_rear_axle_mm_d1 int Null, + Created_By text Null, + Create_Timestamp timestamp Not Null default now() +); + +drop table field_perf_summary; + +CREATE TABLE field_perf_summary ( + syspk Serial NOT NULL, + client_id smallint NOT NULL, + function_id smallint NOT NULL, + Test_Instance_ID int NULL, + Test_Instance_Tractor_ID int NULL, + Test_iteration_number int NULL, + Test_File_Ref_No int NULL, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Tractor_Model text NULL, + Tractor_Make text , + Test_Date date NULL, + Test_Condition text NULL, + Engine_RPM_set int DEFAULT NULL, + PTO_RPM_set int DEFAULT NULL, + Gear_used text, + Nominal_Speed_KMPH decimal(12,4) DEFAULT NULL, + Engine_RPM_Drop_on_straight_1st_Pass text, + Engine_RPM_Drop_on_straight_2nd_Pass text, + Engine_RPM_Drop_on_straight_3rd_Pass text, + Engine_RPM_Drop_on_turn_1st_Pass text, + Engine_RPM_Drop_on_turn_2nd_Pass text, + Engine_RPM_Drop_on_turn_3rd_Pass text, + No_of_passes int DEFAULT NULL, + Depth_of_cut_cm text, + wheel_slippage_pct decimal(12,4) DEFAULT NULL, + Gear_used_on_Straight_Road text, + Straight_road_RPM_Drop text, + Gear_used_on_Up_Slope_1 text, + Up_Slope_RPM_Drop_1 text, + Gear_used_on_Up_Slope_2 text, + Up_Slope_RPM_Drop_2 text, + Gear_used_on_Down_Slope text, + Down_Slope_RPM_Shoot_up text, + Avg_speed_of_travel_kmph decimal(12,4) DEFAULT NULL, + Total_dist_travelled_km decimal(12,4) DEFAULT NULL, + No_load_speed_kmph decimal(12,4) DEFAULT NULL, + On_load_speed_kmph decimal(12,4) DEFAULT NULL, + Fuel_consumption_lit_per_hr decimal(12,4) DEFAULT NULL, + Mileage_Km_per_Ltr decimal(12,4) DEFAULT NULL, + Area_covered_acr_per_hr decimal(12,4) DEFAULT NULL, + Fuel_consumption_lit_per_Acr decimal(12,4) DEFAULT NULL, + Field_Efficiency_pct decimal(12,4) DEFAULT NULL, + Fuel_consumption_Var_lit_per_hr decimal(12,4) DEFAULT NULL, + Mileage_Var_Km_per_Ltr decimal(12,4) DEFAULT NULL, + Area_covered_Var_acr_per_hr decimal(12,4) DEFAULT NULL, + Fuel_consumption_Var_lit_per_Acr decimal(12,4) DEFAULT NULL, + Fuel_consumption_Var_pct_lit_per_hr decimal(12,4) DEFAULT NULL, + Mileage_var_pct_Km_per_Ltr decimal(12,4) DEFAULT NULL, + Area_covered_Var_pct_acr_per_hr decimal(12,4) DEFAULT NULL, + Fuel_consumption_Var_pct_lit_per_Acr decimal(12,4) DEFAULT NULL, + Engine_Smoke_on_Load text, + Engine_acceleration_smoke text, + Range_Gear_Shifting text, + Speed_Gear_Shifting text, + Draft_Response text, + Tractor_Steer_ability text, + Tractor_braking_Perf text, + Front_Visibility text, + Implement_Accessibility text, + Front_Wheel_dragging_at_turning text, + Front_end_lifting_during_operation text, + RPM_Recovery_Time text, + Engine_Vibration text, + Engine_Sound text, + Implement_Lifting_per_Lowering_response text, + Pulverization_Quality text, + Pulverization_Index text, + test_engr_comments text, + test_mgr_comments text, + Created_by text NULL, + Create_timestamp timestamp NULL default now() +) ; + +DROP TABLE field_perf_summary_implement_info; + +CREATE TABLE field_perf_summary_implement_info ( + syspk serial NOT NULL, + client_id smallint NOT NULL, + function_id smallint NOT NULL, + Test_Instance_ID int NULL, + Name_of_implement text NULL, + Test_File_Ref_No int NULL, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Implement_Type text, + Implement_Size text, + Hitch_Category text, + Implement_Weight int DEFAULT NULL, + Type_of_Cage_Wheel text, + Cage_Wheel_Width_mm int DEFAULT NULL, + Cage_wheel_Weight int DEFAULT NULL, + Cage_Wheel_inner_and_Outer_Ring_Dia_mm int DEFAULT NULL, + Cage_Wheel_Center_Ring_Dia_mm int DEFAULT NULL, + Dist_between_RHS_and_LHS_cage_wheel_Inner_Ring_mm int DEFAULT NULL, + No_of_angles_on_cage_wheel int DEFAULT NULL, + Soil_Type text, + soil_Moisture_Content_pct decimal(12,4) DEFAULT NULL, + soil_Bulk_Density_g_per_cc decimal(12,4) DEFAULT NULL, + Soil_Cone_Index decimal(12,4) DEFAULT NULL, + Field_Condition text, + Season text, + Created_by text NULL, + Create_timestamp timestamp NULL default now() +); + +/* This table is deprecated and columns are added to test_instance_implement_info */ +DROP TABLE field_perf_summary_Soil_info; + +CREATE TABLE field_perf_summary_Soil_info ( + syspk serial NOT NULL, + client_id smallint NOT NULL, + function_id smallint NOT NULL, + Test_Instance_ID int NULL, + Test_File_Ref_No int NULL, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Soil_Type text, + soil_Moisture_Content_pct decimal(12,4) DEFAULT NULL, + soil_Bulk_Density_g_per_cc decimal(12,4) DEFAULT NULL, + Soil_Cone_Index decimal(12,4) DEFAULT NULL, + Field_Condition text, + Season text, + Created_by text NULL, + Create_timestamp timestamp NULL default now() +) ; + +CREATE TABLE field_perf_summary_tractor_info ( + syspk serial NOT NULL, + client_id smallint NOT NULL, + function_id smallint NOT NULL, + Test_Instance_ID int NULL, + Test_instance_Tractor_ID int NULL, + Test_File_Ref_No int NULL, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Tractor_Model text NULL, + Tractor_Make text, + Tractor_Engine_HP int DEFAULT NULL, + Rated_RPM int DEFAULT NULL, + Transmission_Type text, + Wheel_Drive_Type text DEFAULT NULL, + FIP_Type text, + Steering_Type text, + Tractor_Weight_Front_kg int DEFAULT NULL, + Tractor_Weight_Rear_kg int DEFAULT NULL, + Tractor_Weight_Total_kg int DEFAULT NULL, + Created_by text NULL, + Create_timestamp timestamp NULL default now() +) ; + +drop table field_perf_summary_trailer_info + +CREATE TABLE field_perf_summary_trailer_info ( + syspk serial NOT NULL, + client_id smallint NOT NULL, + function_id smallInt NOT NULL, + Test_Instance_ID int NULL, + Trailer_type text NULL, + Test_File_Ref_No int NULL, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Tire_size_and_inflation_pressure_psi text, + No_Of_Axle int DEFAULT NULL, + No_Of_Wheels int DEFAULT NULL, + Trailer_Gross_Weight_Kg int DEFAULT NULL, + Tractor_RWC_to_Hitch_Point_Center_Dist_mm int DEFAULT NULL, + Tractor_Hitch_Ht_mm int DEFAULT NULL, + Trailer_hitch_Height_above_ground_level_mm int DEFAULT NULL, + Gradient_Slope_1_Degree int DEFAULT NULL, + Gradient_Slope_2_Degree int DEFAULT NULL, + Tractor_Hitch_Type text NULL, + Created_by text NULL, + Create_timestamp timestamp NULL default now() +) ; + + DROP TABLE Drawbar_Perf_results_summary; + +CREATE TABLE Drawbar_Perf_results_summary ( + syspk serial NOT NULL, + client_id smallint not null, + function_id smallint not null, + Test_Instance_ID int NULL, + Gear_Number_and_Range text NULL, + Test_File_Ref_No int NULL, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Test_instance_Tractor_ID int, + Tractor_Model text, + Tractor_Make text, + Travel_Speed_Km_per_hr numeric, + Drawbar_Power_kW numeric, + Drawbar_Power_hp numeric, + Drawbar_Pull_kgf int, + Drawbar_Pull_kN numeric, + Engine_speed_min_1 int, + Fan_Speed_min_1 int, + Wheel_Slip_Pct_Front numeric, + No_of_load_lugs_Front numeric, + Wheel_Slip_Pct_Rear numeric, + Fuel_Consumption_l_per_h numeric, + Fuel_Consumption_Kg_per_kWh numeric, + Fuel_Consumption_g_per_kWh numeric, + Fuel_Consumption_kWh_per_l numeric, + Temp_Engine_oil_C int, + Temp_Trans_Oil_C int, + Temp_Coolant_C int, + Temp_Fuel_In_C int, + Temp_Fuel_out_C int, + Atm_conditions_RH_Pct numeric, + Atm_conditions_Temp_C numeric, + Atm_conditions_Pressure_kPa numeric, + Created_by text NULL, + Create_timestamp timestamp NULL default now() + ); + + DROP TABLE Drawbar_Perf_results; + +CREATE TABLE Drawbar_Perf_results ( + syspk serial NOT NULL, + client_id smallint not null, + function_id smallint not null, + Test_Instance_ID int NULL, + Gear_Number_and_Range text NULL, + Test_File_Ref_No int NULL, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Test_instance_Tractor_ID int, + Tractor_Model text, + Tractor_Make text, + Travel_Speed_Km_per_hr numeric, + Drawbar_Power_kW numeric, + Drawbar_Power_hp numeric, + Drawbar_Pull_kgf int, + Drawbar_Pull_kN numeric, + Engine_speed_min_1 int, + Fan_Speed_min_1 int, + Wheel_Slip_Pct_Front numeric, + No_of_load_lugs_Front numeric, + Wheel_Slip_Pct_Rear numeric, + Fuel_Consumption_l_per_h numeric, + Fuel_Consumption_Kg_per_kWh numeric, + Fuel_Consumption_g_per_kWh numeric, + Fuel_Consumption_kWh_per_l numeric, + Temp_Engine_oil_C int, + Temp_Trans_Oil_C int, + Temp_Coolant_C int, + Temp_Fuel_In_C int, + Temp_Fuel_out_C int, + Atm_conditions_RH_Pct numeric, + Atm_conditions_Temp_C numeric, + Atm_conditions_Pressure_kPa numeric, + Created_by text NULL, + Create_timestamp timestamp NULL default now() + ); + + DROP TABLE Drawbar_Perf_OECD_results; + + CREATE TABLE Drawbar_Perf_OECD_results ( + syspk serial NOT NULL, + client_id smallint not null, + function_id smallint not null, + Test_Instance_ID int NULL, + Test_Condition text, + Gear_Number_and_Range text, + Travel_Speed_Km_per_hr numeric, + Test_File_Ref_No int NULL, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Test_instance_Tractor_ID int, + Tractor_Model text, + Tractor_Make text, + Srl_No text, + Drawbar_Power_kW numeric, + Drawbar_Power_hp numeric, + Drawbar_Pull_kgf int, + Drawbar_Pull_kN numeric, + Engine_speed_min_1 int, + Fan_Speed_min_1 int, + Wheel_Slip_Pct_Front numeric, + No_of_load_lugs_Front numeric, + Wheel_Slip_Pct_Rear numeric, + Fuel_Consumption_l_per_h numeric, + Fuel_Consumption_Kg_per_kWh numeric, + Fuel_Consumption_g_per_kWh numeric, + Fuel_Consumption_kWh_per_l numeric, + Temp_Engine_oil_C int, + Temp_Trans_Oil_C int, + Temp_Coolant_C int, + Temp_Fuel_In_C int, + Temp_Fuel_out_C int, + Atm_conditions_RH_Pct numeric, + Atm_conditions_Temp_C numeric, + Atm_conditions_Pressure_kPa numeric, + Created_by text NULL, + Create_timestamp timestamp NULL default now() + ); + + DROP TABLE Drawbar_Perf_observations; + + CREATE TABLE Drawbar_Perf_observations ( + syspk serial NOT NULL, + client_id smallint not null, + function_id smallint not null, + Test_Instance_ID int NULL, + Srl_No int NULL, + Test_File_Ref_No int NULL, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Test_instance_Tractor_ID int, + Tractor_Model text, + Tractor_Make text, + Test_Parameter text, + Acceptance_Criteria text, + Observation text, + Remarks text, + Created_by text NULL, + Create_timestamp timestamp NULL default now() + ); + +DROP TABLE PTO_Perf_results; + + CREATE TABLE PTO_Perf_results ( + SYSPK serial Not Null, + client_id int Not Null, + function_id int Not Null, + Test_instance_Id int Null, + PTO_Test_Type text Null, + PTO_Test_sub_type text null, + Speed_Engine_rpm int Null, + Test_File_Ref_No int Null, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Test_instance_Tractor_Id int Null, + Tractor_Model text Null, + Tractor_Make text Null, + Serial_number text Null, + Speed_PTO_rpm numeric Null, + Torque_N_m numeric Null, + Torque_Kg_m numeric Null, + power_kw numeric Null, + power_hp numeric Null, + Eq_Crank_Torque_Nm numeric Null, + Fuel_Consumption_g_per_min numeric Null, + Fuel_Consumption_Kg_per_hr numeric Null, + Fuel_Consumption_ltr_per_hr numeric Null, + Fuel_Consumption_SFC_kg_per_kWh numeric Null, + Fuel_Consumption_SFC_g_per_hph numeric Null, + Sp_Energy_kwh_per_ltr numeric Null, + Temperatures_Fuel_C numeric Null, + Temperatures_Ambient_C numeric Null, + Temperatures_Air_in_C numeric Null, + Temperatures_Water_outlet_C numeric Null, + Temperatures_Exh_C numeric Null, + Engine_oil_C numeric Null, + Pressure_Ambient_mm_of_hg numeric Null, + Pressure_Exh_Mm_of_hg numeric Null, + Pressure_Lub_oil_Bar numeric Null, + RH_pct numeric Null, + Average_YN Text Null, + created_by text null, + create_timestamp timestamp Null default now() +); + +DROP TABLE PTO_Perf_Report_Summary; + +create table PTO_Perf_Report_Summary ( + SYSPK serial Not Null, + client_id int Not Null, + function_id int Not Null, + Test_instance_Id int Null, + PTO_Category text Null, + PTO_Sub_Category text Null, + Test_File_Ref_No int Null, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Test_instance_Tractor_Id int Null, + Tractor_Model text Null, + Tractor_Make text Null, + Power_Kw numeric null, + Speed_rpm_PTO int null, + Speed_rpm_Engine int null, + Fuel_Consumption_ltr_per_hr numeric null, + Fuel_Consumption_kg_per_h numeric null, + SFC_kg_per_kWh numeric null, + Specifc_Energy_kWh_per_ltr numeric null, + created_by text null, + create_timestamp timestamp Null default now() +); + +drop table PTO_Perf_Report_Details; + +create table PTO_Perf_Report_Details ( + SYSPK serial Not Null, + client_id int Not Null, + function_id int Not Null, + Test_instance_Id int Null, + Ambient_type Text Null, + Test_File_Ref_No int Null, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Test_instance_Tractor_Id int Null, + Tractor_Model text Null, + Tractor_Make text Null, + No_load_max_engine_speed_rpm int null, + equi_crankshaft_torque_at_max_power_Nm numeric null, + max_equi_crankshaft_torque_Nm numeric null, + Engine_speed_at_max_equi_crankshaft_torque_rpm numeric null, + pct_Backup_torque numeric null, + Pct_Smoke_level_max_light_absorption_coef_per_mtr numeric null, + Range_of_atm_conditions_Temp_C text null, + Range_of_atm_conditions_Pressure_kPa text null, + Range_of_atm_conditions_Rel_HumIdity_Pct text null, + max_temp_Engine_Oil_C numeric null, + max_temp_Coolant_water_C numeric null, + max_temp_Fuel_C numeric null, + max_temp_Air_intake_C numeric null, + max_temp_Exhaust_Gas_C numeric null, + Pressure_at_max_Power_intake_Air_kPa numeric null, + Pressure_at_max_Power_Exhst_gas_bfr_turbo_charger_kPa numeric null, + Consumptions_Lub_oil_gkWh numeric null, + Consumptions_coolant_Water_Pct_of_total_coolant_capacity numeric null, + created_by text null, + create_timestamp timestamp Not Null default now() +); + + +drop table PTO_Perf_test_observations; + +create table PTO_Perf_test_observations ( + SYSPK serial Not Null, + client_id int Not Null, + function_id int Not Null, + Test_instance_Id int Null, + Srl_No text Null, + Test_File_Ref_No int Null, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Test_instance_Tractor_Id int Null, + Tractor_Model text Null, + Tractor_Make text Null, + Characteristic text Null, + Category_Evaluative_or_Non_Evaluative text Null, + Requirements_as_per_IS_12207_2008 text Null, + Values_declared_by_the_applicant_D_Rqmt text Null, + As_observed numeric Null, + Whether_meets_the_requirements_YN text Null, + created_by text null, + create_timestamp timestamp Null default now() +); + +drop table PTO_Key_Perf_Parameters; + +create table PTO_Key_Perf_Parameters ( + SYSPK serial Not Null, + client_id int Not Null, + function_id int Not Null, + Test_instance_Id int Null, + Test_Condtion text Null, + Test_File_Ref_No int Null, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Test_instance_Tractor_Id int Null, + Tractor_Model text Null, + Tractor_Make text Null, + PTO_Gear_Ratio numeric NULL, + Specific_gravity_of_fuel numeric NULL, + Dyno_Constant numeric NULL, + PTO_Power_hp numeric NULL, + PTO_Sfc_gm_per_hp_hr numeric NULL, + Backup_Torque_Pct numeric NULL, + Engine_Oil_Temp_C numeric NULL, + Coolant_Temp_C numeric NULL, + Rated_engine_speed_rpm int NULL, + Engine_High_Idle_Speed_rpm int NULL, + Engine_Low_Idle_Speed_rpm int NULL, + Maximum_Equi_Crankshaft_Torque_Nm numeric NULL, + Equi_Crankshaft_Torque_at_max_Power_Nm numeric NULL, + Ambient_Presure_mm_of_hg numeric NULL, + Related_Humidity_Pct numeric NULL, + Exhaust_Temperature_C numeric NULL, + Back_Pressure_mm_of_hg numeric NULL, + Engine_Oil_Pressure_bar numeric NULL, + Test_Engineer text NULL, + Test_Bed text NULL, + Location_name text NULL, + Total_Run_hrs int NULL, + Test_date date NULL, + created_by text null, + create_timestamp timestamp Not Null default now() +); + + +drop table PTO_smoke_Test; + +create table PTO_smoke_Test ( + SYSPK serial Not Null, + client_id int Not Null, + function_id int Not Null, + Test_instance_Id int Null, + Engine_speed_rpm int Null, + Test_File_Ref_No int Null, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Test_instance_Tractor_Id int Null, + Tractor_Model text Null, + Tractor_Make text Null, + PTO_Speed_rpm int Null, + Torque_100_pct numeric Null, + Torque_80_pct numeric Null, + Smoke_FSN_100_pct numeric Null, + Smoke_FSN_80_pct numeric Null, + created_by text null, + create_timestamp timestamp Not Null default now() +); + +drop table PTO_Engine_oil_consumption; + +create table PTO_Engine_oil_consumption ( + SYSPK serial Not Null, + client_id int Not Null, + function_id int Not Null, + Test_instance_Id int Null, + Srl_No text Null, + Test_File_Ref_No int Null, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Test_instance_Tractor_Id int Null, + Tractor_Model text Null, + Tractor_Make text Null, + Oil_Consumption_Gm_per_hr numeric Null, + Oil_consumption_pct_of_Fuel_consumption numeric Null, + created_by text null, + create_timestamp timestamp Not Null default now() +); + +drop table PTO_Multipoint_mapping; + +Create table PTO_Multipoint_mapping ( + SYSPK serial Not Null, --PK + client_id int Not Null, -- UKA1 + function_id int Not Null, -- UKA2 + Test_instance_Id int Null, -- UKA3 + Test_condition text Null, -- UKA4 + Engine_speed_rpm int Null, -- UKA5 + Engine_load_pct int Null, -- UKA6 + Test_File_Ref_No int Null, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Test_instance_Tractor_Id int Null, + Tractor_Model text Null, + Tractor_Make text Null, + SFC_gm_per_hp_hr numeric Null, + Fuel_Consumption_ltr_per_hr numeric Null, + created_by text null, + create_timestamp timestamp Not null default now() + ); + +drop table PTO_Perf_Governing_Graph + +Create table PTO_Perf_Governing_Graph ( + SYSPK serial Not Null, + client_id int Not Null, + function_id int Not Null, + Test_instance_Id int Null, + Test_condition text Null, + Engine_Speed_rpm int Null, + Test_File_Ref_No int Null, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Test_instance_Tractor_Id int Null, + Tractor_Model text Null, + Tractor_Make text Null, + Torque_Kg_m numeric Null, + Power_hp numeric Null, + SFC_gm_per_hp_hr numeric Null, + Fuelling_mm3_per_stroke_per_cyl numeric Null, + created_by text Null, + create_timestamp timestamp Not Null default now() +); + +drop table Budni_PTO_Perf_Results_summary; + +create table Budni_PTO_Perf_Results_summary ( + SYSPK serial Not Null, + client_id int Not Null, + function_id int Not Null, + Test_instance_Id int Null, + PTO_Category text Null, + PTO_Sub_Category text Null, + Test_File_Ref_No int Null, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Test_instance_Tractor_Id int Null, + Tractor_Model text Null, + Tractor_Make text Null, + Power_kW numeric Null, + Speed_rpm_PTO int Null, + Speed_rpm_Engine int Null, + Fuel_Consumption_ltr_per_hr numeric Null, + Fuel_Consumption_kg_per_hr numeric Null, + specific_kg_per_kWh numeric Null, + Specifc_Energy_kWhl numeric Null, + created_by text null, + create_timestamp timestamp Not Null default now() +); + +drop table Budni_PTO_Perf_Results_Details; + +create table Budni_PTO_Perf_Results_Details ( + SYSPK serial Not Null, + client_id int Not Null, + function_id int Not Null, + Test_instance_Id int Null, + Ambient_type Text Null, + Test_File_Ref_No int Null, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Test_instance_Tractor_Id int Null, + Tractor_Model text Null, + Tractor_Make text Null, + No_load_max_engine_speed_rpm int Null, + equi_crankshaft_torque_at_max_power_Nm numeric Null, + max_equi_crankshaft_torque_Nm int Null, + Engine_speed_at_max_equi_crankshaft_torque_rpm numeric Null, + Backup_torque text Null, + Pct_Smoke_level_max_light_absorption_coef_per_mtr numeric Null, + Range_of_atm_conditions_Temp_C text Null, + Range_of_atm_conditions_Pressure_kPa text Null, + Range_of_atm_conditions_Rel_HumIdity_Pct text Null, + max_temp_Engine_Oil_C int Null, + max_temp_Coolant_water_C int Null, + max_temp_Fuel_c int Null, + max_temp_Air_intake_C int Null, + max_temp_Exhaust_Gas_C int Null, + Pressure_at_max_Power_intake_Air_kPa numeric Null, + Pressure_at_max_Power_Exhst_gas_bfr_turbo_charger_kPa Text Null, + Consumptions_Lub_oil_gkWh numeric Null, + Consumptions_coolant_Water_Pct_of_total_coolant_capacity numeric Null, + created_by text null, + create_timestamp timestamp Not Null default now() +); + +drop table Budni_Drawbar_Perf_Results; + +create table Budni_Drawbar_Perf_Results ( + SYSPK serial Not Null, + client_id int Not Null, + function_id int Not Null, + Test_instance_Id int Null, + Test_Condtion text Null, + Gear_Used text Null, + Test_File_Ref_No int Null, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Test_instance_Tractor_Id int Null, + Tractor_Model text Null, + Tractor_Make text Null, + Travel_speed_km_per_hr numeric null, + Drawbar_Power_kW numeric Null, + Drawbar_Pull_kN numeric Null, + Engine_speed_rpm int Null, + Wheel_Slippage_Pct numeric Null, + Fuel_Consumption_Kg_per_kWh numeric Null, + Fuel_consumption_ltr_per_hr numeric null, + specific_energy_kwh_per_ltr numeric Null, + Temp_Fuel_C text Null, + Temp_trans_oil_C text NULL, + Temp_Coolant_C text Null, + Temp_Engine_oil_C text Null, + Atmosp_conditions_RH_Pct text Null, + Atmosp_conditions_Temp_C text Null, + Atmosp_conditions_Pressure_kPa text Null, + created_by text null, + create_timestamp timestamp Not Null default now() +); + +drop table Budni_Hydraulic_Power_test_Results; + +create table Budni_Hydraulic_Power_test_Results ( + SYSPK serial Not Null, + client_id int Not Null, + function_id int Not Null, + Test_instance_Id int Null, + Test_File_Ref_No int Null, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Test_instance_Tractor_Id int Null, + Tractor_Model text Null, + Tractor_Make text Null, + Pump_dlvry_rate_at_min_pressure_engine_speed_l_per_min numeric Null, + Max_hydraulic_power_kW numeric Null, + Pump_dlvry_rate_at_Max_hydraulic_power_lmin numeric Null, + Pressure_at_Max_hydraulic_power_MPa numeric Null, + Sustained_pressure_of_the_open_relief_valve_Mpa numeric Null, + tapping_point_Relief_valve_test text Null, + tapping_Point_Pump_perf_test text Null, + tapping_Point_Temperature_of_hydraulic_fluId_C text Null, + created_by text null, + create_timestamp timestamp Not Null default now() +); + +drop table Budni_Hydraulic_Lifting_Capacity_test_Results; + +create table Budni_Hydraulic_Lifting_Capacity_test_Results ( + SYSPK serial Not Null, + client_id int Not Null, + function_id int Not Null, + Test_instance_Id int Null, + Test_condition Text Null, + Test_File_Ref_No int Not Null, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Test_instance_Tractor_Id int Null, + Tractor_Model text Null, + Tractor_Make text Null, + Height_of_lower_hitch_pt_above_ground_in_down_position_mm int Null, + Vertical_move_ment_with_lifting_forces_mm int Null, + Max_force_exerted_through_full_range_kN numeric Null, + Corresponding_pressure_MPa int Null, + Moment_about_rear_axle_kN_m numeric Null, + Max_tilt_angle_of_mast_from_vertical_degrees numeric Null, + created_by text null, + create_timestamp timestamp Not Null default now() +); + +drop table Budni_Hydraulic_Maint_of_lift_Load_Results; + +create table Budni_Hydraulic_Maint_of_lift_Load_Results ( + SYSPK serial Not Null, + client_id int Not Null, + function_id int Not Null, + Test_instance_Id int Null, + Elapsed_time_min int Null, + Test_File_Ref_No int Not Null, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Test_instance_Tractor_Id int Null, + Tractor_Model text Null, + Tractor_Make text Null, + Force_applied_at_the_frame_kN numeric Null, + Temp_of_hydraulic_fluid_at_the_start_of_test_C numeric Null, + Cumulative_drop_in_height_of_lift_mm numeric Null, + created_by text null, + create_timestamp timestamp Not Null default now() +); + +drop table Budni_Brake_Perf_Service_Brake_Test_Results; + +create table Budni_Brake_Perf_Service_Brake_Test_Results ( + SYSPK serial Not Null, + client_id int Not Null, + function_id int Not Null, + Test_instance_Id int Null, + Brake_Test_Type text Null, + Brake_Test_Name text Null, + Speed_condition text Null, + Ballast_Condition text Null, + Trial_number int Null, + Test_File_Ref_No int Null, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Test_instance_Tractor_Id int Null, + Tractor_Model text Null, + Tractor_Make text Null, + Braking_device_control_force_N int Null, + Mean_deceleration_msec2 numeric Null, + Stopping_Dist_m numeric Null, + Max_dev_of_tractor_from_its_org_course_m text Null, + Abnormal_vibration text Null, + The_brakes_were_heated_by text Null, + created_by text null, + create_timestamp timestamp Not Null default now() +); + +drop table Budni_Brake_Perf_Parking_Brake_Test_Results; + +create table Budni_Brake_Perf_Parking_Brake_Test_Results ( + SYSPK serial Not Null, + client_id int Not Null, + function_id int Not Null, + Test_instance_Id int Null, + Test_condition text Null, + Test_File_Ref_No int Null, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Test_instance_Tractor_Id int Null, + Tractor_Model text Null, + Tractor_Make text Null, + Braking_device_control_force_N_Facing_up int Null, + Efficacy_of_parking_brake_Facing_up text Null, + Braking_device_control_force_N_Facing_down int Null, + Efficacy_of_parking_brake_Facing_down text Null, + created_by text null, + create_timestamp timestamp Not Null default now() +); + +DROP table Budni_Noise_Atmospheric_conditions; + +create table Budni_Noise_Atmospheric_conditions( + SYSPK serial Not Null, + client_id int Not Null, + function_id int Not Null, + Test_instance_Id int Null, + Noise_position text Null, + Test_File_Ref_No int Null, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Test_instance_Tractor_Id int Null, + Tractor_Model text Null, + Tractor_Make text Null, + Background_noise_level_dBA int null, + Temperature_C int null, + Pressure_kPa numeric null, + Relative_humIdity_Pct int null, + Wind_velocity_ms numeric null, + created_by text null, + create_timestamp timestamp Not Null default now() +); + +DROP table Budni_Noise_Measurement_Results; + +create table Budni_Noise_Measurement_Results ( + SYSPK serial Not Null, + client_id int Not Null, + function_id int Not Null, + Test_instance_Id int Null, + Noise_position text Null, + Gear text Null, + Test_File_Ref_No int Null, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Test_instance_Tractor_Id int Null, + Tractor_Model text Null, + Tractor_Make text Null, + Drawbar_pull_max_noise_kN text null, + Travel_speed_km_per_hr numeric null, + Noise_level_dB_A numeric null, + created_by text null, + create_timestamp timestamp Not Null default now() +); + +DROP TABLE Budni_Vibration_Measurement; + +create table Budni_Vibration_Measurement ( + SYSPK serial Not Null, + client_id int Not Null, + function_id int Not Null, + Test_instance_Id int Null, + Measuring_Points text Null, + Srl_No int Null, + Test_File_Ref_No int Null, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Test_instance_Tractor_Id int Null, + Tractor_Model text Null, + Tractor_Make text Null, + Vibration_At_no_load_VD_microns int null, + Vibration_At_no_load_HD_microns int null, + Vibration_At_load_85_Pct_of_max_PTO_Power_VD_microns int null, + Vibration_At_load_85_Pct_of_max_PTO_Power_HD_microns int null, + created_by text null, + create_timestamp timestamp Not Null default now() +); + +DROP table Budni_Centre_of_Gravity_Location; + +create table Budni_Centre_of_Gravity_Location ( + SYSPK serial Not Null, + client_id int Not Null, + function_id int Not Null, + Test_instance_Id int Null, + condition text Null, + Particulars text Null, + Test_File_Ref_No int Null, + Test_instance_Tractor_Id int Null, + Tractor_Model text Null, + Tractor_Make text Null, + coordinates text Null, + created_by text null, + create_timestamp timestamp Not Null default now() +); + +DROP table Budni_Field_Perf_Results; + +create table Budni_Field_Perf_Results ( +SYSPK serial Not Null, +Client_Id int Not Null, +Function_Id int Not Null, +Test_Instance_Id int Null, +Operation_type text Null, +Test_File_Ref_No int Null, +Test_File_Format text Null, +Test_File_Sheet_Format text Null, +Test_Instance_Tractor_Id int Null, +Tractor_Model text Null, +Tractor_Make text Null, +Type_of_soil text Null, +Avg_soil_moisture_pct_ text Null, +Avg_depth_of_standing_water_cm text Null, +Bulk_density_of_soil_g_per_cc text Null, +Cone_index_kgf_per_sq_cm text Null, +Puddling_index_pct text Null, +Gear_used text Null, +Avg_speed_of_operation_kmph text Null, +Avg_wheel_slip_pct text Null, +Avg_Travel_reduction_pct text Null, +Avg_depth_of_cut_cm text Null, +Avg_Depth_of_puddle_cm text Null, +Avg_working_width_cm text Null, +Area_covered_ha_per_hr text Null, +Fuel_consumption_ltr_per_hr text Null, +Fuel_consumption_ltr_per_ha text Null, +Avg_draft_of_implement_kN text Null, +Created_By text null, +Create_Timestamp timestamp Not Null default now() +); + +DROP TABLE Budni_Haulage_Perf_Results; + +create table Budni_Haulage_Perf_Results ( +SYSPK serial Not Null, +client_id int Not Null, +function_id int Not Null, +Test_instance_Id int Null, +Wheel_Drive_type text Null, +Test_File_Ref_No int Null, +Test_File_Format text NULL, +Test_File_Sheet_Format text NULL, +Test_instance_Tractor_Id int Null, +Tractor_Model text Null, +Tractor_Make text Null, +Gross_mass_of_trailer_tonne int Null, +Height_of_trailer_hitch_above_ground_level_mm int Null, +Gear_used_negotiating_slopes_up_to_8Pct text Null, +Avg_travel_speed_kmph text Null, +Avg_fuel_consumption_ltr_per_hr text Null, +Avg_fuel_consumption_ml_per_km_per_tonne text Null, +Avg_Dist_traveled_per_litre_of_fuel_consumption_km text Null, +Effectiveness_of_Brakes text Null, +Maneuverability_of_tractor_trailer_combination text Null, +created_by text null, +create_timestamp timestamp Not Null default now() +); + +DROP TABLE Budni_Air_Cleaner_Perf_Results; + +create table Budni_Air_Cleaner_Perf_Results ( +SYSPK serial Not Null, +client_id int Not Null, +function_id int Not Null, +Test_instance_Id int Null, +Sequence_Number int Null, +Test_File_Ref_No int Null, +Test_File_Format text NULL, +Test_File_Sheet_Format text NULL, +Test_instance_Tractor_Id int Null, +Tractor_Model text Null, +Tractor_Make text Null, +Atm_Condtion_temperature_C text null, +Atm_Condition_Pressure_kPa text null, +Atm_Condition_Relative_humIdity_Pct numeric null, +Atm_condtion_mass_of_oil_before_test numeric null, +Position_of_tractor Text null, +Loss_of_oil_g numeric null, +Oil_pull_Over_Pct numeric null, +Engine_oil_pressure Text null, +created_by text null, +create_timestamp timestamp Not Null default now() +); + +DROP table Budni_Test_observations; + + +create table Budni_Test_observations( + SYSPK serial Not Null, + client_id int Not Null, + function_id int Not Null, + Test_instance_Id int Null, + sequence_number int null, + Test_File_Ref_No int Null, + Test_File_Format text NULL, + Test_File_Sheet_Format text NULL, + Test_instance_Tractor_Id int Null, + Tractor_Model text Null, + Tractor_Make text Null, + Srl_No text Null, + Characteristic text null, + Category_Evaluative_or_Non_Evaluative text null, + Requirements_as_per_IS_12207_2008 text null, + Values_declared_by_the_applicant_D_Rqmt text null, + As_observed text null, + Whether_meets_the_requirements_YN text null, + created_by text null, + create_timestamp timestamp Not Null default now() +); + +DROP TABLE IHT_CGM_Lifting_Angle_Load_Details + +CREATE TABLE IHT_CGM_Lifting_Angle_Load_Details ( +SYSPK serial NOT Null, +Client_Id int Not Null, +Function_Id int Not Null, +Test_Instance_Id int Null, +Angle numeric Null, +Test_File_Ref_No int Null, +Test_File_Format text Null, +Test_File_Sheet_Format text Null, +Test_Instance_Tractor_Id int Null, +Tractor_Model text Null, +Tractor_Make text Null, +Value_in_tan numeric Null, +Diff_Of_tan_value numeric Null, +Load_kn numeric Null, +Load_kg numeric Null, +Diff_in_Load_kg numeric Null, +Vertical_Co_Ordinate_Z_mm numeric Null, +Created_By text null, +Create_Timestamp timestamp Not Null default now() +); + +DROP TABLE IHT_CGM_Results; + +CREATE TABLE IHT_CGM_Results ( +SYSPK serial Not Null, +Client_Id int Not Null, +Function_Id int Not Null, +Test_Instance_Id int Null, +Test_File_Ref_No int Null, +Test_File_Format text Null, +Test_File_Sheet_Format text Null, +Test_Instance_Tractor_Id int Null, +Tractor_Model text Null, +Tractor_Make text Null, +Horizontal_Distance_from_RAC_X_mm numeric null, +Lateral_Co_Ordinate_in_Horizontal_Plane_Y_mm numeric null, +Vertical_Co_Ordinate_Z_mm numeric null, +Created_By text null, +Create_Timestamp timestamp Not Null default now() +); + +DROP TABLE IHT_Steering_Effort; + +CREATE TABLE IHT_Steering_Effort ( +SYSPK serial Not Null, +Client_Id int Not Null, +Function_Id int Not Null, +Test_Instance_Id int Null, +Test_condition text Null, +Test_Speed_kmph text Null, +Test_File_Ref_No int Null, +Test_File_Format text Null, +Test_File_Sheet_Format text Null, +Test_Instance_Tractor_Id int Null, +Tractor_Model text Null, +Tractor_Make text Null, +Max_Angle_LH numeric Null, +Max_Angle_RH numeric Null, +Max_Effort_LH numeric Null, +Max_Effort_RH numeric Null, +Created_By text null, +Create_Timestamp timestamp Not Null default now() +); + +DROP TABLE IHT_Pedal_Effort; + +CREATE TABLE IHT_Pedal_Effort ( +SYSPK serial Not Null, +Client_Id int Not Null, +Function_Id int Not Null, +Test_Instance_Id int Null, +Parameters text Null, +Test_File_Ref_No int Null, +Test_File_Format text Null, +Test_File_Sheet_Format text Null, +Test_Instance_Tractor_Id int Null, +Tractor_Model text Null, +Tractor_Make text Null, +Efforts_Kg numeric Null, +Travel_mm numeric Null, +Created_By text null, +Create_Timestamp timestamp Not Null default now() +); + +DROP TABLE IHT_Gear_Effort; + +CREATE TABLE IHT_Gear_Effort ( +SYSPK serial Not Null, +Client_Id int Not Null, +Function_Id int Not Null, +Test_Instance_Id int Null, +Parameters text Null, +Test_File_Ref_No int Null, +Test_File_Format text Null, +Test_File_Sheet_Format text Null, +Test_Instance_Tractor_Id int Null, +Tractor_Model text Null, +Tractor_Make text Null, +Efforts_Kg numeric Null, +Created_By text null, +Create_Timestamp timestamp Not Null default now() +); + +DROP TABLE IHT_Brake_Pedal_Effort; + +cREATE TABLE IHT_Brake_Pedal_Effort ( +SYSPK serial Not Null, -- PK +Client_Id int Not Null, -- +Function_Id int Not Null, +Test_Instance_Id int Null, +Pedal_Effort_Kg numeric Null, +Test_File_Ref_No int Null, +Test_File_Format text Null, +Test_File_Sheet_Format text Null, +Test_Instance_Tractor_Id int Null, +Tractor_Model text Null, +Tractor_Make text Null, +Srl_No text Null, +Pedal_Travel_RH_mm numeric Null, +Pedal_Travel_LH_mm numeric Null, +Pedal_Travel_Latched_mm numeric Null, +Created_By text null, +Create_Timestamp timestamp Not Null default now() +); + +DROP TABLE IHT_Clutch_Pedal_Effort; + +CREATE TABLE IHT_Clutch_Pedal_Effort ( +SYSPK serial Not Null, +Client_Id int Not Null, +Function_Id int Not Null, +Test_Instance_Id int Null, +Pedal_Effort_Kg numeric Null, +Test_File_Ref_No int Null, +Test_File_Format text Null, +Test_File_Sheet_Format text Null, +Test_Instance_Tractor_Id int Null, +Tractor_Model text Null, +Tractor_Make text Null, +Srl_No text Null, +Pedal_Travel_mm numeric Null, +Created_By text null, +Create_Timestamp timestamp Not Null default now() +); + +DROP TABLE IHT_Hyd_Lift_Sensitivity; + +CREATE TABLE IHT_Hyd_Lift_Sensitivity ( +SYSPK serial Not Null, +Client_Id int Not Null, +Function_Id int Not Null, +Test_Instance_Id int Null, +TPL_load text Null, +Engine_RPM_type text Null, +Engine_RPM int Null, +Test_File_Ref_No int Null, +Test_File_Format text Null, +Test_File_Sheet_Format text Null, +Test_Instance_Tractor_Id int Null, +Tractor_Model text Null, +Tractor_Make text Null, +lifting_time_sec numeric Null, +Lowering_time_sec numeric null, +Created_By text null, +Create_Timestamp timestamp Not Null default now() +); + +DROP TABLE IHT_Speed_lead_lag_measurement; + +CREATE TABLE IHT_Speed_lead_lag_measurement ( +SYSPK serial Not Null, +Client_Id int Not Null, +Function_Id int Not Null, +Test_Instance_Id int Null, +Gear text Null, +Test_File_Ref_No int Null, +Test_File_Format text Null, +Test_File_Sheet_Format text Null, +Test_Instance_Tractor_Id int Null, +Tractor_Model text Null, +Tractor_Make text Null, +Engine_RPM int Null, +Wheel_Drive_type text Null, +No_of_Revolution_front numeric Null, +Ratio numeric Null, +Lead_Lag_PCT text Null, +Created_By text null, +Create_Timestamp timestamp Not Null default now() +); + +DROP TABLE IHT_Gear_Max_Speed; + +CREATE TABLE IHT_Gear_Max_Speed ( +SYSPK serial Not Null, +Client_Id int Not Null, +Function_Id int Not Null, +Test_Instance_Id int Null, +Test_condition text Null, +Gear text Null, +Test_File_Ref_No int Null, +Test_File_Format text Null, +Test_File_Sheet_Format text Null, +Test_Instance_Tractor_Id int Null, +Tractor_Model text Null, +Tractor_Make text Null, +LOW_1000_RPM numeric Null, +RATED_2300_RPM numeric Null, +Specification numeric Null, +HIGH_2500_RPM numeric Null, +Actual_Speed_pct numeric Null, +Diff_in_Speed_KMPH numeric Null, +Created_By text null, +Create_Timestamp timestamp Not Null default now() +); + +DROP TABLE IHT_Brake_Perf_test_condition; + +CREATE TABLE IHT_Brake_Perf_test_condition ( +SYSPK serial Not Null, +Client_Id int Not Null, +Function_Id int Not Null, +Test_Instance_Id int Null, +Date_of_Test date Null, +Time_of_Test text NULL, +Location_name text Null, +Test_Mode text Null, +Test_File_Ref_No int Null, +Test_File_Format text Null, +Test_File_Sheet_Format text Null, +Test_Instance_Tractor_Id int Null, +Tractor_Model text Null, +Tractor_Make text Null, +Created_By text null, +Create_Timestamp timestamp Not Null default now() +); + +DROP TABLE IHT_Brake_Perf_test_results; + +CREATE TABLE IHT_Brake_Perf_test_results ( +SYSPK serial Not Null, +Client_Id int Not Null, +Function_Id int Not Null, +Test_Instance_Id int Null, +Brake_perf_Test_condition_Id int Null, +Trigger_speed_km_per_h numeric Null, +Brake_Control_Input_Force_kg numeric Null, +Test_File_Ref_No int Null, +Test_File_Format text Null, +Test_File_Sheet_Format text Null, +Test_Instance_Tractor_Id int Null, +Tractor_Model text Null, +Tractor_Make text Null, +Srl_No int Null, +Required_Corrected_Stopping_distance_m numeric Null, +Actual_Stopping_Distance_m numeric Null, +Deceleration_m_s2_V2_2s numeric Null, +Wind_velocity_kmph text Null, +Ambient_Temp_C numeric Null, +HumIdity_RH_PCT numeric Null, +Observation text Null, +Created_By text null, +Create_Timestamp timestamp Not Null DEFAULT now() +); + +DROP TABLE IHT_Hot_Air_Mapping_Results; + +CREATE TABLE IHT_Hot_Air_Mapping_Results ( +SYSPK serial Not Null, +Client_Id int Not Null, +Function_Id int Not Null, +Test_Instance_Id int Null, +Gear Text Null, +Load_kg int Null, +Speed_kmph numeric Null, +Speed_rpm int Null, +Test_File_Ref_No int Null, +Test_File_Format text Null, +Test_File_Sheet_Format text Null, +Test_Instance_Tractor_Id int Null, +Tractor_Model text Null, +Tractor_Make text Null, +Ambient_measured_temp_C int Null, +Head_measured_temp_C int Null, +Head_ROA_C int Null, +Chest_measured_temp_C int Null, +Chest_ROA_C int Null, +LH_Leg_measured_temp_C int Null, +LH_Leg_ROA_C int Null, +RH_Leg_measured_temp_C int Null, +RH_Leg_ROA_C int Null, +RH_Hand_measured_temp_C int Null, +RH_Hand_ROA_C int Null, +LH_Hand_measured_temp_C int Null, +LH_Hand_ROA_C int Null, +Hood_Gas_spring_RH_sIde_measured_temp_C int Null, +Hood_Gas_spring_RH_sIde_ROA_C int Null, +Hood_foam_top_measured_temp_C int Null, +Hood_foam_top_ROA_C int Null, +Hood_foam_mIddle_measured_temp_C int Null, +Hood_foam_mIddle_ROA_C int Null, +Hood_foam_bottom_measured_temp_C int Null, +Hood_foam_bottom_ROA_C int Null, +outsIde_Hood_top_measured_temp_C int Null, +outsIde_Hood_top_ROA_C int Null, +outsIde_Hood_MIddle_measured_temp_C int Null, +outsIde_Hood_MIddle_ROA_C int Null, +outsIde_Hood_Bottom_measured_temp_C int Null, +outsIde_Hood_Bottom_ROA_C int Null, +Time_of_Test Text Null, +Towards_main_security_gate_YN Text Null, +Time_Diff_h_min numeric Null, +Average_YN text Null, +Created_By text null, +Create_Timestamp timestamp Not Null DEFAULT now() +); + +DROP TABLE IHT_Noise_Measurement_Results; + +CREATE TABLE IHT_Noise_Measurement_Results ( +SYSPK serial Not Null, +Client_Id int Not Null, +Function_Id int Not Null, +Test_Instance_Id int Null, +Test_Type text Null, +Test_condition text Null, +Test_mode text Null, +Gear text Null, +Speed_rpm int Null, +Load_kg int Null, +Test_File_Ref_No int Null, +Test_File_Format text Null, +Test_File_Sheet_Format text Null, +Test_Instance_Tractor_Id int Null, +Tractor_Model text Null, +Tractor_Make text Null, +speed_kmph numeric Null, +Noise_Level_1_dB_A numeric Null, +Noise_Level_2_dB_A numeric Null, +Noise_Level_3_dB_A numeric Null, +Created_By text null, +Create_Timestamp timestamp Not Null Default now() +); + +/* set default value for the created by column in each table to 'SYS' */ +ALTER TABLE Test_Master ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE Test_Lab_location_Master ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE Test_Instance ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE Test_instance_tractor_info ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE Test_instance_engine_info ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE Test_instance_implement_info ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE Test_instance_trailer_info ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE test_instance_tyre_info ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE test_instance_gear_speed_chart ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE test_instance_tractor_info_misc ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE test_instance_Wheels_info ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE test_instance_fuel_lubricant_info ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE test_instance_equipment_info ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE test_instance_measurement_uncertainty ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE test_instance_atmospheric_info ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE test_instance_drawbar_info ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE test_instance_weight_reaction ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE test_instance_images ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE Field_Perf_Summary_tractor_info ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE Field_Perf_Summary_implement_info ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE Field_Perf_Summary_trailer_info ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE Field_Perf_summary ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE Drawbar_Perf_results ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE Drawbar_Perf_results_summary ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE Drawbar_Perf_OECD_results ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE Drawbar_Perf_observations ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE PTO_Perf_results ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE PTO_Perf_Report_Summary ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE PTO_Perf_Report_Details ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE PTO_Perf_test_observations ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE PTO_Key_Perf_Parameters ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE PTO_smoke_Test ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE PTO_Engine_oil_consumption ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE PTO_Multipoint_mapping ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE PTO_Perf_Governing_Graph ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE Budni_PTO_Perf_Results_summary ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE Budni_PTO_Perf_Results_Details ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE Budni_Drawbar_Perf_Results ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE Budni_Hydraulic_Power_test_Results ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE Budni_Hydraulic_Lifting_Capacity_test_Results ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE Budni_Hydraulic_Maint_of_lift_Load_Results ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE Budni_Brake_Perf_Service_Brake_Test_Results ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE Budni_Brake_Perf_Parking_Brake_Test_Results ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE Budni_Noise_Atmospheric_conditions ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE Budni_Noise_Measurement_Results ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE Budni_Vibration_Measurement ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE Budni_Centre_of_Gravity_Location ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE Budni_Field_Perf_Results ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE Budni_Haulage_Perf_Results ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE Budni_Air_Cleaner_Perf_Results ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE Budni_Test_observations ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE IHT_CGM_Lifting_Angle_Load_Details ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE IHT_CGM_Results ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE IHT_Steering_Effort ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE IHT_Pedal_Effort ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE IHT_Gear_Effort ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE IHT_Brake_Pedal_Effort ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE IHT_Clutch_Pedal_Effort ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE IHT_Hyd_Lift_Sensitivity ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE IHT_Speed_lead_lag_measurement ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE IHT_Gear_Max_Speed ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE IHT_Brake_Perf_test_condition ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE IHT_Brake_Perf_test_results ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE IHT_Hot_Air_Mapping_Results ALTER COLUMN Created_by SET DEFAULT 'SYS'; +ALTER TABLE IHT_Noise_Measurement_Results ALTER COLUMN Created_by SET DEFAULT 'SYS'; + \ No newline at end of file diff --git a/MMT_SQL/ods/db_create_scripts/MMT_ODS_Create_constraints_v0,1_20210310.sql b/MMT_SQL/ods/db_create_scripts/MMT_ODS_Create_constraints_v0,1_20210310.sql new file mode 100644 index 0000000..b459e25 --- /dev/null +++ b/MMT_SQL/ods/db_create_scripts/MMT_ODS_Create_constraints_v0,1_20210310.sql @@ -0,0 +1,425 @@ +/* +ALTER TABLE fw_m_role +ADD CONSTRAINT fk_fw_m_role_client_function_id +FOREIGN KEY ( client_id, function_id ) +REFERENCES fw_m_function(client_id, function_id); +*/ + + +CREATE UNIQUE INDEX CONCURRENTLY test_master_id +ON test_master (client_id, function_id, test_name ); + +ALTER TABLE test_master +ADD CONSTRAINT unique_test_master_id +UNIQUE USING INDEX test_master_id; + + +CREATE UNIQUE INDEX CONCURRENTLY test_lab_location_id +ON test_lab_location_master (client_id, function_id, location_name); + +ALTER TABLE test_lab_location_master +ADD CONSTRAINT unique_test_lab_location_id +UNIQUE USING INDEX test_lab_location_id; + + +CREATE UNIQUE INDEX CONCURRENTLY test_instance_id +ON test_instance (client_id, function_id, Test_master_Id, Test_File_Ref_No ); + +ALTER TABLE test_instance +ADD CONSTRAINT unique_test_instance_id +UNIQUE USING INDEX test_instance_id; + +CREATE UNIQUE INDEX CONCURRENTLY Test_instance_tractor_info_id +ON Test_instance_tractor_info (client_id, function_id, Test_instance_Id, Tractor_Model ); + +ALTER TABLE Test_instance_tractor_info +ADD CONSTRAINT unique_Test_instance_tractor_info_id +UNIQUE USING INDEX Test_instance_tractor_info_id; + +CREATE UNIQUE INDEX CONCURRENTLY Test_instance_implement_info_id +ON Test_instance_implement_info (client_id, function_id, Test_instance_Id, Name_of_Implement ); + +ALTER TABLE Test_instance_implement_info +ADD CONSTRAINT unique_Test_instance_implement_info_id +UNIQUE USING INDEX Test_instance_implement_info_id; + + + +CREATE UNIQUE INDEX CONCURRENTLY Test_instance_trailer_info_id +ON Test_instance_trailer_info (client_id, function_id, Test_instance_Id, Type_Of_Trailer, No_Of_Axle ); + +ALTER TABLE Test_instance_trailer_info +ADD CONSTRAINT unique_Test_instance_trailer_info_id +UNIQUE USING INDEX Test_instance_trailer_info_id; + + +CREATE UNIQUE INDEX CONCURRENTLY Test_instance_engine_info_id +ON Test_instance_engine_info (client_id, function_id, Test_instance_Id, Test_instance_Tractor_Id ); + +ALTER TABLE Test_instance_engine_info +ADD CONSTRAINT unique_Test_instance_engine_info_id +UNIQUE USING INDEX Test_instance_engine_info_id; + + + +CREATE UNIQUE INDEX CONCURRENTLY test_instance_tyre_info_id +ON test_instance_tyre_info (client_id, function_id, Test_instance_Id, Test_instance_Tractor_Id, Tyre_Type ); + +ALTER TABLE test_instance_tyre_info +ADD CONSTRAINT unique_test_instance_tyre_info_id +UNIQUE USING INDEX Test_instance_tyre_info_id; + + +CREATE UNIQUE INDEX CONCURRENTLY test_instance_gear_speed_chart_id +ON test_instance_gear_speed_chart (client_id, function_id, Test_instance_Id, Tyre_condition,Forward_Reverse,Gear ); + +ALTER TABLE test_instance_gear_speed_chart +ADD CONSTRAINT unique_test_instance_gear_speed_chart_id +UNIQUE USING INDEX test_instance_gear_speed_chart_id; + + + +CREATE UNIQUE INDEX CONCURRENTLY test_instance_tractor_info_misc_id +ON test_instance_tractor_info_misc (client_id, function_id, Test_instance_Id, Test_instance_Tractor_Id ); + +ALTER TABLE test_instance_tractor_info_misc +ADD CONSTRAINT unique_test_instance_tractor_info_misc_id +UNIQUE USING INDEX test_instance_tractor_info_misc_id; + +CREATE UNIQUE INDEX CONCURRENTLY test_instance_Wheels_info_id +ON test_instance_Wheels_info (client_id, function_id, Test_instance_Id, steered_Driving_wheel ); + +ALTER TABLE test_instance_Wheels_info +ADD CONSTRAINT unique_test_instance_Wheels_info_id +UNIQUE USING INDEX test_instance_Wheels_info_id; + + + +CREATE UNIQUE INDEX CONCURRENTLY test_instance_fuel_lubricant_info_id +ON test_instance_fuel_lubricant_info (client_id, function_id, Test_instance_Id, fuel_lubricant_unit ); + +ALTER TABLE test_instance_fuel_lubricant_info +ADD CONSTRAINT unique_test_instance_fuel_lubricant_info_id +UNIQUE USING INDEX test_instance_fuel_lubricant_info_id; + +CREATE UNIQUE INDEX CONCURRENTLY test_instance_equipment_info_id +ON test_instance_equipment_info (client_id, function_id, Test_instance_Id, Srl_No ); + +ALTER TABLE test_instance_equipment_info +ADD CONSTRAINT unique_test_instance_equipment_info_id +UNIQUE USING INDEX test_instance_equipment_info_id; + + + +CREATE UNIQUE INDEX CONCURRENTLY test_instance_measurement_uncertainty_id +ON test_instance_measurement_uncertainty (client_id, function_id, Test_instance_Id ); + +ALTER TABLE test_instance_measurement_uncertainty +ADD CONSTRAINT unique_test_instance_measurement_uncertainty_id +UNIQUE USING INDEX test_instance_measurement_uncertainty_id; + +CREATE UNIQUE INDEX CONCURRENTLY test_instance_atmosp_info_id +ON test_instance_atmosp_info (client_id, function_id, Test_instance_Id ); + +ALTER TABLE test_instance_atmosp_info +ADD CONSTRAINT unique_test_instance_atmosp_info_id +UNIQUE USING INDEX test_instance_atmosp_info_id; + + + + + +CREATE UNIQUE INDEX CONCURRENTLY test_instance_drawbar_info_id +ON test_instance_drawbar_info (client_id, function_id, Test_instance_Id, Drawbar_type_name); + +ALTER TABLE test_instance_drawbar_info +ADD CONSTRAINT unique_test_instance_drawbar_info_id +UNIQUE USING INDEX test_instance_drawbar_info_id; + +CREATE UNIQUE INDEX CONCURRENTLY Field_Perf_Summary_tractor_info_id +ON Field_Perf_Summary_tractor_info (client_id, function_id, Test_instance_Id , Test_instance_Tractor_Id); + +ALTER TABLE Field_Perf_Summary_tractor_info +ADD CONSTRAINT unique_Field_Perf_Summary_tractor_info_id +UNIQUE USING INDEX Field_Perf_Summary_tractor_info_id; + + +CREATE UNIQUE INDEX CONCURRENTLY Field_Perf_Summary_implement_info_id +ON Field_Perf_Summary_implement_info (client_id, function_id, Test_instance_Id, Name_of_Implement); + + +ALTER TABLE Field_Perf_Summary_implement_info +ADD CONSTRAINT unique_Field_Perf_Summary_implement_info_id +UNIQUE USING INDEX Field_Perf_Summary_implement_info_id; + +CREATE UNIQUE INDEX CONCURRENTLY Field_Perf_Summary_Soil_info_id +ON Field_Perf_Summary_Soil_info (client_id, function_id, Test_instance_Id ); + +ALTER TABLE Field_Perf_Summary_Soil_info +ADD CONSTRAINT unique_Field_Perf_Summary_Soil_info_id +UNIQUE USING INDEX Field_Perf_Summary_Soil_info_id; + + +CREATE UNIQUE INDEX CONCURRENTLY Field_Perf_Summary_trailer_info_id +ON Field_Perf_Summary_trailer_info (client_id, function_id, Test_instance_Id, Trailer_type); + + +ALTER TABLE Field_Perf_Summary_trailer_info +ADD CONSTRAINT unique_Field_Perf_Summary_trailer_info_id +UNIQUE USING INDEX Field_Perf_Summary_trailer_info_id; + +CREATE UNIQUE INDEX CONCURRENTLY Field_Perf_summary_id +ON Field_Perf_summary (client_id, function_id, Test_instance_Id, Test_instance_Tractor_Id, Test_iteration_number ); + +ALTER TABLE Field_Perf_summary +ADD CONSTRAINT unique_Field_Perf_summary_id +UNIQUE USING INDEX Field_Perf_summary_id; + +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +CREATE UNIQUE INDEX CONCURRENTLY Drawbar_Perf_results_id +ON Drawbar_Perf_results (client_id, function_id, Test_instance_Id, Gear_Number_and_Range ); + +ALTER TABLE Drawbar_Perf_results +ADD CONSTRAINT unique_Drawbar_Perf_results_id +UNIQUE USING INDEX Drawbar_Perf_results_id; + + +CREATE UNIQUE INDEX CONCURRENTLY Drawbar_Perf_results_summary_id +ON Drawbar_Perf_results_summary (client_id, function_id, Test_instance_Id, Gear_Number_and_Range ); + +ALTER TABLE Drawbar_Perf_results_summary +ADD CONSTRAINT unique_Drawbar_Perf_results_summary_id +UNIQUE USING INDEX Drawbar_Perf_results_summary_id; + +CREATE UNIQUE INDEX CONCURRENTLY Drawbar_Perf_Noise_Measurement_Results_id +ON Drawbar_Perf_Noise_Measurement_Results (client_id, function_id, Test_instance_Id, Test_condition,test_mode,Gear,Speed_rpm ); + +ALTER TABLE Drawbar_Perf_Noise_Measurement_Results +ADD CONSTRAINT unique_Drawbar_Perf_Noise_Measurement_Results_id +UNIQUE USING INDEX Drawbar_Perf_Noise_Measurement_Results_id; + + +CREATE UNIQUE INDEX CONCURRENTLY Drawbar_Perf_observations_id +ON Drawbar_Perf_observations (client_id, function_id, Test_instance_Id, Srl_No); + +ALTER TABLE Drawbar_Perf_observations_summary +ADD CONSTRAINT unique_Drawbar_Perf_observations_id +UNIQUE USING INDEX Drawbar_Perf_observations_id; + + +CREATE UNIQUE INDEX CONCURRENTLY PTO_Perf_results_id +ON PTO_Perf_results (client_id, function_id, Test_instance_Id, PTO_Test_Type, Speed_Engine_rpm ); + +ALTER TABLE PTO_Perf_results +ADD CONSTRAINT unique_PTO_Perf_results_id +UNIQUE USING INDEX PTO_Perf_results_id; + + + +CREATE UNIQUE INDEX CONCURRENTLY PTO_Perf_Report_Summary_id +ON PTO_Perf_Report_Summary (client_id, function_id, Test_instance_Id, PTO_Category, PTO_Sub_Category ); + +ALTER TABLE PTO_Perf_Report_Summary +ADD CONSTRAINT unique_PTO_Perf_Report_Summary_id +UNIQUE USING INDEX PTO_Perf_Report_Summary_id; + + +CREATE UNIQUE INDEX CONCURRENTLY PTO_Perf_Report_Details_id +ON PTO_Perf_Report_Details (client_id, function_id, Test_instance_Id, Ambient_type ); + +ALTER TABLE PTO_Perf_Report_Details +ADD CONSTRAINT unique_PTO_Perf_Report_Details_id +UNIQUE USING INDEX PTO_Perf_Report_Details_id; + + +CREATE UNIQUE INDEX CONCURRENTLY PTO_Perf_test_observations_id +ON PTO_Perf_test_observations (client_id, function_id, Test_instance_Id, Srl_No ); + +ALTER TABLE PTO_Perf_test_observations +ADD CONSTRAINT unique_PTO_Perf_test_observations_id +UNIQUE USING INDEX PTO_Perf_test_observations_id; + +CREATE UNIQUE INDEX CONCURRENTLY PTO_Key_Perf_Parameters_id +ON PTO_Key_Perf_Parameters (client_id, function_id, Test_instance_Id, Test_Condtion ); + +ALTER TABLE PTO_Key_Perf_Parameters +ADD CONSTRAINT unique_PTO_Key_Perf_Parameters_id +UNIQUE USING INDEX PTO_Key_Perf_Parameters_id; + + +CREATE UNIQUE INDEX CONCURRENTLY PTO_smoke_Test_id +ON PTO_smoke_Test (client_id, function_id, Test_instance_Id, Engine_speed_rpm ); + +ALTER TABLE PTO_smoke_Test +ADD CONSTRAINT unique_PTO_smoke_Test_id +UNIQUE USING INDEX PTO_smoke_Test_id; + + +CREATE UNIQUE INDEX CONCURRENTLY PTO_Engine_oil_consumption_id +ON PTO_Engine_oil_consumption (client_id, function_id, Test_instance_Id, Srl_No ); + +ALTER TABLE PTO_Engine_oil_consumption +ADD CONSTRAINT unique_PTO_Engine_oil_consumption_id +UNIQUE USING INDEX PTO_Engine_oil_consumption_id; + + +CREATE UNIQUE INDEX CONCURRENTLY PTO_Multipoint_mapping_id +ON PTO_Multipoint_mapping (client_id, function_id, Test_instance_Id, Test_condition,Engine_speed_rpm,Engine_load_pct ); + +ALTER TABLE PTO_Multipoint_mapping +ADD CONSTRAINT unique_PTO_Multipoint_mapping_id +UNIQUE USING INDEX PTO_Multipoint_mapping_id; + + +CREATE UNIQUE INDEX CONCURRENTLY PTO_Perf_Governing_Graph_id +ON PTO_Perf_Governing_Graph (client_id, function_id, Test_instance_Id, Test_condition,Engine_speed_rpm ); + +ALTER TABLE PTO_Perf_Governing_Graph +ADD CONSTRAINT unique_PTO_Perf_Governing_Graph_id +UNIQUE USING INDEX PTO_Perf_Governing_Graph_id; + + +CREATE UNIQUE INDEX CONCURRENTLY Budni_PTO_Perf_Results_summary_id +ON Budni_PTO_Perf_Results_summary (client_id, function_id, Test_instance_Id, PTO_Category,PTO_Sub_Category ); + +ALTER TABLE Budni_PTO_Perf_Results_summary +ADD CONSTRAINT unique_Budni_PTO_Perf_Results_summary_id +UNIQUE USING INDEX Budni_PTO_Perf_Results_summary_id; + + +CREATE UNIQUE INDEX CONCURRENTLY Budni_PTO_Perf_Results_Details_id +ON Budni_PTO_Perf_Results_Details (client_id, function_id, Test_instance_Id, Ambient_type ); + +ALTER TABLE Budni_PTO_Perf_Results_Details +ADD CONSTRAINT unique_Budni_PTO_Perf_Results_Details_id +UNIQUE USING INDEX Budni_PTO_Perf_Results_Details_id; + + +CREATE UNIQUE INDEX CONCURRENTLY Budni_Drawbar_Perf_Results_id +ON Budni_Drawbar_Perf_Results (client_id, function_id, Test_instance_Id, Test_Condtion, Gear_Used ); + +ALTER TABLE Budni_Drawbar_Perf_Results +ADD CONSTRAINT unique_Budni_Budni_Drawbar_Perf_Results_id +UNIQUE USING INDEX Budni_Drawbar_Perf_Results_id; + +CREATE UNIQUE INDEX CONCURRENTLY Budni_Hydraulic_Power_test_Results_id +ON Budni_Hydraulic_Power_test_Results (client_id, function_id, Test_instance_Id ); + +ALTER TABLE Budni_Hydraulic_Power_test_Results +ADD CONSTRAINT unique_Budni_Hydraulic_Power_test_Results_id +UNIQUE USING INDEX Budni_Hydraulic_Power_test_Results_id; + +CREATE UNIQUE INDEX CONCURRENTLY Budni_Hydraulic_Lifting_Capacity_test_Results_id +ON Budni_Hydraulic_Lifting_Capacity_test_Results (client_id, function_id, Test_instance_Id , Test_condition); + +ALTER TABLE Budni_Hydraulic_Lifting_Capacity_test_Results +ADD CONSTRAINT unique_Budni_Hydraulic_Lifting_Capacity_test_Results_id +UNIQUE USING INDEX Budni_Hydraulic_Lifting_Capacity_test_Results_id; + + +CREATE UNIQUE INDEX CONCURRENTLY Budni_Hydraulic_Maint_of_lift_Load_Results_id +ON Budni_Hydraulic_Maint_of_lift_Load_Results (client_id, function_id, Test_instance_Id , Elapsed_time_min); + +ALTER TABLE Budni_Hydraulic_Maint_of_lift_Load_Results +ADD CONSTRAINT unique_Budni_Hydraulic_Maint_of_lift_Load_Results_id +UNIQUE USING INDEX Budni_Hydraulic_Maint_of_lift_Load_Results_id; + +CREATE UNIQUE INDEX CONCURRENTLY Budni_Brake_Perf_Service_Brake_Test_Results_id +ON Budni_Brake_Perf_Service_Brake_Test_Results (client_id, function_id, Test_instance_Id , Brake_Test_Type,Brake_Test_Name, + Speed_condition,Ballast_Condition,Trial_number); + +ALTER TABLE Budni_Brake_Perf_Service_Brake_Test_Results +ADD CONSTRAINT unique_Budni_Brake_Perf_Service_Brake_Test_Results_id +UNIQUE USING INDEX Budni_Brake_Perf_Service_Brake_Test_Results_id; + +CREATE UNIQUE INDEX CONCURRENTLY Budni_Brake_Perf_Parking_Brake_Test_Results_id +ON Budni_Brake_Perf_Parking_Brake_Test_Results (client_id, function_id, Test_instance_Id , Test_condition); + +ALTER TABLE Budni_Brake_Perf_Parking_Brake_Test_Results +ADD CONSTRAINT unique_Budni_Brake_Perf_Parking_Brake_Test_Results_id +UNIQUE USING INDEX Budni_Brake_Perf_Parking_Brake_Test_Results_id; + +CREATE UNIQUE INDEX CONCURRENTLY Budni_Noise_Atmosp_conditions_id +ON Budni_Noise_Atmosp_conditions (client_id, function_id, Test_instance_Id , Noise_position); + +ALTER TABLE Budni_Noise_Atmosp_conditions +ADD CONSTRAINT unique_Budni_Noise_Atmosp_conditions_id +UNIQUE USING INDEX Budni_Noise_Atmosp_conditions_id; + + +CREATE UNIQUE INDEX CONCURRENTLY Budni_Noise_Measurement_Results_id +ON Budni_Noise_Measurement_Results(client_id, function_id, Test_instance_Id , Noise_position, Gear); + +ALTER TABLE Budni_Noise_Measurement_Results +ADD CONSTRAINT unique_Budni_Noise_Measurement_Results_id +UNIQUE USING INDEX Budni_Noise_Measurement_Results_id; + + +CREATE UNIQUE INDEX CONCURRENTLY Budni_Vibration_Measurement_id +ON Budni_Vibration_Measurement(client_id, function_id, Test_instance_Id , Measuring_Points,Measuring_point_position); + +ALTER TABLE Budni_Vibration_Measurement +ADD CONSTRAINT unique_Budni_Vibration_Measurement_id +UNIQUE USING INDEX Budni_Vibration_Measurement_id; + +CREATE UNIQUE INDEX CONCURRENTLY Budni_Centre_of_Gravity_Location_id +ON Budni_Centre_of_Gravity_Location(client_id, function_id, Test_instance_Id , condition, Particulars ); + +ALTER TABLE Budni_Centre_of_Gravity_Location +ADD CONSTRAINT unique_Budni_Centre_of_Gravity_Location_id +UNIQUE USING INDEX Budni_Centre_of_Gravity_Location_id; + +CREATE UNIQUE INDEX CONCURRENTLY Budni_Field_Perf_Results_id +ON Budni_Field_Perf_Results(client_id, function_id, Test_instance_Id , Parameter_Operation, Name_of_implement ); + +ALTER TABLE Budni_Field_Perf_Results +ADD CONSTRAINT unique_Budni_Field_Perf_Results_id +UNIQUE USING INDEX Budni_Field_Perf_Results_id; + +CREATE UNIQUE INDEX CONCURRENTLY Budni_Haulage_Perf_Results_id +ON Budni_Haulage_Perf_Results(client_id, function_id, Test_instance_Id , Wheel_Drive_type ); + +ALTER TABLE Budni_Haulage_Perf_Results +ADD CONSTRAINT unique_Budni_Haulage_Perf_Results_id +UNIQUE USING INDEX Budni_Haulage_Perf_Results_id; + +CREATE UNIQUE INDEX CONCURRENTLY Budni_Air_Cleaner_Perf_Results_id +ON Budni_Air_Cleaner_Perf_Results(client_id, function_id, Test_instance_Id , Sequence_Number ); + +ALTER TABLE Budni_Air_Cleaner_Perf_Results +ADD CONSTRAINT unique_Budni_Air_Cleaner_Perf_Results_id +UNIQUE USING INDEX Budni_Air_Cleaner_Perf_Results_id; + +CREATE UNIQUE INDEX CONCURRENTLY Budni_Test_observations_id +ON Budni_Test_observations(client_id, function_id, Test_instance_Id , sequence_number ); + +ALTER TABLE Budni_Test_observations +ADD CONSTRAINT unique_Budni_Test_observations_id +UNIQUE USING INDEX Budni_Test_observations_id; + +CREATE UNIQUE INDEX CONCURRENTLY test_instance_images_id +ON test_instance_images(client_id, function_id, Test_instance_Id , Srl_No ); + +ALTER TABLE test_instance_images +ADD CONSTRAINT unique_test_instance_images_id +UNIQUE USING INDEX test_instance_images_id; + + + + + + + + + + + + + + + + + + + diff --git a/MMT_SQL/ods/db_create_scripts/MMT_ODS_create_FK_constraints_v0.1_20210311.sql b/MMT_SQL/ods/db_create_scripts/MMT_ODS_create_FK_constraints_v0.1_20210311.sql new file mode 100644 index 0000000..6490978 --- /dev/null +++ b/MMT_SQL/ods/db_create_scripts/MMT_ODS_create_FK_constraints_v0.1_20210311.sql @@ -0,0 +1,250 @@ +/* create the foreign key on client id, function id, test_instance_id in all tables - 20210311 */ + +CREATE UNIQUE INDEX CONCURRENTLY test_instance_cfs_id +ON test_instance (client_id, function_id, syspk); + +ALTER TABLE test_instance +ADD CONSTRAINT unique_test_instance_cfs_id +UNIQUE USING INDEX test_instance_cfs_id; + +--alter table Test_instance_tractor_info drop constraint fk_tractor_cf_test_instance_id + +ALTER TABLE Test_instance_tractor_info +ADD CONSTRAINT fk_tractor_cfs_test_instance_id +FOREIGN KEY ( client_id, function_Id, test_instance_id) +REFERENCES test_instance( client_id, function_id, syspk); + +ALTER TABLE Test_instance_implement_info +ADD CONSTRAINT fk_implement_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE Test_instance_trailer_info +ADD CONSTRAINT fk_trailer_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE Test_instance_engine_info +ADD CONSTRAINT fk_engine_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE test_instance_tyre_info +ADD CONSTRAINT fk_tyre_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE test_instance_gear_speed_chart +ADD CONSTRAINT fk_gear_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE test_instance_tractor_info_misc +ADD CONSTRAINT fk_tractor_misc_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE test_instance_Wheels_info +ADD CONSTRAINT fk_wheels_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE test_instance_fuel_lubricant_info +ADD CONSTRAINT fk_fuel_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE test_instance_equipment_info +ADD CONSTRAINT fk_equip_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE test_instance_measurement_uncertainty +ADD CONSTRAINT fk_mu_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE test_instance_atmosp_info +ADD CONSTRAINT fk_atmosp_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE test_instance_drawbar_info +ADD CONSTRAINT fk_drawbar_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE Field_Perf_Summary_tractor_info +ADD CONSTRAINT fk_fpstractor_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE Field_Perf_Summary_implement_info +ADD CONSTRAINT fk_fpsi_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE Field_Perf_Summary_Soil_info +ADD CONSTRAINT fk_fpss_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE Field_Perf_Summary_trailer_info +ADD CONSTRAINT fk_fpst_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE Field_Perf_summary +ADD CONSTRAINT fk_fps_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE Drawbar_Perf_results +ADD CONSTRAINT fk_dpr_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE Drawbar_Perf_results_summary +ADD CONSTRAINT fk_dprs_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE Drawbar_Perf_Noise_Measurement_Results +ADD CONSTRAINT fk_dpnm_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE Drawbar_Perf_observations +ADD CONSTRAINT fk_dpo_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE PTO_Perf_results +ADD CONSTRAINT fk_ppr_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE PTO_Perf_Report_Summary +ADD CONSTRAINT fk_pprs_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE PTO_Perf_Report_Details +ADD CONSTRAINT fk_pprd_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE PTO_Perf_test_observations +ADD CONSTRAINT fk_ppto_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE PTO_Key_Perf_Parameters +ADD CONSTRAINT fk_pkpp_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE PTO_smoke_Test +ADD CONSTRAINT fk_pst_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE PTO_Engine_oil_consumption +ADD CONSTRAINT fk_peoc_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE PTO_Multipoint_mapping +ADD CONSTRAINT fk_pmm_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE PTO_Perf_Governing_Graph +ADD CONSTRAINT fk_ppgg_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE Budni_PTO_Perf_Results_summary +ADD CONSTRAINT fk_bpprs_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE Budni_PTO_Perf_Results_Details +ADD CONSTRAINT fk_bpprd_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE Budni_Drawbar_Perf_Results +ADD CONSTRAINT fk_bdpr_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE Budni_Hydraulic_Power_test_Results +ADD CONSTRAINT fk_bhptr_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE Budni_Hydraulic_Lifting_Capacity_test_Results +ADD CONSTRAINT fk_bhlctr_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE Budni_Hydraulic_Maint_of_lift_Load_Results +ADD CONSTRAINT fk_bhmlr_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE Budni_Brake_Perf_Service_Brake_Test_Results +ADD CONSTRAINT fk_bbpsb_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE Budni_Brake_Perf_Parking_Brake_Test_Results +ADD CONSTRAINT fk_bbppb_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE Budni_Noise_Atmosp_conditions +ADD CONSTRAINT fk_bnac_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE Budni_Noise_Measurement_Results +ADD CONSTRAINT fk_bnmr_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE Budni_Vibration_Measurement +ADD CONSTRAINT fk_bvm_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE Budni_Centre_of_Gravity_Location +ADD CONSTRAINT fk_bcg_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE Budni_Field_Perf_Results +ADD CONSTRAINT fk_bfpr_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE Budni_Haulage_Perf_Results +ADD CONSTRAINT fk_bhpr_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE Budni_Air_Cleaner_Perf_Results +ADD CONSTRAINT fk_bacpr_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE Budni_Test_observations +ADD CONSTRAINT fk_bto_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); + +ALTER TABLE test_instance_images +ADD CONSTRAINT fk_bti_cfs_test_instance_id +FOREIGN KEY ( client_id, function_id, test_instance_id ) +REFERENCES test_instance(client_id, function_id, syspk); \ No newline at end of file diff --git a/MMT_SQL/ods/db_create_scripts/MMT_ODS_create_master_data_v0.1_20210310.sql b/MMT_SQL/ods/db_create_scripts/MMT_ODS_create_master_data_v0.1_20210310.sql new file mode 100644 index 0000000..a8b8e07 --- /dev/null +++ b/MMT_SQL/ods/db_create_scripts/MMT_ODS_create_master_data_v0.1_20210310.sql @@ -0,0 +1,15 @@ +insert into test_master ( test_name, test_type, test_description) values ( 'Field Perf', 'Field', 'Field Perf Test') + +insert into test_lab_location_master ( location_name) values ('Jetsar' ); +insert into test_lab_location_master ( location_name) values ('Shivpuri' ); +insert into test_lab_location_master ( location_name) values ('Akola' ); +insert into test_lab_location_master ( location_name) values ('Sindhnoor' ); +insert into test_lab_location_master ( location_name) values ('Tindivanam' ); +insert into test_lab_location_master ( location_name) values ('Kumbakonam' ); +insert into test_lab_location_master ( location_name) values ('Tadepalligudem' ); +insert into test_lab_location_master ( location_name) values ('Punjab' ); +insert into test_lab_location_master ( location_name) values ('Other' ); +insert into test_lab_location_master ( location_name) values ('Suratgarh (Jetsar)'); +insert into test_lab_location_master ( location_name) values ('Sardargarh (Jetsar)'); +insert into test_lab_location_master ( location_name) values ('MRV'); +insert into test_lab_location_master ( location_name) values ('Budni'); \ No newline at end of file diff --git a/MMT_SQL/ods/db_create_scripts/MMT_create_primary_key_ODS_v0.1_20210310.sql b/MMT_SQL/ods/db_create_scripts/MMT_create_primary_key_ODS_v0.1_20210310.sql new file mode 100644 index 0000000..aaeeffa --- /dev/null +++ b/MMT_SQL/ods/db_create_scripts/MMT_create_primary_key_ODS_v0.1_20210310.sql @@ -0,0 +1,52 @@ +/* CReate primary key for all the tables in ods */ +ALTER TABLE Test_Master ADD CONSTRAINT Test_Master_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE Test_Lab_location_Master ADD CONSTRAINT Test_Lab_location_Master_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE Test_Instance ADD CONSTRAINT Test_Instance_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE Test_instance_tractor_info ADD CONSTRAINT Test_instance_tractor_info_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE Test_instance_implement_info ADD CONSTRAINT Test_instance_implement_info_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE Test_instance_trailer_info ADD CONSTRAINT Test_instance_trailer_info_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE Test_instance_engine_info ADD CONSTRAINT Test_instance_engine_info_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE test_instance_tyre_info ADD CONSTRAINT test_instance_tyre_info_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE test_instance_gear_speed_chart ADD CONSTRAINT test_instance_gear_speed_chart_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE test_instance_tractor_info_misc ADD CONSTRAINT test_instance_tractor_info_misc_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE test_instance_Wheels_info ADD CONSTRAINT test_instance_Wheels_info_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE test_instance_fuel_lubricant_info ADD CONSTRAINT test_instance_fuel_lubricant_info_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE test_instance_equipment_info ADD CONSTRAINT test_instance_equipment_info_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE test_instance_measurement_uncertainty ADD CONSTRAINT test_instance_measurement_uncertainty_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE test_instance_atmosp_info ADD CONSTRAINT test_instance_atmosp_info_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE test_instance_drawbar_info ADD CONSTRAINT test_instance_drawbar_info_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE Field_Perf_Summary_tractor_info ADD CONSTRAINT Field_Perf_Summary_tractor_info_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE Field_Perf_Summary_implement_info ADD CONSTRAINT Field_Perf_Summary_implement_info_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE Field_Perf_Summary_Soil_info ADD CONSTRAINT Field_Perf_Summary_Soil_info_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE Field_Perf_Summary_trailer_info ADD CONSTRAINT Field_Perf_Summary_trailer_info_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE Field_Perf_summary ADD CONSTRAINT Field_Perf_summary_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE Drawbar_Perf_results ADD CONSTRAINT Drawbar_Perf_results_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE Drawbar_Perf_results_summary ADD CONSTRAINT Drawbar_Perf_results_summary_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE Drawbar_Perf_Noise_Measurement_Results ADD CONSTRAINT Drawbar_Perf_Noise_Measurement_Results_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE Drawbar_Perf_observations ADD CONSTRAINT Drawbar_Perf_observations_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE PTO_Perf_results ADD CONSTRAINT PTO_Perf_results_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE PTO_Perf_Report_Summary ADD CONSTRAINT PTO_Perf_Report_Summary_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE PTO_Perf_Report_Details ADD CONSTRAINT PTO_Perf_Report_Details_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE PTO_Perf_test_observations ADD CONSTRAINT PTO_Perf_test_observations_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE PTO_Key_Perf_Parameters ADD CONSTRAINT PTO_Key_Perf_Parameters_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE PTO_smoke_Test ADD CONSTRAINT PTO_smoke_Test_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE PTO_Engine_oil_consumption ADD CONSTRAINT PTO_Engine_oil_consumption_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE PTO_Multipoint_mapping ADD CONSTRAINT PTO_Multipoint_mapping_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE PTO_Perf_Governing_Graph ADD CONSTRAINT PTO_Perf_Governing_Graph_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE Budni_PTO_Perf_Results_summary ADD CONSTRAINT Budni_PTO_Perf_Results_summary_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE Budni_PTO_Perf_Results_Details ADD CONSTRAINT Budni_PTO_Perf_Results_Details_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE Budni_Drawbar_Perf_Results ADD CONSTRAINT Budni_Drawbar_Perf_Results_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE Budni_Hydraulic_Power_test_Results ADD CONSTRAINT Budni_Hydraulic_Power_test_Results_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE Budni_Hydraulic_Lifting_Capacity_test_Results ADD CONSTRAINT Budni_Hydraulic_Lifting_Capacity_test_Results_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE Budni_Hydraulic_Maint_of_lift_Load_Results ADD CONSTRAINT Budni_Hydraulic_Maint_of_lift_Load_Results_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE Budni_Brake_Perf_Service_Brake_Test_Results ADD CONSTRAINT Budni_Brake_Perf_Service_Brake_Test_Results_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE Budni_Brake_Perf_Parking_Brake_Test_Results ADD CONSTRAINT Budni_Brake_Perf_Parking_Brake_Test_Results_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE Budni_Noise_Atmosp_conditions ADD CONSTRAINT Budni_Noise_Atmosp_conditions_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE Budni_Noise_Measurement _Results ADD CONSTRAINT Budni_Noise_Measurement _Results_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE Budni_Vibration_Measurement ADD CONSTRAINT Budni_Vibration_Measurement_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE Budni_Centre_of_Gravity_Location ADD CONSTRAINT Budni_Centre_of_Gravity_Location_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE Budni_Field_Perf_Results ADD CONSTRAINT Budni_Field_Perf_Results_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE Budni_Haulage_Perf_Results ADD CONSTRAINT Budni_Haulage_Perf_Results_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE Budni_Air_Cleaner_Perf_Results ADD CONSTRAINT Budni_Air_Cleaner_Perf_Results_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE Budni_Test_observations ADD CONSTRAINT Budni_Test_observations_syspk_key PRIMARY KEY (SYSPK); +ALTER TABLE test_instance_images ADD CONSTRAINT test_instance_images_syspk_key PRIMARY KEY (SYSPK);