From 908c6c8024f1265b1548614073cb5fd052f0c5b7 Mon Sep 17 00:00:00 2001 From: amirghasempoor Date: Sat, 2 Mar 2024 11:16:57 +0330 Subject: [PATCH 01/10] create test directory --- app/Services/NominatimService.php | 24 +++++++++++++++++++++++- tests/CreatesApplication.php | 21 +++++++++++++++++++++ tests/Feature/Services/NominatimTest.php | 22 ++++++++++++++++++++++ tests/TestCase.php | 10 ++++++++++ 4 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 tests/CreatesApplication.php create mode 100644 tests/Feature/Services/NominatimTest.php create mode 100644 tests/TestCase.php diff --git a/app/Services/NominatimService.php b/app/Services/NominatimService.php index cfe2fc50..209d59bb 100644 --- a/app/Services/NominatimService.php +++ b/app/Services/NominatimService.php @@ -2,10 +2,32 @@ namespace App\Services; +use Illuminate\Support\Facades\App; + class NominatimService { - public function get_way_id_from_nominatim(): string + public function get_way_id_from_nominatim($lat = null, $lng = null) { + if (App::environment('production')) + { + $url = "https://testmap.141.ir/nominatim/reverse?format=jsonv2&lat=".$lat."&lon=".$lng."&zoom=16&addressdetails=16"; + $arrContextOptions=array( + "ssl"=>array( + "verify_peer"=>false, + "verify_peer_name"=>false, + ), + ); + + $result = file_get_contents($url, false, stream_context_create($arrContextOptions)); + $result = json_decode($result); + if (isset($result->osm_type)) { + if ($result->osm_type == 'way') { + return $result->osm_id; + } + } + return 0; + } + return 0; } } \ No newline at end of file diff --git a/tests/CreatesApplication.php b/tests/CreatesApplication.php new file mode 100644 index 00000000..c627fb76 --- /dev/null +++ b/tests/CreatesApplication.php @@ -0,0 +1,21 @@ +make(Kernel::class)->bootstrap(); + + return $app; + } +} diff --git a/tests/Feature/Services/NominatimTest.php b/tests/Feature/Services/NominatimTest.php new file mode 100644 index 00000000..8fc7fcd5 --- /dev/null +++ b/tests/Feature/Services/NominatimTest.php @@ -0,0 +1,22 @@ +get_way_id_from_nominatim(); + + $this->assertEquals($wayId, 0); + } +} diff --git a/tests/TestCase.php b/tests/TestCase.php new file mode 100644 index 00000000..d3aab464 --- /dev/null +++ b/tests/TestCase.php @@ -0,0 +1,10 @@ + Date: Sat, 2 Mar 2024 11:37:21 +0330 Subject: [PATCH 02/10] change helpers to follow psr4 --- app/Helpers/General.php | 4 ++-- tests/Feature/Services/NominatimTest.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Helpers/General.php b/app/Helpers/General.php index 88fb2440..b9ca3ca3 100644 --- a/app/Helpers/General.php +++ b/app/Helpers/General.php @@ -70,7 +70,7 @@ if (! function_exists('process_datatable')) { $value = $attributes['value']; if ($attributes['type'] == 'text') { - $data = $data->where($field, 'LIKE', "%${value}%"); + $data = $data->where($field, 'LIKE', "%{$value}%"); } elseif ($attributes['type'] == 'between') { $date_values = explode('&', $value); $date_values[0] .= " 00:00:00"; @@ -89,7 +89,7 @@ if (! function_exists('process_datatable')) { } }); } elseif ($attributes['type'] == 'select') { - $data = $data->where($field, "${value}"); + $data = $data->where($field, "{$value}"); } // following types have been added for making finance table serverside. diff --git a/tests/Feature/Services/NominatimTest.php b/tests/Feature/Services/NominatimTest.php index 8fc7fcd5..668df8c2 100644 --- a/tests/Feature/Services/NominatimTest.php +++ b/tests/Feature/Services/NominatimTest.php @@ -17,6 +17,6 @@ class NominatimTest extends TestCase { $wayId = (new NominatimService())->get_way_id_from_nominatim(); - $this->assertEquals($wayId, 0); + $this->assertEquals(0, $wayId); } } From e3ae2198c3ee9bab283d9dde3f51e3645b834ce1 Mon Sep 17 00:00:00 2001 From: amirghasempoor Date: Sat, 2 Mar 2024 13:13:07 +0330 Subject: [PATCH 03/10] change php unit config --- app/Services/NominatimService.php | 2 +- phpunit.xml | 39 ++++++++++++++----------------- 2 files changed, 18 insertions(+), 23 deletions(-) diff --git a/app/Services/NominatimService.php b/app/Services/NominatimService.php index 209d59bb..fdc5c683 100644 --- a/app/Services/NominatimService.php +++ b/app/Services/NominatimService.php @@ -30,4 +30,4 @@ class NominatimService return 0; } -} \ No newline at end of file +} diff --git a/phpunit.xml b/phpunit.xml index f52c8374..27a075b8 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,37 +1,32 @@ +> - - + ./tests/Feature - - + + ./app - - + + - - - - - - - - + + + + + + + + + + From 71e45858434628b18cef3083e610eb18b22e207d Mon Sep 17 00:00:00 2001 From: amirghasempoor Date: Tue, 5 Mar 2024 10:32:25 +0330 Subject: [PATCH 04/10] remove redundant lines --- app/Services/NominatimService.php | 2 +- phpunit.xml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/app/Services/NominatimService.php b/app/Services/NominatimService.php index fdc5c683..a14ebe9a 100644 --- a/app/Services/NominatimService.php +++ b/app/Services/NominatimService.php @@ -8,7 +8,7 @@ class NominatimService { public function get_way_id_from_nominatim($lat = null, $lng = null) { - if (App::environment('production')) + if (App::isProduction()) { $url = "https://testmap.141.ir/nominatim/reverse?format=jsonv2&lat=".$lat."&lon=".$lng."&zoom=16&addressdetails=16"; $arrContextOptions=array( diff --git a/phpunit.xml b/phpunit.xml index 27a075b8..ff19ac12 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -18,7 +18,6 @@ - From 5f5c4131b47c9937a7a9104c03647f51576c6210 Mon Sep 17 00:00:00 2001 From: amirghasempoor Date: Tue, 5 Mar 2024 10:37:53 +0330 Subject: [PATCH 05/10] change rmto urls --- .../Controllers/V2/Dashboard/SafetyAndPrivacyController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/V2/Dashboard/SafetyAndPrivacyController.php b/app/Http/Controllers/V2/Dashboard/SafetyAndPrivacyController.php index 4fc5fabc..2bbcc0ab 100644 --- a/app/Http/Controllers/V2/Dashboard/SafetyAndPrivacyController.php +++ b/app/Http/Controllers/V2/Dashboard/SafetyAndPrivacyController.php @@ -139,7 +139,7 @@ class SafetyAndPrivacyController extends Controller if ($request->has('recognize_picture')) { $recognize_picture = $request->file('recognize_picture')->store('safety_and_privacy/'.$safety_and_privacy->id.'/recognize_picture', 'public'); - $safety_and_privacy->recognize_picture = 'https://rms.rmto.ir/storage/'.$recognize_picture; + $safety_and_privacy->recognize_picture = 'https://rms.witel.ir/storage/'.$recognize_picture; // \App\Helpers\Compress::resize("/var/www/rms/public/storage/{$recognize_picture}"); } @@ -230,7 +230,7 @@ class SafetyAndPrivacyController extends Controller try { \DB::transaction(function () use ($request, $safety_and_privacy) { $action_picture = $request->file('action_picture')->store('safety_and_privacy/'.$safety_and_privacy->id.'/action_picture', 'public'); - $safety_and_privacy->action_picture = 'https://rms.rmto.ir/storage/'.$action_picture; + $safety_and_privacy->action_picture = 'https://rms.witel.ir/storage/'.$action_picture; // \App\Helpers\Compress::resize("/var/www/rms/public/storage/{$action_picture}"); $safety_and_privacy->action_picture_document_upload_date = now(); @@ -255,7 +255,7 @@ class SafetyAndPrivacyController extends Controller $result = []; foreach ($datas as $data) { - $result[] = 'https://rms.rmto.ir/storage/'.$data; + $result[] = 'https://rms.witel.ir/storage/'.$data; } return response()->json([ From a2d41e94d6c2aad3e86b13ec2581f5b6217ba0d7 Mon Sep 17 00:00:00 2001 From: amirghasempoor Date: Tue, 5 Mar 2024 12:00:37 +0330 Subject: [PATCH 06/10] use url() function to get app url --- .../Controllers/V2/Dashboard/SafetyAndPrivacyController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/V2/Dashboard/SafetyAndPrivacyController.php b/app/Http/Controllers/V2/Dashboard/SafetyAndPrivacyController.php index 2bbcc0ab..dccb7132 100644 --- a/app/Http/Controllers/V2/Dashboard/SafetyAndPrivacyController.php +++ b/app/Http/Controllers/V2/Dashboard/SafetyAndPrivacyController.php @@ -139,7 +139,7 @@ class SafetyAndPrivacyController extends Controller if ($request->has('recognize_picture')) { $recognize_picture = $request->file('recognize_picture')->store('safety_and_privacy/'.$safety_and_privacy->id.'/recognize_picture', 'public'); - $safety_and_privacy->recognize_picture = 'https://rms.witel.ir/storage/'.$recognize_picture; + $safety_and_privacy->recognize_picture = url('/') . '/storage/' . $recognize_picture; // \App\Helpers\Compress::resize("/var/www/rms/public/storage/{$recognize_picture}"); } @@ -230,7 +230,7 @@ class SafetyAndPrivacyController extends Controller try { \DB::transaction(function () use ($request, $safety_and_privacy) { $action_picture = $request->file('action_picture')->store('safety_and_privacy/'.$safety_and_privacy->id.'/action_picture', 'public'); - $safety_and_privacy->action_picture = 'https://rms.witel.ir/storage/'.$action_picture; + $safety_and_privacy->action_picture = url('/') . '/storage/' . $action_picture; // \App\Helpers\Compress::resize("/var/www/rms/public/storage/{$action_picture}"); $safety_and_privacy->action_picture_document_upload_date = now(); @@ -255,7 +255,7 @@ class SafetyAndPrivacyController extends Controller $result = []; foreach ($datas as $data) { - $result[] = 'https://rms.witel.ir/storage/'.$data; + $result[] = url('/') . '/storage/' . $data; } return response()->json([ From 3680dc329ae10f04cd54e111d789b6715c6f4446 Mon Sep 17 00:00:00 2001 From: amirghasempoor Date: Tue, 5 Mar 2024 12:40:23 +0330 Subject: [PATCH 07/10] use storage facade to get url --- .../Controllers/V2/Dashboard/SafetyAndPrivacyController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/V2/Dashboard/SafetyAndPrivacyController.php b/app/Http/Controllers/V2/Dashboard/SafetyAndPrivacyController.php index dccb7132..14f6fcff 100644 --- a/app/Http/Controllers/V2/Dashboard/SafetyAndPrivacyController.php +++ b/app/Http/Controllers/V2/Dashboard/SafetyAndPrivacyController.php @@ -139,7 +139,7 @@ class SafetyAndPrivacyController extends Controller if ($request->has('recognize_picture')) { $recognize_picture = $request->file('recognize_picture')->store('safety_and_privacy/'.$safety_and_privacy->id.'/recognize_picture', 'public'); - $safety_and_privacy->recognize_picture = url('/') . '/storage/' . $recognize_picture; + $safety_and_privacy->recognize_picture = Storage::disk('public')->url($recognize_picture); // \App\Helpers\Compress::resize("/var/www/rms/public/storage/{$recognize_picture}"); } @@ -230,7 +230,7 @@ class SafetyAndPrivacyController extends Controller try { \DB::transaction(function () use ($request, $safety_and_privacy) { $action_picture = $request->file('action_picture')->store('safety_and_privacy/'.$safety_and_privacy->id.'/action_picture', 'public'); - $safety_and_privacy->action_picture = url('/') . '/storage/' . $action_picture; + $safety_and_privacy->action_picture = Storage::disk('public')->url($action_picture); // \App\Helpers\Compress::resize("/var/www/rms/public/storage/{$action_picture}"); $safety_and_privacy->action_picture_document_upload_date = now(); @@ -255,7 +255,7 @@ class SafetyAndPrivacyController extends Controller $result = []; foreach ($datas as $data) { - $result[] = url('/') . '/storage/' . $data; + $result[] = Storage::disk('public')->url($data); } return response()->json([ From 797179d0216c69623c3be8652866b16134d800ba Mon Sep 17 00:00:00 2001 From: amirghasempoor Date: Tue, 5 Mar 2024 15:35:49 +0330 Subject: [PATCH 08/10] generate migration files from db --- .env.example | 7 ++ app/Models/User.php | 2 +- bootstrap/cache/packages.php | 7 ++ bootstrap/cache/services.php | 66 +++++----- composer.json | 1 + composer.lock | 75 +++++++++++- database/factories/UserFactory.php | 23 ++++ ...te__abrar_plan_project_histories_table.php | 42 +++++++ ...3823_create__abrar_plan_projects_table.php | 45 +++++++ ...e__accident_251_points_histories_table.php | 40 ++++++ ...3823_create__accident_251_points_table.php | 47 ++++++++ ...3_05_133823_create__b_b_jaheshes_table.php | 42 +++++++ ...3_05_133823_create__b_b_openings_table.php | 43 +++++++ ...05_133823_create__b_b_priorities_table.php | 41 +++++++ ...3_create__b_b_project_indicators_table.php | 53 ++++++++ ...03_05_133823_create__contactuses_table.php | 37 ++++++ ...03_05_133823_create__geopoints_2_table.php | 33 +++++ ...4_03_05_133823_create__geopoints_table.php | 33 +++++ ...eate__jahesh_operation_histories_table.php | 45 +++++++ ...133823_create__jahesh_operations_table.php | 44 +++++++ ...3823_create__rms_event_histories_table.php | 35 ++++++ ..._03_05_133823_create__rms_events_table.php | 39 ++++++ ...eate__road_construction_projects_table.php | 64 ++++++++++ ...oad_construction_rural_histories_table.php | 55 +++++++++ ...create__road_construction_rurals_table.php | 62 ++++++++++ ...road_danger_prevention_histories_table.php | 55 +++++++++ ..._create__road_danger_preventions_table.php | 63 ++++++++++ ...ad_maintenance_project_histories_table.php | 55 +++++++++ ...reate__road_maintenance_projects_table.php | 62 ++++++++++ ...823_create__road_patrol_projects_table.php | 49 ++++++++ ...create__road_patrol_sub_projects_table.php | 37 ++++++ ...oad_technical_building_histories_table.php | 55 +++++++++ ...create__road_technical_buildings_table.php | 63 ++++++++++ ...d_tollhouse_management_histories_table.php | 55 +++++++++ ...eate__road_tollhouse_managements_table.php | 63 ++++++++++ ...23_create__road_upgrade_safeties_table.php | 63 ++++++++++ ...e__road_upgrade_safety_histories_table.php | 55 +++++++++ ...03_05_133823_create__route_paths_table.php | 33 +++++ ...133823_create__techno_transports_table.php | 47 ++++++++ ...5_133823_create__weather_notices_table.php | 35 ++++++ ...05_133823_create_accident_damage_table.php | 35 ++++++ ..._create_accident_point_histories_table.php | 42 +++++++ ...05_133823_create_accident_points_table.php | 51 ++++++++ ...24_03_05_133823_create_accidents_table.php | 67 ++++++++++ .../2024_03_05_133823_create_camps_table.php | 63 ++++++++++ .../2024_03_05_133823_create_cities_table.php | 39 ++++++ ...4_03_05_133823_create_cmms_demos_table.php | 65 ++++++++++ ...3823_create_cmms_forms_histories_table.php | 48 ++++++++ ...4_03_05_133823_create_cmms_forms_table.php | 106 ++++++++++++++++ ...3_05_133823_create_cmms_province_table.php | 36 ++++++ ..._05_133823_create_constituencies_table.php | 34 ++++++ ...823_create_contract_eblagh_melis_table.php | 47 ++++++++ ...3_create_contract_mojavez_setads_table.php | 43 +++++++ ...ate_contract_sub_items_histories_table.php | 92 ++++++++++++++ ..._133823_create_contract_subitems_table.php | 100 +++++++++++++++ ..._03_05_133823_create_contractors_table.php | 34 ++++++ ...24_03_05_133823_create_contracts_table.php | 70 +++++++++++ ...024_03_05_133823_create_coridors_table.php | 59 +++++++++ ..._create_daily_accident_histories_table.php | 38 ++++++ ...3_create_daily_accident_settings_table.php | 35 ++++++ ...05_133823_create_daily_accidents_table.php | 114 ++++++++++++++++++ ...2024_03_05_133823_create_damages_table.php | 34 ++++++ ...23_create_danger_point_accidents_table.php | 43 +++++++ ...23_create_danger_point_histories_table.php | 62 ++++++++++ ...3_05_133823_create_danger_points_table.php | 77 ++++++++++++ ..._05_133823_create_edarate_ostani_table.php | 33 +++++ ...23_create_edarate_shahri_be_city_table.php | 34 ++++++ ..._05_133823_create_edarate_shahri_table.php | 33 +++++ ...5_133823_create_http_errors_list_table.php | 35 ++++++ ...4_03_05_133823_create_info_items_table.php | 41 +++++++ ...create_lawmakers_correspondences_table.php | 52 ++++++++ ...24_03_05_133823_create_log_lists_table.php | 34 ++++++ ...823_create_model_has_permissions_table.php | 35 ++++++ ...05_133823_create_model_has_roles_table.php | 35 ++++++ ...24_03_05_133823_create_new_randd_table.php | 49 ++++++++ ..._05_133823_create_observed_items_table.php | 47 ++++++++ .../2024_03_05_133823_create_otps_table.php | 36 ++++++ ...05_133823_create_password_resets_table.php | 37 ++++++ ..._03_05_133823_create_permissions_table.php | 41 +++++++ ...23_create_personal_access_tokens_table.php | 40 ++++++ ..._03_05_133823_create_point_files_table.php | 34 ++++++ ...3_05_133823_create_project_files_table.php | 37 ++++++ ...133823_create_proposal_histories_table.php | 75 ++++++++++++ ...24_03_05_133823_create_proposals_table.php | 79 ++++++++++++ ...24_03_05_133823_create_provinces_table.php | 43 +++++++ ...3_create_rahdari_point_histories_table.php | 48 ++++++++ ..._05_133823_create_rahdari_points_table.php | 59 +++++++++ ..._05_133823_create_rand_d_members_table.php | 35 ++++++ ...reate_randd_voting_paper_answers_table.php | 39 ++++++ ...3_05_133823_create_randd_votings_table.php | 35 ++++++ ...3_05_133823_create_research_devs_table.php | 52 ++++++++ ...33823_create_rms_reports_summary_table.php | 33 +++++ ...33823_create_road_items_projects_table.php | 70 +++++++++++ ...reate_road_observation_histories_table.php | 35 ++++++ ...3_create_road_observed_histories_table.php | 38 ++++++ ..._05_133823_create_road_observeds_table.php | 84 +++++++++++++ ...03_05_133823_create_road_patrols_table.php | 58 +++++++++ ...3823_create_role_has_permissions_table.php | 33 +++++ .../2024_03_05_133823_create_roles_table.php | 36 ++++++ ...133823_create_safety_and_privacy_table.php | 52 ++++++++ ...05_133823_create_setad_provinces_table.php | 31 +++++ ...4_03_05_133823_create_tarh_lists_table.php | 33 +++++ ..._133823_create_telescope_entries_table.php | 39 ++++++ ...23_create_telescope_entries_tags_table.php | 33 +++++ ...3823_create_telescope_monitoring_table.php | 30 +++++ .../2024_03_05_133823_create_units_table.php | 31 +++++ ...133823_create_user_activity_logs_table.php | 55 +++++++++ .../2024_03_05_133823_create_users_table.php | 58 +++++++++ ...to__abrar_plan_project_histories_table.php | 32 +++++ ...ign_keys_to__abrar_plan_projects_table.php | 34 ++++++ ...o__accident_251_points_histories_table.php | 34 ++++++ ...ign_keys_to__accident_251_points_table.php | 36 ++++++ ...dd_foreign_keys_to__b_b_jaheshes_table.php | 32 +++++ ...dd_foreign_keys_to__b_b_openings_table.php | 32 +++++ ...s_to__jahesh_operation_histories_table.php | 34 ++++++ ...reign_keys_to__jahesh_operations_table.php | 32 +++++ ...ign_keys_to__rms_event_histories_table.php | 34 ++++++ ..._add_foreign_keys_to__rms_events_table.php | 32 +++++ ...s_to__road_construction_projects_table.php | 32 +++++ ...oad_construction_rural_histories_table.php | 34 ++++++ ...eys_to__road_construction_rurals_table.php | 34 ++++++ ...road_danger_prevention_histories_table.php | 34 ++++++ ...keys_to__road_danger_preventions_table.php | 34 ++++++ ...ad_maintenance_project_histories_table.php | 34 ++++++ ...ys_to__road_maintenance_projects_table.php | 34 ++++++ ...gn_keys_to__road_patrol_projects_table.php | 32 +++++ ...oad_technical_building_histories_table.php | 34 ++++++ ...eys_to__road_technical_buildings_table.php | 34 ++++++ ...d_tollhouse_management_histories_table.php | 34 ++++++ ...s_to__road_tollhouse_managements_table.php | 34 ++++++ ...n_keys_to__road_upgrade_safeties_table.php | 34 ++++++ ...o__road_upgrade_safety_histories_table.php | 34 ++++++ ..._foreign_keys_to_accident_damage_table.php | 34 ++++++ ...keys_to_accident_point_histories_table.php | 34 ++++++ ..._foreign_keys_to_accident_points_table.php | 34 ++++++ ...133826_add_foreign_keys_to_camps_table.php | 34 ++++++ ...33826_add_foreign_keys_to_cities_table.php | 32 +++++ ...ign_keys_to_cmms_forms_histories_table.php | 32 +++++ ..._to_contract_sub_items_histories_table.php | 32 +++++ ...oreign_keys_to_contract_subitems_table.php | 32 +++++ ...26_add_foreign_keys_to_contracts_table.php | 34 ++++++ ...826_add_foreign_keys_to_coridors_table.php | 34 ++++++ ...n_keys_to_danger_point_accidents_table.php | 34 ++++++ ...n_keys_to_danger_point_histories_table.php | 34 ++++++ ...dd_foreign_keys_to_danger_points_table.php | 36 ++++++ ...gn_keys_to_model_has_permissions_table.php | 32 +++++ ..._foreign_keys_to_model_has_roles_table.php | 32 +++++ ...d_foreign_keys_to_observed_items_table.php | 34 ++++++ ..._keys_to_rahdari_point_histories_table.php | 34 ++++++ ...d_foreign_keys_to_rahdari_points_table.php | 34 ++++++ ...ys_to_randd_voting_paper_answers_table.php | 34 ++++++ ...dd_foreign_keys_to_randd_votings_table.php | 34 ++++++ ...eign_keys_to_road_items_projects_table.php | 32 +++++ ...ys_to_road_observation_histories_table.php | 32 +++++ ..._keys_to_road_observed_histories_table.php | 32 +++++ ...d_foreign_keys_to_road_observeds_table.php | 40 ++++++ ...add_foreign_keys_to_road_patrols_table.php | 38 ++++++ ...ign_keys_to_role_has_permissions_table.php | 32 +++++ ...reign_keys_to_safety_and_privacy_table.php | 36 ++++++ ...n_keys_to_telescope_entries_tags_table.php | 32 +++++ ...reign_keys_to_user_activity_logs_table.php | 32 +++++ ...133826_add_foreign_keys_to_users_table.php | 38 ++++++ .../operatorFirstStepStoreTest.php | 24 ++++ tests/Unit/ExampleTest.php | 16 +++ 164 files changed, 6896 insertions(+), 34 deletions(-) create mode 100644 database/factories/UserFactory.php create mode 100644 database/migrations/2024_03_05_133823_create__abrar_plan_project_histories_table.php create mode 100644 database/migrations/2024_03_05_133823_create__abrar_plan_projects_table.php create mode 100644 database/migrations/2024_03_05_133823_create__accident_251_points_histories_table.php create mode 100644 database/migrations/2024_03_05_133823_create__accident_251_points_table.php create mode 100644 database/migrations/2024_03_05_133823_create__b_b_jaheshes_table.php create mode 100644 database/migrations/2024_03_05_133823_create__b_b_openings_table.php create mode 100644 database/migrations/2024_03_05_133823_create__b_b_priorities_table.php create mode 100644 database/migrations/2024_03_05_133823_create__b_b_project_indicators_table.php create mode 100644 database/migrations/2024_03_05_133823_create__contactuses_table.php create mode 100644 database/migrations/2024_03_05_133823_create__geopoints_2_table.php create mode 100644 database/migrations/2024_03_05_133823_create__geopoints_table.php create mode 100644 database/migrations/2024_03_05_133823_create__jahesh_operation_histories_table.php create mode 100644 database/migrations/2024_03_05_133823_create__jahesh_operations_table.php create mode 100644 database/migrations/2024_03_05_133823_create__rms_event_histories_table.php create mode 100644 database/migrations/2024_03_05_133823_create__rms_events_table.php create mode 100644 database/migrations/2024_03_05_133823_create__road_construction_projects_table.php create mode 100644 database/migrations/2024_03_05_133823_create__road_construction_rural_histories_table.php create mode 100644 database/migrations/2024_03_05_133823_create__road_construction_rurals_table.php create mode 100644 database/migrations/2024_03_05_133823_create__road_danger_prevention_histories_table.php create mode 100644 database/migrations/2024_03_05_133823_create__road_danger_preventions_table.php create mode 100644 database/migrations/2024_03_05_133823_create__road_maintenance_project_histories_table.php create mode 100644 database/migrations/2024_03_05_133823_create__road_maintenance_projects_table.php create mode 100644 database/migrations/2024_03_05_133823_create__road_patrol_projects_table.php create mode 100644 database/migrations/2024_03_05_133823_create__road_patrol_sub_projects_table.php create mode 100644 database/migrations/2024_03_05_133823_create__road_technical_building_histories_table.php create mode 100644 database/migrations/2024_03_05_133823_create__road_technical_buildings_table.php create mode 100644 database/migrations/2024_03_05_133823_create__road_tollhouse_management_histories_table.php create mode 100644 database/migrations/2024_03_05_133823_create__road_tollhouse_managements_table.php create mode 100644 database/migrations/2024_03_05_133823_create__road_upgrade_safeties_table.php create mode 100644 database/migrations/2024_03_05_133823_create__road_upgrade_safety_histories_table.php create mode 100644 database/migrations/2024_03_05_133823_create__route_paths_table.php create mode 100644 database/migrations/2024_03_05_133823_create__techno_transports_table.php create mode 100644 database/migrations/2024_03_05_133823_create__weather_notices_table.php create mode 100644 database/migrations/2024_03_05_133823_create_accident_damage_table.php create mode 100644 database/migrations/2024_03_05_133823_create_accident_point_histories_table.php create mode 100644 database/migrations/2024_03_05_133823_create_accident_points_table.php create mode 100644 database/migrations/2024_03_05_133823_create_accidents_table.php create mode 100644 database/migrations/2024_03_05_133823_create_camps_table.php create mode 100644 database/migrations/2024_03_05_133823_create_cities_table.php create mode 100644 database/migrations/2024_03_05_133823_create_cmms_demos_table.php create mode 100644 database/migrations/2024_03_05_133823_create_cmms_forms_histories_table.php create mode 100644 database/migrations/2024_03_05_133823_create_cmms_forms_table.php create mode 100644 database/migrations/2024_03_05_133823_create_cmms_province_table.php create mode 100644 database/migrations/2024_03_05_133823_create_constituencies_table.php create mode 100644 database/migrations/2024_03_05_133823_create_contract_eblagh_melis_table.php create mode 100644 database/migrations/2024_03_05_133823_create_contract_mojavez_setads_table.php create mode 100644 database/migrations/2024_03_05_133823_create_contract_sub_items_histories_table.php create mode 100644 database/migrations/2024_03_05_133823_create_contract_subitems_table.php create mode 100644 database/migrations/2024_03_05_133823_create_contractors_table.php create mode 100644 database/migrations/2024_03_05_133823_create_contracts_table.php create mode 100644 database/migrations/2024_03_05_133823_create_coridors_table.php create mode 100644 database/migrations/2024_03_05_133823_create_daily_accident_histories_table.php create mode 100644 database/migrations/2024_03_05_133823_create_daily_accident_settings_table.php create mode 100644 database/migrations/2024_03_05_133823_create_daily_accidents_table.php create mode 100644 database/migrations/2024_03_05_133823_create_damages_table.php create mode 100644 database/migrations/2024_03_05_133823_create_danger_point_accidents_table.php create mode 100644 database/migrations/2024_03_05_133823_create_danger_point_histories_table.php create mode 100644 database/migrations/2024_03_05_133823_create_danger_points_table.php create mode 100644 database/migrations/2024_03_05_133823_create_edarate_ostani_table.php create mode 100644 database/migrations/2024_03_05_133823_create_edarate_shahri_be_city_table.php create mode 100644 database/migrations/2024_03_05_133823_create_edarate_shahri_table.php create mode 100644 database/migrations/2024_03_05_133823_create_http_errors_list_table.php create mode 100644 database/migrations/2024_03_05_133823_create_info_items_table.php create mode 100644 database/migrations/2024_03_05_133823_create_lawmakers_correspondences_table.php create mode 100644 database/migrations/2024_03_05_133823_create_log_lists_table.php create mode 100644 database/migrations/2024_03_05_133823_create_model_has_permissions_table.php create mode 100644 database/migrations/2024_03_05_133823_create_model_has_roles_table.php create mode 100644 database/migrations/2024_03_05_133823_create_new_randd_table.php create mode 100644 database/migrations/2024_03_05_133823_create_observed_items_table.php create mode 100644 database/migrations/2024_03_05_133823_create_otps_table.php create mode 100644 database/migrations/2024_03_05_133823_create_password_resets_table.php create mode 100644 database/migrations/2024_03_05_133823_create_permissions_table.php create mode 100644 database/migrations/2024_03_05_133823_create_personal_access_tokens_table.php create mode 100644 database/migrations/2024_03_05_133823_create_point_files_table.php create mode 100644 database/migrations/2024_03_05_133823_create_project_files_table.php create mode 100644 database/migrations/2024_03_05_133823_create_proposal_histories_table.php create mode 100644 database/migrations/2024_03_05_133823_create_proposals_table.php create mode 100644 database/migrations/2024_03_05_133823_create_provinces_table.php create mode 100644 database/migrations/2024_03_05_133823_create_rahdari_point_histories_table.php create mode 100644 database/migrations/2024_03_05_133823_create_rahdari_points_table.php create mode 100644 database/migrations/2024_03_05_133823_create_rand_d_members_table.php create mode 100644 database/migrations/2024_03_05_133823_create_randd_voting_paper_answers_table.php create mode 100644 database/migrations/2024_03_05_133823_create_randd_votings_table.php create mode 100644 database/migrations/2024_03_05_133823_create_research_devs_table.php create mode 100644 database/migrations/2024_03_05_133823_create_rms_reports_summary_table.php create mode 100644 database/migrations/2024_03_05_133823_create_road_items_projects_table.php create mode 100644 database/migrations/2024_03_05_133823_create_road_observation_histories_table.php create mode 100644 database/migrations/2024_03_05_133823_create_road_observed_histories_table.php create mode 100644 database/migrations/2024_03_05_133823_create_road_observeds_table.php create mode 100644 database/migrations/2024_03_05_133823_create_road_patrols_table.php create mode 100644 database/migrations/2024_03_05_133823_create_role_has_permissions_table.php create mode 100644 database/migrations/2024_03_05_133823_create_roles_table.php create mode 100644 database/migrations/2024_03_05_133823_create_safety_and_privacy_table.php create mode 100644 database/migrations/2024_03_05_133823_create_setad_provinces_table.php create mode 100644 database/migrations/2024_03_05_133823_create_tarh_lists_table.php create mode 100644 database/migrations/2024_03_05_133823_create_telescope_entries_table.php create mode 100644 database/migrations/2024_03_05_133823_create_telescope_entries_tags_table.php create mode 100644 database/migrations/2024_03_05_133823_create_telescope_monitoring_table.php create mode 100644 database/migrations/2024_03_05_133823_create_units_table.php create mode 100644 database/migrations/2024_03_05_133823_create_user_activity_logs_table.php create mode 100644 database/migrations/2024_03_05_133823_create_users_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to__abrar_plan_project_histories_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to__abrar_plan_projects_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to__accident_251_points_histories_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to__accident_251_points_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to__b_b_jaheshes_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to__b_b_openings_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to__jahesh_operation_histories_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to__jahesh_operations_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to__rms_event_histories_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to__rms_events_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to__road_construction_projects_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to__road_construction_rural_histories_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to__road_construction_rurals_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to__road_danger_prevention_histories_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to__road_danger_preventions_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to__road_maintenance_project_histories_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to__road_maintenance_projects_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to__road_patrol_projects_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to__road_technical_building_histories_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to__road_technical_buildings_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to__road_tollhouse_management_histories_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to__road_tollhouse_managements_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to__road_upgrade_safeties_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to__road_upgrade_safety_histories_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to_accident_damage_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to_accident_point_histories_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to_accident_points_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to_camps_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to_cities_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to_cmms_forms_histories_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to_contract_sub_items_histories_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to_contract_subitems_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to_contracts_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to_coridors_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to_danger_point_accidents_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to_danger_point_histories_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to_danger_points_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to_model_has_permissions_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to_model_has_roles_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to_observed_items_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to_rahdari_point_histories_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to_rahdari_points_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to_randd_voting_paper_answers_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to_randd_votings_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to_road_items_projects_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to_road_observation_histories_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to_road_observed_histories_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to_road_observeds_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to_road_patrols_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to_role_has_permissions_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to_safety_and_privacy_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to_telescope_entries_tags_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to_user_activity_logs_table.php create mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to_users_table.php create mode 100644 tests/Feature/V2/Dashboard/SafetyAndPrivacy/operatorFirstStepStoreTest.php create mode 100644 tests/Unit/ExampleTest.php diff --git a/.env.example b/.env.example index 847530ff..93fcb9bf 100644 --- a/.env.example +++ b/.env.example @@ -13,6 +13,13 @@ DB_DATABASE=rms_db DB_USERNAME=rms_user DB_PASSWORD=1qaz@WSX +DB_CONNECTION_2= +DB_HOST_2= +DB_PORT_2= +DB_DATABASE_2= +DB_USERNAME_2= +DB_PASSWORD_2= + BROADCAST_DRIVER=log CACHE_DRIVER=file QUEUE_CONNECTION=sync diff --git a/app/Models/User.php b/app/Models/User.php index 6b5ec545..dd207a20 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -15,7 +15,7 @@ use DB; class User extends Authenticatable { - use Notifiable, HasRoles, HasPermissions; + use Notifiable, HasRoles, HasPermissions, HasFactory; /** diff --git a/bootstrap/cache/packages.php b/bootstrap/cache/packages.php index b1510cc4..9ba8eb78 100755 --- a/bootstrap/cache/packages.php +++ b/bootstrap/cache/packages.php @@ -21,6 +21,13 @@ 'Verta' => 'Hekmatinasser\\Verta\\Verta', ), ), + 'kitloong/laravel-migrations-generator' => + array ( + 'providers' => + array ( + 0 => 'KitLoong\\MigrationsGenerator\\MigrationsGeneratorServiceProvider', + ), + ), 'laravel/sail' => array ( 'providers' => diff --git a/bootstrap/cache/services.php b/bootstrap/cache/services.php index 1e8e57b5..1ae78e1a 100755 --- a/bootstrap/cache/services.php +++ b/bootstrap/cache/services.php @@ -25,24 +25,25 @@ 21 => 'Illuminate\\View\\ViewServiceProvider', 22 => 'Barryvdh\\Debugbar\\ServiceProvider', 23 => 'Hekmatinasser\\Verta\\Laravel\\VertaServiceProvider', - 24 => 'Laravel\\Sail\\SailServiceProvider', - 25 => 'Laravel\\Sanctum\\SanctumServiceProvider', - 26 => 'Laravel\\Telescope\\TelescopeServiceProvider', - 27 => 'Laravel\\Tinker\\TinkerServiceProvider', - 28 => 'Laravel\\Ui\\UiServiceProvider', - 29 => 'Maatwebsite\\Excel\\ExcelServiceProvider', - 30 => 'Carbon\\Laravel\\ServiceProvider', - 31 => 'NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider', - 32 => 'Termwind\\Laravel\\TermwindServiceProvider', - 33 => 'Spatie\\LaravelIgnition\\IgnitionServiceProvider', - 34 => 'Spatie\\Permission\\PermissionServiceProvider', + 24 => 'KitLoong\\MigrationsGenerator\\MigrationsGeneratorServiceProvider', + 25 => 'Laravel\\Sail\\SailServiceProvider', + 26 => 'Laravel\\Sanctum\\SanctumServiceProvider', + 27 => 'Laravel\\Telescope\\TelescopeServiceProvider', + 28 => 'Laravel\\Tinker\\TinkerServiceProvider', + 29 => 'Laravel\\Ui\\UiServiceProvider', + 30 => 'Maatwebsite\\Excel\\ExcelServiceProvider', + 31 => 'Carbon\\Laravel\\ServiceProvider', + 32 => 'NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider', + 33 => 'Termwind\\Laravel\\TermwindServiceProvider', + 34 => 'Spatie\\LaravelIgnition\\IgnitionServiceProvider', 35 => 'Spatie\\Permission\\PermissionServiceProvider', - 36 => 'App\\Providers\\AppServiceProvider', - 37 => 'App\\Providers\\AuthServiceProvider', - 38 => 'App\\Providers\\EventServiceProvider', - 39 => 'App\\Providers\\RouteServiceProvider', - 40 => 'App\\Providers\\TelescopeServiceProvider', - 41 => 'Barryvdh\\Debugbar\\ServiceProvider', + 36 => 'Spatie\\Permission\\PermissionServiceProvider', + 37 => 'App\\Providers\\AppServiceProvider', + 38 => 'App\\Providers\\AuthServiceProvider', + 39 => 'App\\Providers\\EventServiceProvider', + 40 => 'App\\Providers\\RouteServiceProvider', + 41 => 'App\\Providers\\TelescopeServiceProvider', + 42 => 'Barryvdh\\Debugbar\\ServiceProvider', ), 'eager' => array ( @@ -58,22 +59,23 @@ 9 => 'Illuminate\\View\\ViewServiceProvider', 10 => 'Barryvdh\\Debugbar\\ServiceProvider', 11 => 'Hekmatinasser\\Verta\\Laravel\\VertaServiceProvider', - 12 => 'Laravel\\Sanctum\\SanctumServiceProvider', - 13 => 'Laravel\\Telescope\\TelescopeServiceProvider', - 14 => 'Laravel\\Ui\\UiServiceProvider', - 15 => 'Maatwebsite\\Excel\\ExcelServiceProvider', - 16 => 'Carbon\\Laravel\\ServiceProvider', - 17 => 'NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider', - 18 => 'Termwind\\Laravel\\TermwindServiceProvider', - 19 => 'Spatie\\LaravelIgnition\\IgnitionServiceProvider', - 20 => 'Spatie\\Permission\\PermissionServiceProvider', + 12 => 'KitLoong\\MigrationsGenerator\\MigrationsGeneratorServiceProvider', + 13 => 'Laravel\\Sanctum\\SanctumServiceProvider', + 14 => 'Laravel\\Telescope\\TelescopeServiceProvider', + 15 => 'Laravel\\Ui\\UiServiceProvider', + 16 => 'Maatwebsite\\Excel\\ExcelServiceProvider', + 17 => 'Carbon\\Laravel\\ServiceProvider', + 18 => 'NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider', + 19 => 'Termwind\\Laravel\\TermwindServiceProvider', + 20 => 'Spatie\\LaravelIgnition\\IgnitionServiceProvider', 21 => 'Spatie\\Permission\\PermissionServiceProvider', - 22 => 'App\\Providers\\AppServiceProvider', - 23 => 'App\\Providers\\AuthServiceProvider', - 24 => 'App\\Providers\\EventServiceProvider', - 25 => 'App\\Providers\\RouteServiceProvider', - 26 => 'App\\Providers\\TelescopeServiceProvider', - 27 => 'Barryvdh\\Debugbar\\ServiceProvider', + 22 => 'Spatie\\Permission\\PermissionServiceProvider', + 23 => 'App\\Providers\\AppServiceProvider', + 24 => 'App\\Providers\\AuthServiceProvider', + 25 => 'App\\Providers\\EventServiceProvider', + 26 => 'App\\Providers\\RouteServiceProvider', + 27 => 'App\\Providers\\TelescopeServiceProvider', + 28 => 'Barryvdh\\Debugbar\\ServiceProvider', ), 'deferred' => array ( diff --git a/composer.json b/composer.json index c8ddb499..05a8958e 100644 --- a/composer.json +++ b/composer.json @@ -22,6 +22,7 @@ "require-dev": { "barryvdh/laravel-debugbar": "^3.9", "fakerphp/faker": "^1.9.1", + "kitloong/laravel-migrations-generator": "^7.0", "laravel/pint": "^1.0", "laravel/sail": "^1.18", "mockery/mockery": "^1.4.4", diff --git a/composer.lock b/composer.lock index 57606208..7c8ba57f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "687a4c2a80c569c39332ff856097dafd", + "content-hash": "f354c54643bedde32669099052baa40c", "packages": [ { "name": "beberlei/assert", @@ -7420,6 +7420,79 @@ }, "time": "2020-07-09T08:09:16+00:00" }, + { + "name": "kitloong/laravel-migrations-generator", + "version": "v7.0.0", + "source": { + "type": "git", + "url": "https://github.com/kitloong/laravel-migrations-generator.git", + "reference": "44e070fffdc3a774439e7df4419e92b88e872574" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/kitloong/laravel-migrations-generator/zipball/44e070fffdc3a774439e7df4419e92b88e872574", + "reference": "44e070fffdc3a774439e7df4419e92b88e872574", + "shasum": "" + }, + "require": { + "ext-pdo": "*", + "illuminate/support": "^10.43|^11.0", + "php": "^8.1" + }, + "require-dev": { + "barryvdh/laravel-ide-helper": "^2.0|^3.0", + "friendsofphp/php-cs-fixer": "^3.1", + "larastan/larastan": "^1.0|^2.0", + "mockery/mockery": "^1.0", + "orchestra/testbench": "^8.0|^9.0", + "phpmd/phpmd": "^2.10", + "slevomat/coding-standard": "^8.0", + "squizlabs/php_codesniffer": "^3.5" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "KitLoong\\MigrationsGenerator\\MigrationsGeneratorServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "KitLoong\\MigrationsGenerator\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kit Loong", + "email": "kitloong1008@gmail.com" + } + ], + "description": "Generates Laravel Migrations from an existing database", + "keywords": [ + "artisan", + "generator", + "laravel", + "lumen", + "migration", + "migrations" + ], + "support": { + "issues": "https://github.com/kitloong/laravel-migrations-generator/issues", + "source": "https://github.com/kitloong/laravel-migrations-generator/tree/v7.0.0" + }, + "funding": [ + { + "url": "https://www.buymeacoffee.com/kitloong", + "type": "custom" + } + ], + "time": "2024-03-03T15:26:31+00:00" + }, { "name": "laravel/pint", "version": "v1.13.10", diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php new file mode 100644 index 00000000..a335e139 --- /dev/null +++ b/database/factories/UserFactory.php @@ -0,0 +1,23 @@ + + */ +class UserFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'username' => $this->faker->name + ]; + } +} diff --git a/database/migrations/2024_03_05_133823_create__abrar_plan_project_histories_table.php b/database/migrations/2024_03_05_133823_create__abrar_plan_project_histories_table.php new file mode 100644 index 00000000..542b9605 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create__abrar_plan_project_histories_table.php @@ -0,0 +1,42 @@ +bigIncrements('id'); + $table->unsignedSmallInteger('project_id')->nullable()->index('abrar_plan_project_histories_project_id_foreign'); + $table->unsignedInteger('user_id')->nullable()->index('abrar_plan_project_histories_user_id_foreign'); + $table->string('previous_type')->nullable(); + $table->unsignedTinyInteger('previous_status')->nullable(); + $table->string('previous_status_progress')->nullable(); + $table->text('previous_status_description')->nullable(); + $table->string('previous_status_date')->nullable(); + $table->string('previous_start_latlng')->nullable(); + $table->string('previous_end_latlng')->nullable(); + $table->string('previous_length')->nullable(); + $table->text('new_files')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('_abrar_plan_project_histories'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create__abrar_plan_projects_table.php b/database/migrations/2024_03_05_133823_create__abrar_plan_projects_table.php new file mode 100644 index 00000000..552036a5 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create__abrar_plan_projects_table.php @@ -0,0 +1,45 @@ +smallIncrements('id'); + $table->unsignedTinyInteger('province_id')->nullable()->index('abrar_plan_projects_province_id_foreign'); + $table->string('province_name')->nullable(); + $table->unsignedSmallInteger('city_id')->nullable()->index('abrar_plan_projects_city_id_foreign'); + $table->string('city_name')->nullable(); + $table->text('axis_name')->nullable(); + $table->string('axis_length')->nullable(); + $table->string('project_type')->nullable(); + $table->unsignedTinyInteger('project_status')->nullable(); + $table->string('project_status_progress')->nullable(); + $table->text('project_status_description')->nullable(); + $table->string('project_status_date')->nullable(); + $table->string('project_start_latlng')->nullable(); + $table->string('project_end_latlng')->nullable(); + $table->string('project_length')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('_abrar_plan_projects'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create__accident_251_points_histories_table.php b/database/migrations/2024_03_05_133823_create__accident_251_points_histories_table.php new file mode 100644 index 00000000..c406d174 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create__accident_251_points_histories_table.php @@ -0,0 +1,40 @@ +bigIncrements('id'); + $table->unsignedSmallInteger('point_id')->nullable()->index('accident_251_points_histories_point_id_foreign'); + $table->unsignedInteger('user_id')->nullable()->index('accident_251_points_histories_user_id_foreign'); + $table->string('previous_lat'); + $table->string('previous_lng'); + $table->string('previous_cost')->nullable(); + $table->string('previous_progress')->nullable(); + $table->string('previous_end_date')->nullable(); + $table->text('previous_actions')->nullable(); + $table->text('new_files')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('_accident_251_points_histories'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create__accident_251_points_table.php b/database/migrations/2024_03_05_133823_create__accident_251_points_table.php new file mode 100644 index 00000000..341c7844 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create__accident_251_points_table.php @@ -0,0 +1,47 @@ +smallIncrements('id'); + $table->unsignedTinyInteger('province_id')->nullable()->index('accident_251_points_province_id_foreign'); + $table->unsignedSmallInteger('city_id')->nullable()->index('accident_251_points_city_id_foreign'); + $table->unsignedSmallInteger('accident_point_id')->nullable()->index('accident_251_points_accident_point_id_foreign'); + $table->string('lat'); + $table->string('lng'); + $table->string('province')->nullable(); + $table->string('axis_name')->nullable(); + $table->string('axis_start')->nullable(); + $table->string('axis_end')->nullable(); + $table->string('native_name')->nullable(); + $table->text('operation')->nullable(); + $table->string('target')->nullable(); + $table->string('cost')->nullable(); + $table->string('progress')->nullable(); + $table->string('end_date')->nullable(); + $table->text('actions')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('_accident_251_points'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create__b_b_jaheshes_table.php b/database/migrations/2024_03_05_133823_create__b_b_jaheshes_table.php new file mode 100644 index 00000000..b002e19a --- /dev/null +++ b/database/migrations/2024_03_05_133823_create__b_b_jaheshes_table.php @@ -0,0 +1,42 @@ +bigIncrements('id'); + $table->string('province_fa')->nullable(); + $table->unsignedTinyInteger('province_id')->nullable()->index('b_b_jaheshes_province_id_foreign'); + $table->tinyInteger('project_type')->nullable(); + $table->string('project_type_fa')->nullable(); + $table->double('plan_id', null, 0)->nullable(); + $table->string('plan_fa')->nullable(); + $table->double('project_count_all', null, 0)->nullable(); + $table->double('project_count_done', null, 0)->nullable(); + $table->double('project_progress', null, 0)->nullable(); + $table->string('unit')->nullable(); + $table->timestamps(); + $table->string('last_updated_at_fa')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('_b_b_jaheshes'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create__b_b_openings_table.php b/database/migrations/2024_03_05_133823_create__b_b_openings_table.php new file mode 100644 index 00000000..1554c29f --- /dev/null +++ b/database/migrations/2024_03_05_133823_create__b_b_openings_table.php @@ -0,0 +1,43 @@ +bigIncrements('id'); + $table->string('office_name')->nullable(); + $table->string('deputy_district')->nullable(); + $table->string('province_fa')->nullable(); + $table->unsignedTinyInteger('province_id')->nullable()->index('b_b_openings_province_id_foreign'); + $table->string('activity')->nullable(); + $table->string('plan_id')->nullable(); + $table->string('plan_fa')->nullable(); + $table->string('project_title')->nullable(); + $table->string('unit')->nullable(); + $table->double('amount', null, 0)->nullable()->default(0); + $table->double('national_consumer_credit', null, 0)->nullable(); + $table->double('province_consumer_credit', null, 0)->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('_b_b_openings'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create__b_b_priorities_table.php b/database/migrations/2024_03_05_133823_create__b_b_priorities_table.php new file mode 100644 index 00000000..25ae2386 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create__b_b_priorities_table.php @@ -0,0 +1,41 @@ +bigIncrements('id'); + $table->string('province')->nullable(); + $table->tinyInteger('province_id')->nullable(); + $table->string('assistance')->nullable(); + $table->tinyInteger('assistance_id')->nullable(); + $table->string('office')->nullable(); + $table->tinyInteger('office_id')->nullable(); + $table->string('project_title')->nullable(); + $table->double('credits_required', null, 0)->nullable(); + $table->string('project_completion')->nullable(); + $table->string('project_completion_id')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('_b_b_priorities'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create__b_b_project_indicators_table.php b/database/migrations/2024_03_05_133823_create__b_b_project_indicators_table.php new file mode 100644 index 00000000..d9003c48 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create__b_b_project_indicators_table.php @@ -0,0 +1,53 @@ +bigIncrements('id'); + $table->string('project_province_fa')->nullable(); + $table->unsignedTinyInteger('project_province_id')->nullable(); + $table->string('project_plan_fa')->nullable(); + $table->unsignedTinyInteger('project_plan_id')->nullable(); + $table->string('project_office_fa')->nullable(); + $table->unsignedTinyInteger('project_office_id')->nullable(); + $table->string('province_fa')->nullable(); + $table->unsignedTinyInteger('province_id')->nullable(); + $table->string('city_fa')->nullable(); + $table->unsignedTinyInteger('city_id')->nullable(); + $table->string('project_indicator_fa')->nullable(); + $table->unsignedTinyInteger('project_indicator_id')->nullable(); + $table->unsignedMediumInteger('project_year')->nullable(); + $table->string('project_name')->nullable(); + $table->string('project_related')->nullable(); + $table->string('project_axis')->nullable(); + $table->unsignedBigInteger('project_accept_value')->nullable(); + $table->unsignedBigInteger('project_communicate_value')->nullable(); + $table->unsignedBigInteger('project_allocate_value')->nullable(); + $table->unsignedBigInteger('project_unique_id')->nullable(); + $table->timestamps(); + $table->mediumInteger('project_progress')->nullable(); + $table->bigInteger('project_accept_done')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('_b_b_project_indicators'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create__contactuses_table.php b/database/migrations/2024_03_05_133823_create__contactuses_table.php new file mode 100644 index 00000000..3fae77fe --- /dev/null +++ b/database/migrations/2024_03_05_133823_create__contactuses_table.php @@ -0,0 +1,37 @@ +bigIncrements('id'); + $table->string('c_name'); + $table->string('c_phone'); + $table->string('c_title'); + $table->string('c_describe'); + $table->timestamps(); + $table->bigInteger('user_id'); + $table->string('admin_response')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('_contactuses'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create__geopoints_2_table.php b/database/migrations/2024_03_05_133823_create__geopoints_2_table.php new file mode 100644 index 00000000..388121dd --- /dev/null +++ b/database/migrations/2024_03_05_133823_create__geopoints_2_table.php @@ -0,0 +1,33 @@ +integer('pid', true); + $table->point('geopoint'); + + $table->spatialIndex(['geopoint'], 'geopoint'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('_geopoints_2'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create__geopoints_table.php b/database/migrations/2024_03_05_133823_create__geopoints_table.php new file mode 100644 index 00000000..97f7a65a --- /dev/null +++ b/database/migrations/2024_03_05_133823_create__geopoints_table.php @@ -0,0 +1,33 @@ +integer('pid', true); + $table->point('geopoint'); + + $table->spatialIndex(['geopoint'], 'geopoint'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('_geopoints'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create__jahesh_operation_histories_table.php b/database/migrations/2024_03_05_133823_create__jahesh_operation_histories_table.php new file mode 100644 index 00000000..a9c1d425 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create__jahesh_operation_histories_table.php @@ -0,0 +1,45 @@ +bigIncrements('id'); + $table->unsignedSmallInteger('jahesh_operation_id')->nullable()->index('jahesh_operation_histories_jahesh_operation_id_foreign'); + $table->unsignedInteger('user_id')->nullable()->index('jahesh_operation_histories_user_id_foreign'); + $table->string('previous_operation_1')->nullable(); + $table->string('previous_operation_2')->nullable(); + $table->string('previous_operation_3')->nullable(); + $table->string('previous_operation_4')->nullable(); + $table->string('previous_operation_5')->nullable(); + $table->string('previous_operation_6')->nullable(); + $table->string('previous_operation_7')->nullable(); + $table->string('previous_operation_8')->nullable(); + $table->string('previous_operation_9')->nullable(); + $table->string('previous_operation_10')->nullable(); + $table->string('previous_operation_11')->nullable(); + $table->string('previous_operation_12')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('_jahesh_operation_histories'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create__jahesh_operations_table.php b/database/migrations/2024_03_05_133823_create__jahesh_operations_table.php new file mode 100644 index 00000000..230a5e1a --- /dev/null +++ b/database/migrations/2024_03_05_133823_create__jahesh_operations_table.php @@ -0,0 +1,44 @@ +smallIncrements('id'); + $table->unsignedTinyInteger('province_id')->nullable()->index('jahesh_operations_province_id_foreign'); + $table->string('operation_1')->nullable(); + $table->string('operation_2')->nullable(); + $table->string('operation_3')->nullable(); + $table->string('operation_4')->nullable(); + $table->string('operation_5')->nullable(); + $table->string('operation_6')->nullable(); + $table->string('operation_7')->nullable(); + $table->string('operation_8')->nullable(); + $table->string('operation_9')->nullable(); + $table->string('operation_10')->nullable(); + $table->string('operation_11')->nullable(); + $table->string('operation_12')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('_jahesh_operations'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create__rms_event_histories_table.php b/database/migrations/2024_03_05_133823_create__rms_event_histories_table.php new file mode 100644 index 00000000..1db0c0a0 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create__rms_event_histories_table.php @@ -0,0 +1,35 @@ +bigIncrements('id'); + $table->unsignedInteger('rms_event_id')->nullable()->index('rms_event_histories_rms_event_id_foreign'); + $table->unsignedInteger('user_id')->nullable()->index('rms_event_histories_user_id_foreign'); + $table->boolean('status'); + $table->string('path_file')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('_rms_event_histories'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create__rms_events_table.php b/database/migrations/2024_03_05_133823_create__rms_events_table.php new file mode 100644 index 00000000..db6fc23e --- /dev/null +++ b/database/migrations/2024_03_05_133823_create__rms_events_table.php @@ -0,0 +1,39 @@ +increments('id'); + $table->unsignedInteger('user_id')->nullable()->index('rms_events_user_id_foreign'); + $table->string('title'); + $table->text('description')->nullable(); + $table->string('path_file')->nullable(); + $table->string('path_image')->nullable(); + $table->timestamp('end_date')->nullable(); + $table->boolean('archived')->default(false); + $table->timestamps(); + $table->softDeletes(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('_rms_events'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create__road_construction_projects_table.php b/database/migrations/2024_03_05_133823_create__road_construction_projects_table.php new file mode 100644 index 00000000..a7bbd588 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create__road_construction_projects_table.php @@ -0,0 +1,64 @@ +bigIncrements('id'); + $table->unsignedInteger('user_id')->nullable()->index('road_construction_projects_user_id_foreign'); + $table->unsignedTinyInteger('operation_type'); + $table->string('operation_sub_types'); + $table->decimal('start_lat', 12, 10); + $table->decimal('start_lng', 12, 10); + $table->decimal('end_lat', 12, 10); + $table->decimal('end_lng', 12, 10); + $table->string('project_distance'); + $table->unsignedTinyInteger('province'); + $table->unsignedTinyInteger('city'); + $table->string('axis_name')->nullable(); + $table->unsignedTinyInteger('axis_type'); + $table->string('project_name')->nullable(); + $table->unsignedTinyInteger('project_type'); + $table->string('start_date')->nullable(); + $table->string('consultant_name')->nullable(); + $table->string('contractor_name')->nullable(); + $table->string('ordered_credit'); + $table->string('absorbed_credit'); + $table->string('required_credit')->nullable(); + $table->string('plan_number')->nullable(); + $table->unsignedTinyInteger('plan_office')->nullable(); + $table->string('announced_date')->nullable(); + $table->string('credit_progress'); + $table->string('physical_progress'); + $table->text('project_problems')->nullable(); + $table->unsignedTinyInteger('project_status'); + $table->string('project_stop_reasons')->nullable(); + $table->boolean('can_release')->default(false); + $table->string('release_date')->nullable(); + $table->string('supervisor_name')->nullable(); + $table->string('responsible_name')->nullable(); + $table->string('report_date')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('_road_construction_projects'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create__road_construction_rural_histories_table.php b/database/migrations/2024_03_05_133823_create__road_construction_rural_histories_table.php new file mode 100644 index 00000000..bbb2c13d --- /dev/null +++ b/database/migrations/2024_03_05_133823_create__road_construction_rural_histories_table.php @@ -0,0 +1,55 @@ +bigIncrements('id'); + $table->unsignedBigInteger('project_id')->nullable()->index('road_construction_rural_histories_project_id_foreign'); + $table->unsignedInteger('user_id')->nullable()->index('road_construction_rural_histories_user_id_foreign'); + $table->string('previous_axis_name')->nullable(); + $table->unsignedTinyInteger('previous_axis_type')->nullable(); + $table->string('previous_project_name')->nullable(); + $table->longText('previous_cities_id')->nullable(); + $table->string('previous_contractor_name')->nullable(); + $table->string('previous_consultant_name')->nullable(); + $table->string('previous_contract_date')->nullable(); + $table->string('previous_contract_credit')->nullable(); + $table->string('previous_start_latlng')->nullable(); + $table->string('previous_end_latlng')->nullable(); + $table->string('previous_stop_reason')->nullable(); + $table->string('previous_team_latlng')->nullable(); + $table->timestamp('previous_submited_at')->nullable(); + $table->timestamp('previous_last_updated_at')->nullable(); + $table->longText('previous_project_distance')->nullable(); + $table->longText('previous_project_distance_update')->nullable(); + $table->string('previous_contractor_credit')->nullable(); + $table->string('previous_physical_progress')->nullable(); + $table->text('previous_description')->nullable(); + $table->boolean('previous_status')->default(false); + $table->boolean('previous_project_status')->default(false); + $table->text('new_files')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('_road_construction_rural_histories'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create__road_construction_rurals_table.php b/database/migrations/2024_03_05_133823_create__road_construction_rurals_table.php new file mode 100644 index 00000000..e103a956 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create__road_construction_rurals_table.php @@ -0,0 +1,62 @@ +bigIncrements('id'); + $table->unsignedInteger('user_id')->index('road_construction_rurals_user_id_foreign'); + $table->string('axis_name')->nullable(); + $table->unsignedTinyInteger('axis_type')->nullable(); + $table->string('axis_type_fa')->nullable(); + $table->string('project_name')->nullable(); + $table->unsignedTinyInteger('province_id')->nullable()->index('road_construction_rurals_province_id_foreign'); + $table->string('province_fa')->nullable(); + $table->longText('cities_id')->nullable(); + $table->string('city_1_fa')->nullable(); + $table->string('city_2_fa')->nullable(); + $table->string('city_3_fa')->nullable(); + $table->string('contractor_name')->nullable(); + $table->string('consultant_name')->nullable(); + $table->string('contract_date')->nullable(); + $table->string('contract_credit')->nullable(); + $table->string('start_latlng')->nullable(); + $table->string('end_latlng')->nullable(); + $table->timestamp('submited_at')->nullable(); + $table->string('submited_at_fa')->nullable(); + $table->timestamp('last_updated_at')->nullable(); + $table->string('last_updated_at_fa')->nullable(); + $table->longText('project_distance')->nullable(); + $table->longText('project_distance_update')->nullable(); + $table->string('contractor_credit')->nullable(); + $table->string('physical_progress')->nullable(); + $table->text('description')->nullable(); + $table->boolean('status')->default(false); + $table->boolean('project_status')->default(false); + $table->boolean('rate')->nullable(); + $table->string('rate_desc')->nullable(); + $table->string('project_status_fa')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('_road_construction_rurals'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create__road_danger_prevention_histories_table.php b/database/migrations/2024_03_05_133823_create__road_danger_prevention_histories_table.php new file mode 100644 index 00000000..49bf857c --- /dev/null +++ b/database/migrations/2024_03_05_133823_create__road_danger_prevention_histories_table.php @@ -0,0 +1,55 @@ +bigIncrements('id'); + $table->unsignedBigInteger('project_id')->nullable()->index('road_danger_prevention_histories_project_id_foreign'); + $table->unsignedInteger('user_id')->nullable()->index('road_danger_prevention_histories_user_id_foreign'); + $table->string('previous_axis_name')->nullable(); + $table->unsignedTinyInteger('previous_axis_type')->nullable(); + $table->string('previous_project_name')->nullable(); + $table->longText('previous_cities_id')->nullable(); + $table->string('previous_contractor_name')->nullable(); + $table->string('previous_consultant_name')->nullable(); + $table->string('previous_contract_date')->nullable(); + $table->string('previous_contract_credit')->nullable(); + $table->string('previous_start_latlng')->nullable(); + $table->string('previous_end_latlng')->nullable(); + $table->string('previous_team_latlng')->nullable(); + $table->string('previous_stop_reason')->nullable(); + $table->timestamp('previous_submited_at')->nullable(); + $table->timestamp('previous_last_updated_at')->nullable(); + $table->longText('previous_project_distance')->nullable(); + $table->longText('previous_project_distance_update')->nullable(); + $table->string('previous_contractor_credit')->nullable(); + $table->string('previous_physical_progress')->nullable(); + $table->text('previous_description')->nullable(); + $table->boolean('previous_status')->default(false); + $table->boolean('previous_project_status')->default(false); + $table->text('new_files')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('_road_danger_prevention_histories'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create__road_danger_preventions_table.php b/database/migrations/2024_03_05_133823_create__road_danger_preventions_table.php new file mode 100644 index 00000000..3ce8c5ed --- /dev/null +++ b/database/migrations/2024_03_05_133823_create__road_danger_preventions_table.php @@ -0,0 +1,63 @@ +bigIncrements('id'); + $table->unsignedInteger('user_id')->nullable()->index('road_danger_preventions_user_id_foreign'); + $table->string('axis_name')->nullable(); + $table->unsignedTinyInteger('axis_type')->nullable(); + $table->string('axis_type_fa')->nullable(); + $table->string('project_name')->nullable(); + $table->unsignedTinyInteger('province_id')->nullable()->index('road_danger_preventions_province_id_foreign'); + $table->string('province_fa')->nullable(); + $table->longText('cities_id')->nullable(); + $table->string('city_1_fa')->nullable(); + $table->string('city_2_fa')->nullable(); + $table->string('city_3_fa')->nullable(); + $table->string('contractor_name')->nullable(); + $table->string('consultant_name')->nullable(); + $table->string('contract_date')->nullable(); + $table->string('contract_credit')->nullable(); + $table->string('start_latlng')->nullable(); + $table->string('end_latlng')->nullable(); + $table->timestamp('submited_at')->nullable(); + $table->string('submited_at_fa')->nullable(); + $table->timestamp('last_updated_at')->nullable(); + $table->string('last_updated_at_fa')->nullable(); + $table->longText('project_distance')->nullable(); + $table->longText('project_distance_update')->nullable(); + $table->string('contractor_credit')->nullable(); + $table->string('physical_progress')->nullable(); + $table->text('description')->nullable(); + $table->boolean('status')->default(false); + $table->boolean('project_status')->default(false); + $table->string('project_status_fa')->nullable(); + $table->boolean('rate')->nullable(); + $table->string('rate_desc')->nullable(); + $table->text('project_description')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('_road_danger_preventions'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create__road_maintenance_project_histories_table.php b/database/migrations/2024_03_05_133823_create__road_maintenance_project_histories_table.php new file mode 100644 index 00000000..e8c00b38 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create__road_maintenance_project_histories_table.php @@ -0,0 +1,55 @@ +bigIncrements('id'); + $table->unsignedBigInteger('project_id')->nullable()->index('road_maintenance_project_histories_project_id_foreign'); + $table->unsignedInteger('user_id')->nullable()->index('road_maintenance_project_histories_user_id_foreign'); + $table->string('previous_axis_name')->nullable(); + $table->unsignedTinyInteger('previous_axis_type')->nullable(); + $table->string('previous_project_name')->nullable(); + $table->longText('previous_cities_id')->nullable(); + $table->string('previous_contractor_name')->nullable(); + $table->string('previous_consultant_name')->nullable(); + $table->string('previous_contract_date')->nullable(); + $table->string('previous_contract_credit')->nullable(); + $table->string('previous_start_latlng')->nullable(); + $table->string('previous_end_latlng')->nullable(); + $table->string('previous_team_latlng')->nullable(); + $table->string('previous_stop_reason')->nullable(); + $table->timestamp('previous_submited_at')->nullable(); + $table->timestamp('previous_last_updated_at')->nullable(); + $table->longText('previous_project_distance')->nullable(); + $table->longText('previous_project_distance_update')->nullable(); + $table->string('previous_contractor_credit')->nullable(); + $table->string('previous_physical_progress')->nullable(); + $table->text('previous_description')->nullable(); + $table->boolean('previous_status')->default(false); + $table->boolean('previous_project_status')->default(false); + $table->text('new_files')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('_road_maintenance_project_histories'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create__road_maintenance_projects_table.php b/database/migrations/2024_03_05_133823_create__road_maintenance_projects_table.php new file mode 100644 index 00000000..fcfa4ebe --- /dev/null +++ b/database/migrations/2024_03_05_133823_create__road_maintenance_projects_table.php @@ -0,0 +1,62 @@ +bigIncrements('id'); + $table->unsignedInteger('user_id')->nullable()->index('road_maintenance_projects_user_id_foreign'); + $table->string('axis_name')->nullable(); + $table->unsignedTinyInteger('axis_type')->nullable(); + $table->string('axis_type_fa')->nullable(); + $table->string('project_name')->nullable(); + $table->unsignedTinyInteger('province_id')->nullable()->index('road_maintenance_projects_province_id_foreign'); + $table->string('province_fa')->nullable(); + $table->longText('cities_id')->nullable(); + $table->string('city_1_fa')->nullable(); + $table->string('city_2_fa')->nullable(); + $table->string('city_3_fa')->nullable(); + $table->string('contractor_name')->nullable(); + $table->string('consultant_name')->nullable(); + $table->string('contract_date')->nullable(); + $table->string('contract_credit')->nullable(); + $table->string('start_latlng')->nullable(); + $table->string('end_latlng')->nullable(); + $table->timestamp('submited_at')->nullable(); + $table->string('submited_at_fa')->nullable(); + $table->timestamp('last_updated_at')->nullable(); + $table->string('last_updated_at_fa')->nullable(); + $table->longText('project_distance')->nullable(); + $table->longText('project_distance_update')->nullable(); + $table->string('contractor_credit')->nullable(); + $table->string('physical_progress')->nullable(); + $table->text('description')->nullable(); + $table->boolean('status')->default(false); + $table->boolean('project_status')->default(false); + $table->boolean('rate')->nullable(); + $table->string('rate_desc')->nullable(); + $table->string('project_status_fa')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('_road_maintenance_projects'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create__road_patrol_projects_table.php b/database/migrations/2024_03_05_133823_create__road_patrol_projects_table.php new file mode 100644 index 00000000..6e5bb1fc --- /dev/null +++ b/database/migrations/2024_03_05_133823_create__road_patrol_projects_table.php @@ -0,0 +1,49 @@ +bigIncrements('id'); + $table->unsignedInteger('user_id')->nullable()->index('road_patrol_projects_user_id_foreign'); + $table->decimal('start_lat', 12, 10); + $table->decimal('start_lng', 12, 10); + $table->decimal('end_lat', 12, 10); + $table->decimal('end_lng', 12, 10); + $table->string('project_distance'); + $table->timestamps(); + $table->bigInteger('province_id')->nullable(); + $table->string('province_fa')->nullable(); + $table->bigInteger('city_id')->nullable(); + $table->string('city_fa')->nullable(); + $table->bigInteger('start_way_id')->nullable(); + $table->bigInteger('end_way_id')->nullable(); + $table->string('user_name')->nullable(); + $table->unsignedSmallInteger('status')->nullable(); + $table->string('status_fa', 100)->nullable(); + $table->unsignedInteger('supervisor_id')->nullable(); + $table->text('supervisor_description')->nullable(); + $table->timestamp('supervising_time')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('_road_patrol_projects'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create__road_patrol_sub_projects_table.php b/database/migrations/2024_03_05_133823_create__road_patrol_sub_projects_table.php new file mode 100644 index 00000000..c722af12 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create__road_patrol_sub_projects_table.php @@ -0,0 +1,37 @@ +bigIncrements('id'); + $table->unsignedBigInteger('road_patrol_project_id'); + $table->decimal('project_lat', 12, 10); + $table->decimal('project_lng', 12, 10); + $table->unsignedTinyInteger('item'); + $table->string('sub_items'); + $table->longText('sub_items_data')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('_road_patrol_sub_projects'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create__road_technical_building_histories_table.php b/database/migrations/2024_03_05_133823_create__road_technical_building_histories_table.php new file mode 100644 index 00000000..b775fbc2 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create__road_technical_building_histories_table.php @@ -0,0 +1,55 @@ +bigIncrements('id'); + $table->unsignedBigInteger('project_id')->nullable()->index('road_technical_building_histories_project_id_foreign'); + $table->unsignedInteger('user_id')->nullable()->index('road_technical_building_histories_user_id_foreign'); + $table->string('previous_axis_name')->nullable(); + $table->unsignedTinyInteger('previous_axis_type')->nullable(); + $table->string('previous_project_name')->nullable(); + $table->longText('previous_cities_id')->nullable(); + $table->string('previous_contractor_name')->nullable(); + $table->string('previous_consultant_name')->nullable(); + $table->string('previous_contract_date')->nullable(); + $table->string('previous_contract_credit')->nullable(); + $table->string('previous_start_latlng')->nullable(); + $table->string('previous_end_latlng')->nullable(); + $table->string('previous_team_latlng')->nullable(); + $table->string('previous_stop_reason')->nullable(); + $table->timestamp('previous_submited_at')->nullable(); + $table->timestamp('previous_last_updated_at')->nullable(); + $table->longText('previous_project_distance')->nullable(); + $table->longText('previous_project_distance_update')->nullable(); + $table->string('previous_contractor_credit')->nullable(); + $table->string('previous_physical_progress')->nullable(); + $table->text('previous_description')->nullable(); + $table->boolean('previous_status')->default(false); + $table->boolean('previous_project_status')->default(false); + $table->text('new_files')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('_road_technical_building_histories'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create__road_technical_buildings_table.php b/database/migrations/2024_03_05_133823_create__road_technical_buildings_table.php new file mode 100644 index 00000000..cb84eff3 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create__road_technical_buildings_table.php @@ -0,0 +1,63 @@ +bigIncrements('id'); + $table->unsignedInteger('user_id')->nullable()->index('road_technical_buildings_user_id_foreign'); + $table->string('axis_name')->nullable(); + $table->unsignedTinyInteger('axis_type')->nullable(); + $table->string('axis_type_fa')->nullable(); + $table->string('project_name')->nullable(); + $table->unsignedTinyInteger('province_id')->nullable()->index('road_technical_buildings_province_id_foreign'); + $table->string('province_fa')->nullable(); + $table->longText('cities_id')->nullable(); + $table->string('city_1_fa')->nullable(); + $table->string('city_2_fa')->nullable(); + $table->string('city_3_fa')->nullable(); + $table->string('contractor_name')->nullable(); + $table->string('consultant_name')->nullable(); + $table->string('contract_date')->nullable(); + $table->string('contract_credit')->nullable(); + $table->string('start_latlng')->nullable(); + $table->string('end_latlng')->nullable(); + $table->timestamp('submited_at')->nullable(); + $table->string('submited_at_fa')->nullable(); + $table->timestamp('last_updated_at')->nullable(); + $table->string('last_updated_at_fa')->nullable(); + $table->longText('project_distance')->nullable(); + $table->longText('project_distance_update')->nullable(); + $table->string('contractor_credit')->nullable(); + $table->string('physical_progress')->nullable(); + $table->text('description')->nullable(); + $table->boolean('status')->default(false); + $table->boolean('project_status')->default(false); + $table->string('project_status_fa')->nullable(); + $table->boolean('rate')->nullable(); + $table->string('rate_desc')->nullable(); + $table->text('project_describtion')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('_road_technical_buildings'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create__road_tollhouse_management_histories_table.php b/database/migrations/2024_03_05_133823_create__road_tollhouse_management_histories_table.php new file mode 100644 index 00000000..075b3829 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create__road_tollhouse_management_histories_table.php @@ -0,0 +1,55 @@ +bigIncrements('id'); + $table->unsignedBigInteger('project_id')->nullable()->index('road_tollhouse_management_histories_project_id_foreign'); + $table->unsignedInteger('user_id')->nullable()->index('road_tollhouse_management_histories_user_id_foreign'); + $table->string('previous_axis_name')->nullable(); + $table->unsignedTinyInteger('previous_axis_type')->nullable(); + $table->string('previous_project_name')->nullable(); + $table->longText('previous_cities_id')->nullable(); + $table->string('previous_contractor_name')->nullable(); + $table->string('previous_consultant_name')->nullable(); + $table->string('previous_contract_date')->nullable(); + $table->string('previous_contract_credit')->nullable(); + $table->string('previous_start_latlng')->nullable(); + $table->string('previous_end_latlng')->nullable(); + $table->string('previous_team_latlng')->nullable(); + $table->string('previous_stop_reason')->nullable(); + $table->timestamp('previous_submited_at')->nullable(); + $table->timestamp('previous_last_updated_at')->nullable(); + $table->longText('previous_project_distance')->nullable(); + $table->longText('previous_project_distance_update')->nullable(); + $table->string('previous_contractor_credit')->nullable(); + $table->string('previous_physical_progress')->nullable(); + $table->text('previous_description')->nullable(); + $table->boolean('previous_status')->default(false); + $table->boolean('previous_project_status')->default(false); + $table->text('new_files')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('_road_tollhouse_management_histories'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create__road_tollhouse_managements_table.php b/database/migrations/2024_03_05_133823_create__road_tollhouse_managements_table.php new file mode 100644 index 00000000..eb18e5ef --- /dev/null +++ b/database/migrations/2024_03_05_133823_create__road_tollhouse_managements_table.php @@ -0,0 +1,63 @@ +bigIncrements('id'); + $table->unsignedInteger('user_id')->nullable()->index('road_tollhouse_managements_user_id_foreign'); + $table->string('axis_name')->nullable(); + $table->unsignedTinyInteger('axis_type')->nullable(); + $table->string('axis_type_fa')->nullable(); + $table->string('project_name')->nullable(); + $table->unsignedTinyInteger('province_id')->nullable()->index('road_tollhouse_managements_province_id_foreign'); + $table->binary('province_fa')->nullable(); + $table->longText('cities_id')->nullable(); + $table->string('city_1_fa')->nullable(); + $table->string('city_2_fa')->nullable(); + $table->string('city_3_fa')->nullable(); + $table->string('contractor_name')->nullable(); + $table->string('consultant_name')->nullable(); + $table->string('contract_date')->nullable(); + $table->string('contract_credit')->nullable(); + $table->string('start_latlng')->nullable(); + $table->string('end_latlng')->nullable(); + $table->timestamp('submited_at')->nullable(); + $table->string('submited_at_fa')->nullable(); + $table->timestamp('last_updated_at')->nullable(); + $table->string('last_updated_at_fa')->nullable(); + $table->longText('project_distance')->nullable(); + $table->longText('project_distance_update')->nullable(); + $table->string('contractor_credit')->nullable(); + $table->string('physical_progress')->nullable(); + $table->text('description')->nullable(); + $table->boolean('status')->default(false); + $table->boolean('project_status')->default(false); + $table->string('project_status_fa')->nullable(); + $table->text('project_description')->nullable(); + $table->boolean('rate')->nullable(); + $table->string('rate_desc')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('_road_tollhouse_managements'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create__road_upgrade_safeties_table.php b/database/migrations/2024_03_05_133823_create__road_upgrade_safeties_table.php new file mode 100644 index 00000000..8a6ad88d --- /dev/null +++ b/database/migrations/2024_03_05_133823_create__road_upgrade_safeties_table.php @@ -0,0 +1,63 @@ +bigIncrements('id'); + $table->unsignedInteger('user_id')->nullable()->index('road_upgrade_safeties_user_id_foreign'); + $table->string('axis_name')->nullable(); + $table->integer('axis_type')->nullable(); + $table->string('axis_type_fa')->nullable(); + $table->string('project_name')->nullable(); + $table->unsignedTinyInteger('province_id')->nullable()->index('road_upgrade_safeties_province_id_foreign'); + $table->string('province_fa')->nullable(); + $table->longText('cities_id')->nullable(); + $table->string('city_1_fa')->nullable(); + $table->string('city_2_fa')->nullable(); + $table->string('city_3_fa')->nullable(); + $table->string('contractor_name')->nullable(); + $table->string('consultant_name')->nullable(); + $table->string('contract_date')->nullable(); + $table->string('contract_credit')->nullable(); + $table->string('start_latlng')->nullable(); + $table->string('end_latlng')->nullable(); + $table->timestamp('submited_at')->nullable(); + $table->string('submited_at_fa')->nullable(); + $table->timestamp('last_updated_at')->nullable(); + $table->string('last_updated_at_fa')->nullable(); + $table->longText('project_distance')->nullable(); + $table->longText('project_distance_update')->nullable(); + $table->string('contractor_credit')->nullable(); + $table->string('physical_progress')->nullable(); + $table->text('description')->nullable(); + $table->boolean('status')->default(false); + $table->boolean('project_status')->default(false); + $table->string('project_status_fa')->nullable(); + $table->text('project_description')->nullable(); + $table->boolean('rate')->nullable(); + $table->string('rate_desc')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('_road_upgrade_safeties'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create__road_upgrade_safety_histories_table.php b/database/migrations/2024_03_05_133823_create__road_upgrade_safety_histories_table.php new file mode 100644 index 00000000..691345f9 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create__road_upgrade_safety_histories_table.php @@ -0,0 +1,55 @@ +bigIncrements('id'); + $table->unsignedBigInteger('project_id')->nullable()->index('road_upgrade_safety_histories_project_id_foreign'); + $table->unsignedInteger('user_id')->nullable()->index('road_upgrade_safety_histories_user_id_foreign'); + $table->string('previous_axis_name')->nullable(); + $table->unsignedTinyInteger('previous_axis_type')->nullable(); + $table->string('previous_project_name')->nullable(); + $table->longText('previous_cities_id')->nullable(); + $table->string('previous_contractor_name')->nullable(); + $table->string('previous_consultant_name')->nullable(); + $table->string('previous_contract_date')->nullable(); + $table->string('previous_contract_credit')->nullable(); + $table->string('previous_start_latlng')->nullable(); + $table->string('previous_end_latlng')->nullable(); + $table->string('previous_team_latlng')->nullable(); + $table->string('previous_stop_reason')->nullable(); + $table->timestamp('previous_submited_at')->nullable(); + $table->timestamp('previous_last_updated_at')->nullable(); + $table->longText('previous_project_distance')->nullable(); + $table->longText('previous_project_distance_update')->nullable(); + $table->string('previous_contractor_credit')->nullable(); + $table->string('previous_physical_progress')->nullable(); + $table->text('previous_description')->nullable(); + $table->boolean('previous_status')->default(false); + $table->boolean('previous_project_status')->default(false); + $table->text('new_files')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('_road_upgrade_safety_histories'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create__route_paths_table.php b/database/migrations/2024_03_05_133823_create__route_paths_table.php new file mode 100644 index 00000000..6618f590 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create__route_paths_table.php @@ -0,0 +1,33 @@ +id(); + $table->decimal('lat1', 12, 10)->index('lat1'); + $table->decimal('lng1', 12, 10)->index('lng1'); + $table->string('identifier'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('_route_paths'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create__techno_transports_table.php b/database/migrations/2024_03_05_133823_create__techno_transports_table.php new file mode 100644 index 00000000..b9787c11 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create__techno_transports_table.php @@ -0,0 +1,47 @@ +integer('id', true); + $table->integer('presenter_type')->nullable(); + $table->string('presenter_fa', 100)->nullable(); + $table->string('company_type', 100)->nullable(); + $table->string('ceo_name', 300)->nullable(); + $table->string('ceo_cellphone', 300)->nullable(); + $table->string('name', 300)->nullable(); + $table->string('family', 300)->nullable(); + $table->string('telphone', 50)->nullable(); + $table->integer('province_id')->nullable(); + $table->string('province_fa', 300)->nullable(); + $table->text('address')->nullable(); + $table->string('idea_title', 300)->nullable(); + $table->text('file')->nullable(); + $table->integer('event_type')->nullable(); + $table->string('event_fa', 300)->nullable(); + $table->dateTime('created_at')->nullable(); + $table->dateTime('updated_at')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('_techno_transports'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create__weather_notices_table.php b/database/migrations/2024_03_05_133823_create__weather_notices_table.php new file mode 100644 index 00000000..a16634aa --- /dev/null +++ b/database/migrations/2024_03_05_133823_create__weather_notices_table.php @@ -0,0 +1,35 @@ +bigIncrements('id'); + $table->string('type')->nullable(); + $table->string('color')->nullable(); + $table->string('notice_code')->nullable(); + $table->text('notice_text')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('_weather_notices'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_accident_damage_table.php b/database/migrations/2024_03_05_133823_create_accident_damage_table.php new file mode 100644 index 00000000..c391343f --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_accident_damage_table.php @@ -0,0 +1,35 @@ +increments('id'); + $table->unsignedInteger('accident_id')->nullable()->index('accident_damage_ibfk_1'); + $table->unsignedInteger('damage_id')->nullable()->index('accident_damage_ibfk_2'); + $table->integer('value')->nullable(); + $table->bigInteger('amount')->nullable(); + $table->string('unit', 50)->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('accident_damage'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_accident_point_histories_table.php b/database/migrations/2024_03_05_133823_create_accident_point_histories_table.php new file mode 100644 index 00000000..f7613f22 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_accident_point_histories_table.php @@ -0,0 +1,42 @@ +bigIncrements('id'); + $table->unsignedSmallInteger('point_id')->index('accident_point_histories_point_id_foreign'); + $table->unsignedInteger('user_id')->nullable()->index('accident_point_histories_user_id_foreign'); + $table->string('previous_lat'); + $table->string('previous_lng'); + $table->text('previous_operation')->nullable(); + $table->string('previous_target')->nullable(); + $table->string('previous_cost')->nullable(); + $table->string('previous_progress')->nullable(); + $table->string('previous_end_date')->nullable(); + $table->text('previous_actions')->nullable(); + $table->text('new_files')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('accident_point_histories'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_accident_points_table.php b/database/migrations/2024_03_05_133823_create_accident_points_table.php new file mode 100644 index 00000000..6949306c --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_accident_points_table.php @@ -0,0 +1,51 @@ +smallIncrements('id'); + $table->unsignedTinyInteger('province_id')->nullable()->index('accident_points_province_id_foreign'); + $table->unsignedSmallInteger('city_id')->nullable()->index('accident_points_city_id_foreign'); + $table->string('lat'); + $table->string('lng'); + $table->string('priority')->nullable(); + $table->string('code')->nullable(); + $table->string('province')->nullable(); + $table->string('axis_name')->nullable(); + $table->string('axis_type')->nullable(); + $table->string('axis_start')->nullable(); + $table->string('axis_end')->nullable(); + $table->string('native_name')->nullable(); + $table->string('distance')->nullable(); + $table->string('geometric_desc')->nullable(); + $table->text('operation')->nullable(); + $table->string('target')->nullable(); + $table->string('cost')->default('0'); + $table->string('progress')->default('0'); + $table->string('end_date')->nullable(); + $table->text('actions')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('accident_points'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_accidents_table.php b/database/migrations/2024_03_05_133823_create_accidents_table.php new file mode 100644 index 00000000..669bec31 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_accidents_table.php @@ -0,0 +1,67 @@ +increments('id'); + $table->string('police_serial', 50)->nullable(); + $table->text('police_file')->nullable(); + $table->dateTime('police_file_date')->nullable(); + $table->string('province_id', 100)->nullable(); + $table->string('province_fa', 100)->nullable(); + $table->decimal('lat', 12, 10)->nullable(); + $table->decimal('lng', 12, 10)->nullable(); + $table->boolean('accident_type')->nullable(); + $table->string('accident_type_fa', 50)->nullable(); + $table->time('accident_time')->nullable(); + $table->dateTime('accident_date')->nullable(); + $table->string('axis_name', 200)->nullable(); + $table->integer('city_id')->nullable(); + $table->string('city_fa')->nullable(); + $table->string('driver_name', 200)->nullable(); + $table->string('driver_phone_number', 20)->nullable(); + $table->string('driver_national_code', 10)->nullable(); + $table->string('plaque', 200)->nullable(); + $table->text('damage_picture1')->nullable(); + $table->text('damage_picture2')->nullable(); + $table->boolean('report_base')->nullable(); + $table->bigInteger('way_id')->nullable(); + $table->unsignedBigInteger('sum')->nullable(); + $table->bigInteger('ojrate_nasb')->nullable(); + $table->text('deposit_insurance_image')->nullable(); + $table->unsignedBigInteger('deposit_insurance_amount')->nullable()->default(0); + $table->text('deposit_daghi_image')->nullable(); + $table->bigInteger('deposit_daghi_amount')->nullable()->default(0); + $table->timestamp('deposit_date')->nullable(); + $table->boolean('status')->nullable()->default(false); + $table->string('status_fa', 100)->nullable(); + $table->string('status_history', 100)->nullable()->default('0'); + $table->timestamps(); + $table->string('bill_code', 100)->nullable(); + $table->string('final_amount', 100)->nullable(); + $table->bigInteger('user_id')->nullable(); + $table->text('support_description')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('accidents'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_camps_table.php b/database/migrations/2024_03_05_133823_create_camps_table.php new file mode 100644 index 00000000..fcdee953 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_camps_table.php @@ -0,0 +1,63 @@ +bigIncrements('id'); + $table->unsignedInteger('user_id')->nullable()->index('camps_user_id_foreign'); + $table->unsignedTinyInteger('province_id')->nullable()->index('camps_province_id_foreign'); + $table->string('province_fa')->nullable(); + $table->string('axis_name')->nullable(); + $table->unsignedTinyInteger('axis_type')->nullable(); + $table->string('axis_type_fa')->nullable(); + $table->unsignedTinyInteger('blockage_cause')->nullable(); + $table->string('blockage_cause_fa')->nullable(); + $table->unsignedTinyInteger('blockage_type')->nullable(); + $table->string('blockage_type_fa')->nullable(); + $table->string('blockage_length')->nullable(); + $table->string('blockage_damage_money')->nullable(); + $table->string('blockage_damage_lower_6_count')->nullable(); + $table->string('blockage_damage_higher_6_count')->nullable(); + $table->string('blockage_damage_count')->nullable(); + $table->string('active_cars_count')->nullable(); + $table->string('active_rahdar_count')->nullable(); + $table->string('prediction_time_fa')->nullable(); + $table->tinyInteger('prediction_time')->nullable(); + $table->string('block_axis_desc')->nullable(); + $table->unsignedTinyInteger('is_open')->nullable()->default(2); + $table->string('is_open_type')->nullable(); + $table->string('is_open_type_fa')->nullable(); + $table->longText('cities_id')->nullable(); + $table->integer('city_id')->nullable(); + $table->string('city_1_fa')->nullable(); + $table->string('city_2_fa')->nullable(); + $table->string('city_3_fa')->nullable(); + $table->string('start_latlng')->nullable(); + $table->string('end_latlng')->nullable(); + $table->string('submited_at')->nullable(); + $table->string('is_open_at')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('camps'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_cities_table.php b/database/migrations/2024_03_05_133823_create_cities_table.php new file mode 100644 index 00000000..c42dc615 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_cities_table.php @@ -0,0 +1,39 @@ +smallIncrements('id'); + $table->unsignedTinyInteger('province_id')->nullable()->index('cities_province_id_foreign'); + $table->string('name_fa'); + $table->string('name_en')->nullable(); + $table->unsignedSmallInteger('type_id')->nullable(); + $table->unsignedTinyInteger('province_feature_id')->nullable(); + $table->decimal('center_lat', 12, 10)->nullable(); + $table->decimal('center_long', 12, 10)->nullable(); + $table->string('abrar_process')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('cities'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_cmms_demos_table.php b/database/migrations/2024_03_05_133823_create_cmms_demos_table.php new file mode 100644 index 00000000..358a5daf --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_cmms_demos_table.php @@ -0,0 +1,65 @@ +bigIncrements('id'); + $table->string('car_name')->nullable(); + $table->tinyInteger('car_group')->nullable(); + $table->string('car_group_fa')->nullable(); + $table->tinyInteger('car_type')->nullable(); + $table->string('car_type_fa')->nullable(); + $table->string('machine_code')->nullable(); + $table->string('estate_no')->nullable(); + $table->string('build_date')->nullable(); + $table->string('car_color')->nullable(); + $table->string('plak_number')->nullable(); + $table->string('plak_number_right')->nullable(); + $table->string('plak_number_left')->nullable(); + $table->string('plak_number_center')->nullable(); + $table->string('plak_number_char')->nullable(); + $table->string('body_number')->nullable(); + $table->string('dam_number')->nullable(); + $table->string('motor_number')->nullable(); + $table->string('vin_number')->nullable(); + $table->tinyInteger('section')->nullable(); + $table->string('section_fa')->nullable(); + $table->string('gps_code')->nullable(); + $table->string('driver_name')->nullable(); + $table->string('last_work_value')->nullable(); + $table->string('unit_name')->nullable(); + $table->string('status_fa')->nullable(); + $table->tinyInteger('status')->nullable(); + $table->string('repair_hourly_price')->nullable(); + $table->tinyInteger('unit_group')->nullable(); + $table->string('unit_group_fa')->nullable(); + $table->string('res1')->nullable(); + $table->string('mobile')->nullable(); + $table->tinyInteger('category')->nullable(); + $table->string('category_fa')->nullable(); + $table->timestamps(); + $table->boolean('proccessed')->nullable()->default(false); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('cmms_demos'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_cmms_forms_histories_table.php b/database/migrations/2024_03_05_133823_create_cmms_forms_histories_table.php new file mode 100644 index 00000000..2a2ed363 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_cmms_forms_histories_table.php @@ -0,0 +1,48 @@ +bigIncrements('id'); + $table->unsignedBigInteger('cmms_form_id')->nullable()->index('cmms_forms_histories_cmms_form_id_foreign'); + $table->unsignedBigInteger('user_id'); + $table->string('previous_chassis_number')->nullable(); + $table->string('previous_province_id')->nullable(); + $table->string('previous_province_fa')->nullable(); + $table->string('previous_city_id')->nullable(); + $table->string('previous_city_fa')->nullable(); + $table->string('previous_device_name')->nullable(); + $table->string('previous_operator_name')->nullable(); + $table->string('previous_operator_nationalcode')->nullable(); + $table->string('previous_operator_phone')->nullable(); + $table->string('previous_gps_code')->nullable(); + $table->timestamps(); + $table->text('previous_image1')->nullable(); + $table->text('previous_image2')->nullable(); + $table->text('previous_image3')->nullable(); + $table->text('previous_file1')->nullable(); + $table->string('previous_form_number')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('cmms_forms_histories'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_cmms_forms_table.php b/database/migrations/2024_03_05_133823_create_cmms_forms_table.php new file mode 100644 index 00000000..4d77d0c3 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_cmms_forms_table.php @@ -0,0 +1,106 @@ +bigIncrements('id'); + $table->string('dedicated_number')->nullable(); + $table->string('chassis_number')->nullable(); + $table->bigInteger('province_id')->nullable(); + $table->string('province_fa')->nullable(); + $table->bigInteger('city_id')->nullable(); + $table->string('city_fa')->nullable(); + $table->string('device_name')->nullable(); + $table->string('operator_name')->nullable(); + $table->string('operator_nationalcode')->nullable(); + $table->string('form_number')->nullable(); + $table->enum('car_type', ['B', 'L', 'G', 'Ex'])->nullable(); + $table->string('motor')->nullable(); + $table->text('motor_description')->nullable(); + $table->integer('motor_score')->nullable(); + $table->string('power')->nullable(); + $table->text('power_description')->nullable(); + $table->integer('power_score')->nullable(); + $table->string('zirbandi')->nullable(); + $table->text('zirbandi_description')->nullable(); + $table->integer('zirbandi_score')->nullable(); + $table->string('chassis')->nullable(); + $table->text('chassis_description')->nullable(); + $table->integer('chassis_score')->nullable(); + $table->string('electrical')->nullable(); + $table->text('electrical_description')->nullable(); + $table->integer('electrical_score')->nullable(); + $table->string('safety')->nullable(); + $table->text('safety_description')->nullable(); + $table->integer('safety_score')->nullable(); + $table->string('gps')->nullable(); + $table->text('gps_description')->nullable(); + $table->integer('gps_score')->nullable(); + $table->string('color')->nullable(); + $table->text('color_description')->nullable(); + $table->integer('color_score')->nullable(); + $table->string('bucket')->nullable(); + $table->text('bucket_description')->nullable(); + $table->integer('bucket_score')->nullable(); + $table->string('hydraulic')->nullable(); + $table->text('hydraulic_description')->nullable(); + $table->integer('hydraulic_score')->nullable(); + $table->string('jolobandi')->nullable(); + $table->text('jolobandi_description')->nullable(); + $table->integer('jolobandi_score')->nullable(); + $table->string('ripper')->nullable(); + $table->text('ripper_description')->nullable(); + $table->integer('ripper_score')->nullable(); + $table->string('service_status')->nullable(); + $table->text('service_description')->nullable(); + $table->string('fuel_form')->nullable(); + $table->text('fuel_description')->nullable(); + $table->boolean('question1')->nullable(); + $table->boolean('question2')->nullable(); + $table->boolean('question3')->nullable(); + $table->boolean('question4')->nullable(); + $table->boolean('question5')->nullable(); + $table->string('auditor_name')->nullable(); + $table->string('auditor_position')->nullable(); + $table->string('member1_name')->nullable(); + $table->string('member1_position')->nullable(); + $table->string('member2_name')->nullable(); + $table->string('member2_position')->nullable(); + $table->string('member3_name')->nullable(); + $table->string('member3_position')->nullable(); + $table->bigInteger('total_points')->nullable(); + $table->string('image1')->nullable(); + $table->string('image2')->nullable(); + $table->string('image3')->nullable(); + $table->string('file1')->nullable(); + $table->timestamps(); + $table->string('gps_code')->nullable(); + $table->string('operator_phone')->nullable(); + $table->string('car_type_fa')->nullable(); + $table->string('created_at_fa')->nullable(); + $table->string('updated_at_fa')->nullable(); + $table->integer('user_id')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('cmms_forms'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_cmms_province_table.php b/database/migrations/2024_03_05_133823_create_cmms_province_table.php new file mode 100644 index 00000000..cece2f20 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_cmms_province_table.php @@ -0,0 +1,36 @@ +bigIncrements('id'); + $table->bigInteger('province_id'); + $table->string('province_fa'); + $table->bigInteger('area_code'); + $table->timestamps(); + $table->bigInteger('rms_code'); + $table->bigInteger('user_id')->default(0); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('cmms_province'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_constituencies_table.php b/database/migrations/2024_03_05_133823_create_constituencies_table.php new file mode 100644 index 00000000..f943b6f6 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_constituencies_table.php @@ -0,0 +1,34 @@ +bigIncrements('id'); + $table->string('constituency_fa', 100)->nullable(); + $table->integer('province_id')->nullable(); + $table->string('province_fa', 100)->nullable(); + $table->string('region', 100)->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('constituencies'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_contract_eblagh_melis_table.php b/database/migrations/2024_03_05_133823_create_contract_eblagh_melis_table.php new file mode 100644 index 00000000..2cda35a4 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_contract_eblagh_melis_table.php @@ -0,0 +1,47 @@ +bigIncrements('id'); + $table->string('title')->nullable(); + $table->integer('province_id')->nullable(); + $table->string('province_fa')->nullable(); + $table->integer('office_id')->nullable(); + $table->string('office_fa')->nullable(); + $table->string('mehvar_name')->nullable(); + $table->string('tarh_number')->nullable(); + $table->string('credit_eblagh_public')->nullable(); + $table->string('credit_takhsis_public_cash')->nullable(); + $table->string('credit_takhsis_public_not_cash')->nullable(); + $table->string('credit_public_describe')->nullable(); + $table->string('credit_eblagh_other')->nullable(); + $table->string('credit_takhsis_other')->nullable(); + $table->string('credit_eblagh_meli')->nullable(); + $table->string('credit_takhsis_meli')->nullable(); + $table->integer('used')->nullable()->default(0); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('contract_eblagh_melis'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_contract_mojavez_setads_table.php b/database/migrations/2024_03_05_133823_create_contract_mojavez_setads_table.php new file mode 100644 index 00000000..d0043cf7 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_contract_mojavez_setads_table.php @@ -0,0 +1,43 @@ +bigIncrements('id'); + $table->integer('province_id'); + $table->string('province_fa'); + $table->integer('office_id'); + $table->string('office_fa'); + $table->string('title'); + $table->string('mehvar_name')->nullable(); + $table->string('mojavez_mablagh')->nullable(); + $table->string('mojavez_number'); + $table->string('mojavez_date'); + $table->string('tarh_number_1')->nullable(); + $table->string('tarh_number_2')->nullable(); + $table->string('tarh_number_3')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('contract_mojavez_setads'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_contract_sub_items_histories_table.php b/database/migrations/2024_03_05_133823_create_contract_sub_items_histories_table.php new file mode 100644 index 00000000..94e4d9d9 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_contract_sub_items_histories_table.php @@ -0,0 +1,92 @@ +bigIncrements('id'); + $table->string('project_title')->nullable(); + $table->string('project_type_id'); + $table->string('project_type_fa'); + $table->string('operation_type_id1')->nullable(); + $table->string('operation_type_fa1')->nullable(); + $table->float('operation_type_amount1', null, 0)->nullable(); + $table->float('operation_type_progress1', null, 0)->nullable(); + $table->string('operation_type_id2')->nullable(); + $table->string('operation_type_fa2')->nullable(); + $table->float('operation_type_amount2', null, 0)->nullable(); + $table->float('operation_type_progress2', null, 0)->nullable(); + $table->string('operation_type_id3')->nullable(); + $table->string('operation_type_fa3')->nullable(); + $table->float('operation_type_amount3', null, 0)->nullable(); + $table->float('operation_type_progress3', null, 0)->nullable(); + $table->string('operation_type_id4')->nullable(); + $table->string('operation_type_fa4')->nullable(); + $table->float('operation_type_amount4', null, 0)->nullable(); + $table->float('operation_type_progress4', null, 0)->nullable(); + $table->integer('city_id')->nullable(); + $table->string('city_fa')->nullable(); + $table->integer('province_id')->nullable(); + $table->string('province_fa')->nullable(); + $table->string('axis_type_id')->nullable(); + $table->string('axis_type_fa')->nullable(); + $table->string('axis_name_id')->nullable(); + $table->string('axis_name_fa')->nullable(); + $table->string('start_lat')->nullable(); + $table->string('end_lat')->nullable(); + $table->string('start_lng')->nullable(); + $table->string('end_lng')->nullable(); + $table->string('followup_priority_project')->nullable(); + $table->string('priority_project')->nullable(); + $table->string('operator_name')->nullable(); + $table->string('operator_phone')->nullable(); + $table->dateTime('last_date_update')->nullable(); + $table->string('updated_at_fa')->nullable(); + $table->string('created_at_fa')->nullable(); + $table->string('last_status_id')->nullable(); + $table->string('last_status_fa')->nullable(); + $table->string('last_digit_project')->nullable(); + $table->string('last_function_operator')->nullable(); + $table->string('last_payable_operator')->nullable(); + $table->string('complete_payable')->nullable(); + $table->string('image_path1')->nullable(); + $table->string('image_path2')->nullable(); + $table->string('unique_code')->nullable(); + $table->unsignedBigInteger('subitem_id')->nullable()->index('contract_sub_items_histories_subitem_id_foreign'); + $table->bigInteger('progress_project')->nullable()->default(0); + $table->string('operation_type_unit1')->nullable(); + $table->string('operation_type_unit2')->nullable(); + $table->string('operation_type_unit3')->nullable(); + $table->string('operation_type_unit4')->nullable(); + $table->float('operation_type_tonaj1', null, 0)->nullable(); + $table->float('operation_type_tonaj2', null, 0)->nullable(); + $table->float('operation_type_tonaj3', null, 0)->nullable(); + $table->float('operation_type_tonaj4', null, 0)->nullable(); + $table->integer('is_corrected')->nullable(); + $table->timestamps(); + $table->unsignedBigInteger('required_bitumen')->nullable(); + $table->unsignedBigInteger('used_bitumen')->nullable(); + $table->string('bridge_number', 50)->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('contract_sub_items_histories'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_contract_subitems_table.php b/database/migrations/2024_03_05_133823_create_contract_subitems_table.php new file mode 100644 index 00000000..f120f488 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_contract_subitems_table.php @@ -0,0 +1,100 @@ +bigIncrements('id'); + $table->string('project_title')->nullable(); + $table->tinyInteger('project_type_id')->nullable(); + $table->string('project_type_fa')->nullable(); + $table->string('project_type_fa_for_chart')->nullable(); + $table->integer('city_id')->nullable(); + $table->string('city_fa')->nullable(); + $table->tinyInteger('province_id')->nullable(); + $table->string('province_fa')->nullable(); + $table->integer('axis_type_id')->nullable(); + $table->string('axis_type_fa')->nullable(); + $table->tinyInteger('followup_priority_project_id')->nullable(); + $table->string('followup_priority_project')->nullable(); + $table->tinyInteger('priority_project')->nullable(); + $table->string('priority_project_fa', 119)->nullable(); + $table->string('operator_name')->nullable(); + $table->tinyInteger('last_status_id')->nullable(); + $table->integer('progress_project')->nullable(); + $table->string('last_status_fa')->nullable(); + $table->string('last_status_fa_for_chart', 119)->nullable(); + $table->string('last_digit_project')->nullable(); + $table->string('last_function_operator')->nullable(); + $table->string('last_payable_operator')->nullable(); + $table->string('complete_payable')->nullable(); + $table->dateTime('last_date_update')->nullable(); + $table->string('created_at_fa')->nullable(); + $table->string('updated_at_fa')->nullable(); + $table->string('unique_code'); + $table->string('operation_type_id1', 11)->nullable(); + $table->string('operation_type_fa1', 255)->nullable(); + $table->string('operation_type_unit1', 255)->nullable(); + $table->float('operation_type_amount1', null, 0)->nullable(); + $table->float('operation_type_progress1', null, 0)->nullable(); + $table->float('operation_type_tonaj1', null, 0)->nullable(); + $table->string('operation_type_id2', 11)->nullable(); + $table->string('operation_type_fa2', 255)->nullable(); + $table->string('operation_type_unit2', 255)->nullable(); + $table->float('operation_type_amount2', null, 0)->nullable(); + $table->float('operation_type_progress2', null, 0)->nullable(); + $table->float('operation_type_tonaj2', null, 0)->nullable(); + $table->string('operation_type_id3', 11)->nullable(); + $table->string('operation_type_fa3', 255)->nullable(); + $table->string('operation_type_unit3', 255)->nullable(); + $table->float('operation_type_amount3', null, 0)->nullable(); + $table->float('operation_type_progress3', null, 0)->nullable(); + $table->float('operation_type_tonaj3', null, 0)->nullable(); + $table->string('operation_type_id4', 11)->nullable(); + $table->string('operation_type_fa4', 255)->nullable(); + $table->string('operation_type_unit4', 255)->nullable(); + $table->float('operation_type_amount4', null, 0)->nullable(); + $table->float('operation_type_progress4', null, 0)->nullable(); + $table->float('operation_type_tonaj4', null, 0)->nullable(); + $table->string('image_path1', 255)->nullable(); + $table->string('image_path2', 255)->nullable(); + $table->string('axis_name_fa', 255)->nullable(); + $table->string('start_lat', 255)->nullable(); + $table->string('end_lat', 255)->nullable(); + $table->string('start_lng', 255)->nullable(); + $table->string('end_lng', 255)->nullable(); + $table->string('operator_phone')->nullable(); + $table->dateTime('contract_date_from_parent_contract')->nullable(); + $table->unsignedBigInteger('contract_id')->index('contract_foreign_key'); + $table->bigInteger('start_way_id')->nullable(); + $table->bigInteger('end_way_id')->nullable(); + $table->unsignedBigInteger('user_id')->nullable(); + $table->string('contract_moshaver_tarahi')->nullable()->default('not_set'); + $table->string('contract_moshaver_nezarat')->nullable()->default('not_set'); + $table->timestamps(); + $table->unsignedBigInteger('required_bitumen')->nullable(); + $table->unsignedBigInteger('used_bitumen')->nullable(); + $table->string('bridge_number', 50)->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('contract_subitems'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_contractors_table.php b/database/migrations/2024_03_05_133823_create_contractors_table.php new file mode 100644 index 00000000..df1f80c0 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_contractors_table.php @@ -0,0 +1,34 @@ +bigIncrements('id'); + $table->string('name', 50)->nullable(); + $table->bigInteger('province_id')->nullable(); + $table->timestamp('created_at')->useCurrentOnUpdate()->useCurrent(); + $table->timestamp('updated_at')->default('0000-00-00 00:00:00'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('contractors'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_contracts_table.php b/database/migrations/2024_03_05_133823_create_contracts_table.php new file mode 100644 index 00000000..5cf85dd1 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_contracts_table.php @@ -0,0 +1,70 @@ +bigIncrements('id'); + $table->unsignedTinyInteger('province_id')->index('province_foroign_key'); + $table->string('province_fa'); + $table->integer('office_id'); + $table->string('office_fa'); + $table->string('title'); + $table->integer('status_id'); + $table->string('status_fa'); + $table->string('contract_date'); + $table->string('contract_mojavez'); + $table->string('contract_mojavez_fa'); + $table->string('contract_mojavez_data_meli')->nullable(); + $table->string('contract_mojavez_data_setad')->nullable(); + $table->string('contract_tarh')->nullable(); + $table->boolean('national_credit_license')->nullable(); + $table->string('contract_credit_national')->nullable(); + $table->boolean('province_credit_license')->nullable(); + $table->string('contract_credit_province')->nullable(); + $table->boolean('headquarter_issued_license')->nullable(); + $table->binary('contract_credit_headquarter')->nullable(); + $table->boolean('province_issued_license')->nullable(); + $table->string('contract_credit'); + $table->string('contract_peymankar'); + $table->string('contract_moshaver_tarahi'); + $table->string('contract_moshaver_nezarat'); + $table->timestamps(); + $table->bigInteger('unique_id')->default(0); + $table->string('created_at_fa')->nullable(); + $table->string('contract_mojavez_array', 255)->nullable(); + $table->string('contract_mojavez_data_meli_array', 255)->nullable(); + $table->string('contract_mojavez_data_setad_array', 255)->nullable(); + $table->string('contract_credit_national_array', 255)->nullable(); + $table->string('contract_tarh_array', 255)->nullable(); + $table->string('contract_mojavez_fa_array', 255)->nullable(); + $table->integer('status_rel')->nullable()->default(1); + $table->string('credit_eblagh_meli')->nullable(); + $table->string('credit_takhsis_meli')->nullable(); + $table->unsignedInteger('user_id')->nullable()->index('user_foreign_key'); + $table->integer('is_new')->nullable()->default(0); + $table->string('contract_number', 20)->nullable(); + $table->text('documents')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('contracts'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_coridors_table.php b/database/migrations/2024_03_05_133823_create_coridors_table.php new file mode 100644 index 00000000..9481ef62 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_coridors_table.php @@ -0,0 +1,59 @@ +bigIncrements('id'); + $table->unsignedTinyInteger('province_id')->nullable()->index('coridors_province_id_foreign'); + $table->unsignedSmallInteger('city_id')->nullable()->index('coridors_city_id_foreign'); + $table->string('province_name')->nullable(); + $table->string('city_name')->nullable(); + $table->string('name')->nullable(); + $table->string('status')->nullable(); + $table->string('type')->nullable(); + $table->string('team_num')->nullable(); + $table->string('staff_num')->nullable(); + $table->string('phone')->nullable(); + $table->string('responsible_name')->nullable(); + $table->string('responsible_mobile')->nullable(); + $table->string('successor_name')->nullable(); + $table->string('successor_mobile')->nullable(); + $table->string('machines_light')->nullable(); + $table->string('machines_sheavy')->nullable(); + $table->string('machines_heavy')->nullable(); + $table->string('code')->nullable(); + $table->string('lat')->nullable(); + $table->string('lng')->nullable(); + $table->longText('machine_data')->nullable(); + $table->longText('team_data')->nullable(); + $table->string('start_lat')->nullable(); + $table->string('start_lng')->nullable(); + $table->string('end_lat')->nullable(); + $table->string('end_lng')->nullable(); + $table->string('color')->nullable(); + $table->mediumText('geometry')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('coridors'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_daily_accident_histories_table.php b/database/migrations/2024_03_05_133823_create_daily_accident_histories_table.php new file mode 100644 index 00000000..c9f2a6d3 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_daily_accident_histories_table.php @@ -0,0 +1,38 @@ +bigInteger('id', true); + $table->boolean('state')->nullable(); + $table->string('state_fa', 50)->nullable(); + $table->string('message', 300)->nullable(); + $table->integer('subject_id')->nullable(); + $table->integer('user_id')->nullable(); + $table->string('user_name', 100)->nullable(); + $table->dateTime('created_at')->nullable(); + $table->dateTime('updated_at')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('daily_accident_histories'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_daily_accident_settings_table.php b/database/migrations/2024_03_05_133823_create_daily_accident_settings_table.php new file mode 100644 index 00000000..724146a9 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_daily_accident_settings_table.php @@ -0,0 +1,35 @@ +integer('id', true); + $table->string('key', 70)->nullable(); + $table->string('name', 70)->nullable(); + $table->string('value', 100)->nullable(); + $table->string('type', 70)->nullable(); + $table->text('validation')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('daily_accident_settings'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_daily_accidents_table.php b/database/migrations/2024_03_05_133823_create_daily_accidents_table.php new file mode 100644 index 00000000..c1f4700b --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_daily_accidents_table.php @@ -0,0 +1,114 @@ +bigIncrements('id'); + $table->integer('province_id')->nullable(); + $table->string('province_fa')->nullable(); + $table->string('axis_name', 200)->nullable(); + $table->boolean('axis_type')->nullable(); + $table->string('axis_type_fa', 200)->nullable(); + $table->string('axis_start', 200)->nullable(); + $table->string('axis_end', 200)->nullable(); + $table->string('distance_axis_start', 20)->nullable(); + $table->string('local_name', 200)->nullable(); + $table->decimal('lat', 12, 10)->nullable(); + $table->decimal('lng', 12, 10)->nullable(); + $table->boolean('way_geometri')->nullable(); + $table->string('way_geometri_fa', 80)->nullable(); + $table->string('police_serial', 50)->nullable(); + $table->integer('avarage_speed')->nullable(); + $table->integer('legal_speed')->nullable(); + $table->dateTime('accident_date')->nullable(); + $table->time('accident_time')->nullable(); + $table->string('day_of_the_week', 50)->nullable(); + $table->boolean('direction')->nullable(); + $table->string('direction_fa', 60)->nullable(); + $table->integer('number_of_injured')->nullable(); + $table->integer('number_of_died')->nullable(); + $table->boolean('weather_condition')->nullable(); + $table->string('weather_condition_fa', 100)->nullable(); + $table->text('first_image')->nullable(); + $table->text('second_image')->nullable(); + $table->text('police_file')->nullable(); + $table->boolean('collision_type')->nullable(); + $table->string('collision_type_fa', 100)->nullable(); + $table->boolean('participants_heavy_vehicle')->nullable(); + $table->boolean('participants_light_vehicle')->nullable(); + $table->boolean('participants_bicycle')->nullable(); + $table->boolean('accident_type')->nullable(); + $table->string('accident_type_fa', 50)->nullable(); + $table->boolean('increase_damage_reasons_feqdan_jodakonnande_dar_miyane_rah')->nullable(); + $table->boolean('increase_damage_reasons_naqs_ya_adam_kefayat_hefaze_miyani')->nullable(); + $table->boolean('increase_damage_reasons_naqs_ya_adam_kefayat_narde_pol')->nullable(); + $table->boolean('increase_damage_reasons_naqs_ya_adam_kefayat')->nullable(); + $table->boolean('increase_damage_reasons_naqs_dar_naheye_enteqali')->nullable(); + $table->boolean('increase_damage_reasons_mane_solb_bedone_hefaz')->nullable(); + $table->boolean('increase_damage_reasons_sar_azad_hefaz')->nullable(); + $table->boolean('increase_damage_reasons_shirvani_tond_ya_partgah')->nullable(); + $table->boolean('accident_reason_dor_monaseb_dar_qus')->nullable(); + $table->boolean('accident_reason_saraziri_tond')->nullable(); + $table->boolean('accident_reason_nabod_dar_khat_sebqat_dar_sarbalaye')->nullable(); + $table->boolean('accident_reason_mantaqe_ba_rizesh_az_divar')->nullable(); + $table->boolean('accident_reason_mantaqe_ba_afzayesh_nagahani')->nullable(); + $table->boolean('accident_reason_kahesh_na_monaseb_tedad')->nullable(); + $table->boolean('accident_reason_mantaqe_ba_obor_heyvanat_ahli')->nullable(); + $table->boolean('accident_reason_mantaqe_ba_tadakhol_terafiki')->nullable(); + $table->boolean('accident_reason_arze_kam_savare_ro')->nullable(); + $table->boolean('accident_reason_mantaqe_meh_gir')->nullable(); + $table->boolean('accident_reason_adam_roshanaye_zarori_dar_noqte')->nullable(); + $table->boolean('accident_reason_tabdil_na_monaseb_noe_rah')->nullable(); + $table->boolean('accident_reason_oftadegi_dar_labe_asphalt')->nullable(); + $table->boolean('accident_reason_naqs_dar_ashkarsazi_navahi')->nullable(); + $table->boolean('accident_reason_mahal_na_monaseb_dastrasi')->nullable(); + $table->boolean('accident_reason_roye_na_monaseb')->nullable(); + $table->boolean('accident_reason_naqs_dar_ashkar_sazi_shrayet_khas')->nullable(); + $table->boolean('accident_reason_hendese_na_monaseb_vorodi_va_khoroji')->nullable(); + $table->boolean('accident_reason_adam_rayat_fasele_tooli')->nullable(); + $table->boolean('accident_reason_naqs_dar_alayem_ekhtari_va_entezami')->nullable(); + $table->boolean('accident_reason_qus_ofoqi_dar_saraziri_tond')->nullable(); + $table->boolean('accident_reason_adam_rayat_obor')->nullable(); + $table->boolean('accident_reason_naqs_dar_alayem_pish_agahi')->nullable(); + $table->boolean('accident_reason_qarar_gire_qus_ofoqi')->nullable(); + $table->boolean('accident_reason_adam_rayat_sebghat_mojaz')->nullable(); + $table->boolean('accident_reason_did_na_kafi')->nullable(); + $table->boolean('accident_reason_qus_tond_qaem')->nullable(); + $table->boolean('accident_reason_adam_rayat_sorat_mojaz')->nullable(); + $table->boolean('accident_reason_ebham_dar_masir')->nullable(); + $table->boolean('accident_reason_qus_tond_ofoghi')->nullable(); + $table->integer('state')->nullable()->default(2); + $table->string('state_fa', 50)->nullable()->default('در حال بررسی'); + $table->string('message', 300)->nullable(); + $table->dateTime('state_updated_at')->nullable(); + $table->bigInteger('checker_user_id')->nullable(); + $table->string('way_id', 255)->nullable(); + $table->dateTime('created_at')->nullable(); + $table->dateTime('updated_at')->nullable(); + $table->integer('excell')->nullable()->default(1); + $table->string('time_temp', 255)->nullable(); + $table->integer('develop')->nullable()->default(0); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('daily_accidents'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_damages_table.php b/database/migrations/2024_03_05_133823_create_damages_table.php new file mode 100644 index 00000000..786078cb --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_damages_table.php @@ -0,0 +1,34 @@ +increments('id'); + $table->string('title', 200)->nullable(); + $table->string('unit', 50)->nullable(); + $table->unsignedBigInteger('base_price')->nullable(); + $table->tinyInteger('status')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('damages'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_danger_point_accidents_table.php b/database/migrations/2024_03_05_133823_create_danger_point_accidents_table.php new file mode 100644 index 00000000..e7892be2 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_danger_point_accidents_table.php @@ -0,0 +1,43 @@ +bigIncrements('id'); + $table->unsignedBigInteger('point_id')->nullable()->index('danger_point_accidents_point_id_foreign'); + $table->unsignedInteger('user_id')->nullable()->index('danger_point_accidents_user_id_foreign'); + $table->string('serial_number')->nullable(); + $table->date('accident_date')->nullable(); + $table->string('accident_date_fa', 10)->nullable(); + $table->unsignedTinyInteger('day')->nullable(); + $table->string('time')->nullable(); + $table->unsignedTinyInteger('accident_direction')->nullable(); + $table->unsignedTinyInteger('collision_type')->nullable(); + $table->longText('accident_factors')->nullable(); + $table->unsignedTinyInteger('accident_type')->nullable(); + $table->longText('accident_result')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('danger_point_accidents'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_danger_point_histories_table.php b/database/migrations/2024_03_05_133823_create_danger_point_histories_table.php new file mode 100644 index 00000000..e8871b7f --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_danger_point_histories_table.php @@ -0,0 +1,62 @@ +bigIncrements('id'); + $table->unsignedBigInteger('point_id')->nullable()->index('danger_point_histories_point_id_foreign'); + $table->unsignedInteger('user_id')->nullable()->index('danger_point_histories_user_id_foreign'); + $table->string('previous_code')->nullable(); + $table->string('previous_axis_name')->nullable(); + $table->unsignedTinyInteger('previous_axis_type')->nullable(); + $table->string('previous_axis_start')->nullable(); + $table->string('previous_axis_end')->nullable(); + $table->string('previous_distance_axis_start')->nullable(); + $table->string('previous_local_name')->nullable(); + $table->string('previous_lat')->nullable(); + $table->string('previous_lng')->nullable(); + $table->boolean('previous_accident_251')->nullable(); + $table->string('previous_accident_251_code')->nullable(); + $table->string('previous_speed_limit')->nullable(); + $table->string('previous_speed_average')->nullable(); + $table->boolean('previous_accident_possibility')->nullable(); + $table->boolean('previous_road_guard')->nullable(); + $table->unsignedTinyInteger('previous_geometric_desc')->nullable(); + $table->string('previous_accident_cause')->nullable(); + $table->text('previous_accident_cause_suggest')->nullable(); + $table->string('previous_accident_severity')->nullable(); + $table->text('previous_accident_severity_suggest')->nullable(); + $table->text('previous_correction_plan_done')->nullable(); + $table->text('previous_correction_plan_doing')->nullable(); + $table->text('previous_correction_plan_doing_desc')->nullable(); + $table->text('previous_correction_plan_doing_suggest')->nullable(); + $table->string('previous_signature_file')->nullable(); + $table->string('previous_police_file')->nullable(); + $table->boolean('previous_status')->nullable(); + $table->text('previous_status_desc')->nullable(); + $table->text('new_files')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('danger_point_histories'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_danger_points_table.php b/database/migrations/2024_03_05_133823_create_danger_points_table.php new file mode 100644 index 00000000..94104910 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_danger_points_table.php @@ -0,0 +1,77 @@ +bigIncrements('id'); + $table->string('code')->nullable(); + $table->unsignedInteger('user_id')->nullable()->index('danger_points_user_id_foreign'); + $table->unsignedTinyInteger('province_id')->nullable()->index('danger_points_province_id_foreign'); + $table->string('province_fa')->nullable(); + $table->unsignedSmallInteger('city_id')->nullable()->index('danger_points_city_id_foreign'); + $table->string('city_fa')->nullable(); + $table->string('axis_name')->nullable(); + $table->unsignedTinyInteger('axis_type')->nullable(); + $table->string('axis_type_fa')->nullable(); + $table->string('axis_start')->nullable(); + $table->string('axis_end')->nullable(); + $table->string('distance_axis_start')->nullable(); + $table->string('local_name')->nullable(); + $table->string('lat')->nullable(); + $table->string('lng')->nullable(); + $table->boolean('accident_251')->default(false); + $table->string('accident_251_code')->nullable(); + $table->string('speed_limit')->nullable(); + $table->string('speed_average')->nullable(); + $table->boolean('accident_possibility')->nullable(); + $table->boolean('road_guard')->nullable(); + $table->unsignedTinyInteger('geometric_desc')->nullable(); + $table->string('geometric_desc_fa')->nullable(); + $table->string('accident_cause')->nullable(); + $table->text('accident_cause_suggest')->nullable(); + $table->string('accident_severity')->nullable(); + $table->text('accident_severity_suggest')->nullable(); + $table->text('correction_plan_done')->nullable(); + $table->text('correction_plan_doing')->nullable(); + $table->text('correction_plan_doing_desc')->nullable(); + $table->text('correction_plan_doing_suggest')->nullable(); + $table->string('signature_file')->nullable(); + $table->string('police_file')->nullable(); + $table->boolean('status')->default(false); + $table->text('status_desc')->nullable(); + $table->tinyInteger('accident_result_de')->nullable(); + $table->tinyInteger('accident_result_in')->nullable(); + $table->double('weighted_average', null, 0)->nullable(); + $table->double('accident_zi', null, 0)->nullable(); + $table->double('accident_p', null, 0)->nullable(); + $table->double('accident_avg_weighted_average', null, 0)->nullable(); + $table->double('standard_deviation', null, 0)->nullable(); + $table->double('accident_sigma', null, 0)->nullable(); + $table->double('accident_sigma_2', null, 0)->nullable(); + $table->timestamps(); + $table->string('n_axis_type_fa')->nullable(); + $table->string('n_geometric_desc_fa')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('danger_points'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_edarate_ostani_table.php b/database/migrations/2024_03_05_133823_create_edarate_ostani_table.php new file mode 100644 index 00000000..47cd7b69 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_edarate_ostani_table.php @@ -0,0 +1,33 @@ +bigIncrements('id'); + $table->string('name_fa'); + $table->timestamps(); + $table->text('items_for_confirm')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('edarate_ostani'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_edarate_shahri_be_city_table.php b/database/migrations/2024_03_05_133823_create_edarate_shahri_be_city_table.php new file mode 100644 index 00000000..df108845 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_edarate_shahri_be_city_table.php @@ -0,0 +1,34 @@ +bigIncrements('id'); + $table->unsignedBigInteger('edarate_shahri_id')->default(0); + $table->smallInteger('city_id')->nullable(); + $table->tinyInteger('is_primary')->nullable()->default(1); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('edarate_shahri_be_city'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_edarate_shahri_table.php b/database/migrations/2024_03_05_133823_create_edarate_shahri_table.php new file mode 100644 index 00000000..01d2e66e --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_edarate_shahri_table.php @@ -0,0 +1,33 @@ +bigIncrements('id'); + $table->string('name_fa'); + $table->unsignedTinyInteger('province_id'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('edarate_shahri'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_http_errors_list_table.php b/database/migrations/2024_03_05_133823_create_http_errors_list_table.php new file mode 100644 index 00000000..b5337e34 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_http_errors_list_table.php @@ -0,0 +1,35 @@ +bigIncrements('id'); + $table->string('status', 50)->nullable(); + $table->text('value')->nullable(); + $table->integer('serialized')->nullable(); + $table->dateTime('updated_at')->nullable(); + $table->dateTime('created_at')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('http_errors_list'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_info_items_table.php b/database/migrations/2024_03_05_133823_create_info_items_table.php new file mode 100644 index 00000000..e3994092 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_info_items_table.php @@ -0,0 +1,41 @@ +bigIncrements('id'); + $table->integer('item')->nullable()->index('item'); + $table->string('item_id')->nullable(); + $table->string('item_str')->nullable(); + $table->integer('sub_item')->nullable(); + $table->string('sub_item_id')->nullable(); + $table->string('sub_item_str')->nullable(); + $table->string('sub_item_unit')->nullable(); + $table->unsignedSmallInteger('needs_image')->nullable()->default(0); + $table->unsignedSmallInteger('needs_end_point')->nullable()->default(0); + $table->string('icon')->nullable(); + $table->string('type')->nullable()->default('item'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('info_items'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_lawmakers_correspondences_table.php b/database/migrations/2024_03_05_133823_create_lawmakers_correspondences_table.php new file mode 100644 index 00000000..76ecc8f4 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_lawmakers_correspondences_table.php @@ -0,0 +1,52 @@ +bigInteger('id', true); + $table->string('unique_code')->nullable(); + $table->integer('province_id')->nullable(); + $table->string('province_fa')->nullable(); + $table->integer('constituency_id')->nullable(); + $table->string('constituency_fa')->nullable(); + $table->string('lawmaker_name')->nullable(); + $table->text('project_name')->nullable(); + $table->integer('unit_id')->nullable(); + $table->string('unit_fa')->nullable(); + $table->double('amount', null, 0)->nullable(); + $table->double('total_credit', null, 0)->nullable(); + $table->double('national_credit', null, 0)->nullable(); + $table->double('province_credit', null, 0)->nullable(); + $table->double('licence_credit', null, 0)->nullable(); + $table->text('preaction_by_setad')->nullable(); + $table->text('action_by_province')->nullable(); + $table->text('needed_actions')->nullable(); + $table->text('last_action')->nullable(); + $table->integer('last_status_id')->nullable()->default(0); + $table->string('last_update_fa')->nullable(); + $table->timestamp('created_at')->useCurrentOnUpdate()->useCurrent(); + $table->timestamp('updated_at')->default('0000-00-00 00:00:00'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('lawmakers_correspondences'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_log_lists_table.php b/database/migrations/2024_03_05_133823_create_log_lists_table.php new file mode 100644 index 00000000..3034e730 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_log_lists_table.php @@ -0,0 +1,34 @@ +integer('id', true); + $table->string('description', 200)->nullable(); + $table->string('log_unique_code', 20)->nullable(); + $table->string('action_type', 20)->nullable(); + $table->integer('is_done')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('log_lists'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_model_has_permissions_table.php b/database/migrations/2024_03_05_133823_create_model_has_permissions_table.php new file mode 100644 index 00000000..d51c437e --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_model_has_permissions_table.php @@ -0,0 +1,35 @@ +unsignedBigInteger('permission_id'); + $table->string('model_type'); + $table->unsignedBigInteger('model_id'); + + $table->index(['model_id', 'model_type']); + $table->primary(['permission_id', 'model_id', 'model_type']); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('model_has_permissions'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_model_has_roles_table.php b/database/migrations/2024_03_05_133823_create_model_has_roles_table.php new file mode 100644 index 00000000..7588840d --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_model_has_roles_table.php @@ -0,0 +1,35 @@ +unsignedBigInteger('role_id'); + $table->string('model_type'); + $table->unsignedBigInteger('model_id'); + + $table->index(['model_id', 'model_type']); + $table->primary(['role_id', 'model_id', 'model_type']); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('model_has_roles'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_new_randd_table.php b/database/migrations/2024_03_05_133823_create_new_randd_table.php new file mode 100644 index 00000000..a9e9c9ac --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_new_randd_table.php @@ -0,0 +1,49 @@ +increments('id'); + $table->string('title', 500)->nullable(); + $table->string('province_id'); + $table->string('province_fa'); + $table->boolean('domain_id'); + $table->string('domain_fa'); + $table->string('project_amount'); + $table->boolean('credit_status'); + $table->string('rfp_file'); + $table->string('unique_code'); + $table->string('created_time_jalali'); + $table->string('fname_creator'); + $table->string('lname_creator'); + $table->string('phone_creator'); + $table->boolean('operation_status')->default(false); + $table->timestamps(); + $table->string('proj_credit_resourse', 20)->nullable(); + $table->string('unique_id', 255)->nullable(); + $table->tinyInteger('project_status')->nullable()->default(1); + $table->text('reject_description')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('new_randd'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_observed_items_table.php b/database/migrations/2024_03_05_133823_create_observed_items_table.php new file mode 100644 index 00000000..f09f0246 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_observed_items_table.php @@ -0,0 +1,47 @@ +bigIncrements('id'); + $table->unsignedBigInteger('road_patrol_id')->nullable()->index('observed_items_road_patrol_id_foreign'); + $table->unsignedTinyInteger('item_id')->nullable(); + $table->string('item_name')->nullable(); + $table->unsignedTinyInteger('sub_item_id')->nullable(); + $table->string('sub_item_name')->nullable(); + $table->string('local_name')->nullable(); + $table->text('description')->nullable(); + $table->unsignedSmallInteger('status')->nullable(); + $table->string('status_fa', 100)->nullable(); + $table->unsignedBigInteger('road_item_id')->nullable()->index('observed_items_road_item_id_foreign'); + $table->double('start_lat', null, 0); + $table->double('start_lon', null, 0); + $table->double('end_lat', null, 0)->nullable(); + $table->double('end_lon', null, 0)->nullable(); + $table->timestamps(); + $table->unsignedSmallInteger('priority')->nullable(); + $table->string('priority_fa', 100)->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('observed_items'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_otps_table.php b/database/migrations/2024_03_05_133823_create_otps_table.php new file mode 100644 index 00000000..929a063f --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_otps_table.php @@ -0,0 +1,36 @@ +bigIncrements('id'); + $table->string('phone_number'); + $table->integer('verification_code'); + $table->boolean('used')->default(false); + $table->string('ip'); + $table->dateTime('expired_at'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('otps'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_password_resets_table.php b/database/migrations/2024_03_05_133823_create_password_resets_table.php new file mode 100644 index 00000000..3aea021d --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_password_resets_table.php @@ -0,0 +1,37 @@ +bigIncrements('id'); + $table->string('username'); + $table->string('token'); + $table->string('code'); + $table->boolean('code_status')->nullable(); + $table->boolean('status')->default(false); + $table->timestamp('expired_at')->useCurrentOnUpdate()->useCurrent(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('password_resets'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_permissions_table.php b/database/migrations/2024_03_05_133823_create_permissions_table.php new file mode 100644 index 00000000..6f0c3963 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_permissions_table.php @@ -0,0 +1,41 @@ +bigIncrements('id'); + $table->string('name'); + $table->string('guard_name'); + $table->string('name_fa')->nullable(); + $table->text('description')->nullable(); + $table->timestamps(); + $table->text('back_end_implementation_document')->nullable(); + $table->text('fron_end_implementation_document')->nullable(); + $table->string('type', 100)->nullable(); + $table->string('type_fa', 119)->nullable(); + $table->boolean('need_province')->nullable(); + $table->boolean('need_edare_shahri')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('permissions'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_personal_access_tokens_table.php b/database/migrations/2024_03_05_133823_create_personal_access_tokens_table.php new file mode 100644 index 00000000..f7cddbdc --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_personal_access_tokens_table.php @@ -0,0 +1,40 @@ +bigIncrements('id'); + $table->string('tokenable_type'); + $table->unsignedBigInteger('tokenable_id'); + $table->string('name'); + $table->string('token', 64)->unique(); + $table->text('abilities')->nullable(); + $table->timestamp('last_used_at')->nullable(); + $table->timestamp('expires_at')->nullable(); + $table->timestamps(); + + $table->index(['tokenable_type', 'tokenable_id']); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('personal_access_tokens'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_point_files_table.php b/database/migrations/2024_03_05_133823_create_point_files_table.php new file mode 100644 index 00000000..d138c441 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_point_files_table.php @@ -0,0 +1,34 @@ +bigIncrements('id'); + $table->unsignedBigInteger('point_fileable_id'); + $table->string('point_fileable_type'); + $table->string('path'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('point_files'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_project_files_table.php b/database/migrations/2024_03_05_133823_create_project_files_table.php new file mode 100644 index 00000000..1e26ba01 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_project_files_table.php @@ -0,0 +1,37 @@ +bigIncrements('id'); + $table->unsignedBigInteger('project_fileable_id'); + $table->string('project_fileable_type'); + $table->string('path'); + $table->decimal('lat', 12, 10)->nullable(); + $table->decimal('lng', 12, 10)->nullable(); + $table->timestamps(); + $table->integer('is_new')->nullable()->default(0); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('project_files'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_proposal_histories_table.php b/database/migrations/2024_03_05_133823_create_proposal_histories_table.php new file mode 100644 index 00000000..ae049285 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_proposal_histories_table.php @@ -0,0 +1,75 @@ +bigIncrements('id'); + $table->string('project_title', 300)->nullable(); + $table->tinyInteger('project_type_id')->nullable(); + $table->string('project_type_fa', 100)->nullable(); + $table->tinyInteger('office_id')->nullable(); + $table->string('office_fa', 100)->nullable(); + $table->tinyInteger('province_id')->nullable(); + $table->string('province_fa', 100)->nullable(); + $table->integer('axis_type_id')->nullable(); + $table->string('axis_type_fa', 100)->nullable(); + $table->string('axis_name', 300)->nullable(); + $table->tinyInteger('followup_priority_project_id')->nullable(); + $table->string('followup_priority_project', 100)->nullable(); + $table->tinyInteger('priority_project')->nullable(); + $table->string('priority_project_fa', 100)->nullable(); + $table->tinyInteger('status_id')->nullable(); + $table->string('status_fa', 100)->nullable(); + $table->string('unique_code', 100); + $table->integer('operation_type_id1')->nullable(); + $table->string('operation_type_fa1', 255)->nullable(); + $table->string('operation_type_unit1', 255)->nullable(); + $table->string('operation_type_amount1', 255)->nullable(); + $table->integer('operation_type_id2')->nullable(); + $table->string('operation_type_fa2', 255)->nullable(); + $table->string('operation_type_unit2', 255)->nullable(); + $table->string('operation_type_amount2', 255)->nullable(); + $table->integer('operation_type_id3')->nullable(); + $table->string('operation_type_fa3', 255)->nullable(); + $table->string('operation_type_unit3', 255)->nullable(); + $table->string('operation_type_amount3', 255)->nullable(); + $table->integer('operation_type_id4')->nullable(); + $table->string('operation_type_fa4', 255)->nullable(); + $table->string('operation_type_unit4', 255)->nullable(); + $table->string('operation_type_amount4', 255)->nullable(); + $table->string('start_lat', 255)->nullable(); + $table->string('end_lat', 255)->nullable(); + $table->string('start_lng', 255)->nullable(); + $table->string('end_lng', 255)->nullable(); + $table->unsignedBigInteger('user_id')->nullable(); + $table->text('user_description')->nullable(); + $table->string('national_credit')->nullable(); + $table->string('province_credit')->nullable(); + $table->string('created_at_fa')->nullable(); + $table->string('updated_at_fa')->nullable(); + $table->timestamps(); + $table->unsignedBigInteger('proposal_id')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('proposal_histories'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_proposals_table.php b/database/migrations/2024_03_05_133823_create_proposals_table.php new file mode 100644 index 00000000..3a9987b2 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_proposals_table.php @@ -0,0 +1,79 @@ +bigIncrements('id'); + $table->string('project_title', 300)->nullable(); + $table->tinyInteger('project_type_id')->nullable(); + $table->string('project_type_fa', 100)->nullable(); + $table->tinyInteger('office_id')->nullable(); + $table->string('office_fa', 100)->nullable(); + $table->tinyInteger('province_id')->nullable(); + $table->string('province_fa', 100)->nullable(); + $table->integer('axis_type_id')->nullable(); + $table->string('axis_type_fa', 100)->nullable(); + $table->string('axis_name', 300)->nullable(); + $table->tinyInteger('followup_priority_project_id')->nullable(); + $table->string('followup_priority_project', 100)->nullable(); + $table->tinyInteger('priority_project')->nullable(); + $table->string('priority_project_fa', 100)->nullable(); + $table->tinyInteger('status_id')->nullable(); + $table->string('status_fa', 100)->nullable(); + $table->string('unique_code', 100); + $table->integer('operation_type_id1')->nullable(); + $table->string('operation_type_fa1', 255)->nullable(); + $table->string('operation_type_unit1', 255)->nullable(); + $table->string('operation_type_amount1', 255)->nullable(); + $table->integer('operation_type_id2')->nullable()->default(0); + $table->string('operation_type_fa2', 255)->nullable(); + $table->string('operation_type_unit2', 255)->nullable(); + $table->string('operation_type_amount2', 255)->nullable(); + $table->integer('operation_type_id3')->nullable(); + $table->string('operation_type_fa3', 255)->nullable(); + $table->string('operation_type_unit3', 255)->nullable(); + $table->string('operation_type_amount3', 255)->nullable(); + $table->integer('operation_type_id4')->nullable(); + $table->string('operation_type_fa4', 255)->nullable(); + $table->string('operation_type_unit4', 255)->nullable(); + $table->string('operation_type_amount4', 255)->nullable(); + $table->string('start_lat', 255)->nullable(); + $table->string('end_lat', 255)->nullable(); + $table->string('start_lng', 255)->nullable(); + $table->string('end_lng', 255)->nullable(); + $table->unsignedBigInteger('user_id')->nullable(); + $table->text('user_description')->nullable(); + $table->string('national_credit')->nullable(); + $table->string('province_credit')->nullable(); + $table->integer('follower_person')->nullable(); + $table->string('follower_person_fa', 255)->nullable(); + $table->text('document_image')->nullable(); + $table->text('document_technical')->nullable(); + $table->text('document_video')->nullable(); + $table->string('created_at_fa')->nullable(); + $table->string('updated_at_fa')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('proposals'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_provinces_table.php b/database/migrations/2024_03_05_133823_create_provinces_table.php new file mode 100644 index 00000000..0986870c --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_provinces_table.php @@ -0,0 +1,43 @@ +tinyIncrements('id'); + $table->string('name_fa'); + $table->string('name_en')->nullable(); + $table->unsignedTinyInteger('feature_id')->nullable(); + $table->decimal('center_lat', 12, 10)->nullable(); + $table->decimal('center_long', 12, 10)->nullable(); + $table->string('abrar_link')->nullable()->default('#'); + $table->string('abrar_process')->nullable(); + $table->string('abrar_feature')->nullable(); + $table->timestamps(); + $table->decimal('poster_lat', 12, 10)->nullable(); + $table->decimal('poster_long', 12, 10)->nullable(); + $table->string('account_id', 50)->nullable(); + $table->string('deposit_id', 50)->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('provinces'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_rahdari_point_histories_table.php b/database/migrations/2024_03_05_133823_create_rahdari_point_histories_table.php new file mode 100644 index 00000000..5c0cc82a --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_rahdari_point_histories_table.php @@ -0,0 +1,48 @@ +bigIncrements('id'); + $table->unsignedSmallInteger('point_id')->nullable()->index('rahdari_point_histories_point_id_foreign'); + $table->unsignedInteger('user_id')->nullable()->index('rahdari_point_histories_user_id_foreign'); + $table->string('previous_status')->nullable(); + $table->string('previous_type')->nullable(); + $table->string('previous_team_num')->nullable(); + $table->string('previous_staff_num')->nullable(); + $table->string('previous_phone')->nullable(); + $table->string('previous_responsible_name')->nullable(); + $table->string('previous_responsible_mobile')->nullable(); + $table->string('previous_successor_name')->nullable(); + $table->string('previous_successor_mobile')->nullable(); + $table->string('previous_machines_light')->nullable(); + $table->string('previous_machines_sheavy')->nullable(); + $table->string('previous_machines_heavy')->nullable(); + $table->string('previous_lat')->nullable(); + $table->string('previous_lng')->nullable(); + $table->text('new_files')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('rahdari_point_histories'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_rahdari_points_table.php b/database/migrations/2024_03_05_133823_create_rahdari_points_table.php new file mode 100644 index 00000000..fcc1baf3 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_rahdari_points_table.php @@ -0,0 +1,59 @@ +smallIncrements('id'); + $table->unsignedTinyInteger('province_id')->nullable()->index('rahdari_points_province_id_foreign'); + $table->unsignedSmallInteger('city_id')->nullable()->index('rahdari_points_city_id_foreign'); + $table->string('province_name')->nullable(); + $table->string('city_name')->nullable(); + $table->string('name')->nullable(); + $table->string('status')->nullable(); + $table->string('type')->nullable(); + $table->string('team_num')->nullable(); + $table->string('staff_num')->nullable(); + $table->string('phone')->nullable(); + $table->string('responsible_name')->nullable(); + $table->string('responsible_mobile')->nullable(); + $table->string('successor_name')->nullable(); + $table->string('successor_mobile')->nullable(); + $table->string('machines_light')->nullable(); + $table->string('machines_sheavy')->nullable(); + $table->string('machines_heavy')->nullable(); + $table->string('code')->nullable(); + $table->string('lat')->nullable(); + $table->string('lng')->nullable(); + $table->timestamps(); + $table->string('lat_from')->nullable(); + $table->string('lng_from')->nullable(); + $table->string('lat_to')->nullable(); + $table->string('lng_to')->nullable(); + $table->string('color')->nullable(); + $table->mediumText('geometry')->nullable(); + $table->string('type_fa')->nullable(); + $table->string('updated_at_fa')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('rahdari_points'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_rand_d_members_table.php b/database/migrations/2024_03_05_133823_create_rand_d_members_table.php new file mode 100644 index 00000000..41c8397b --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_rand_d_members_table.php @@ -0,0 +1,35 @@ +bigIncrements('id'); + $table->string('member_name'); + $table->string('member_url'); + $table->string('member_duty'); + $table->string('member_office'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('rand_d_members'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_randd_voting_paper_answers_table.php b/database/migrations/2024_03_05_133823_create_randd_voting_paper_answers_table.php new file mode 100644 index 00000000..28817b92 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_randd_voting_paper_answers_table.php @@ -0,0 +1,39 @@ +bigIncrements('id'); + $table->unsignedBigInteger('vote_id')->nullable()->index('randd_voting_paper_answers_vote_id_foreign'); + $table->bigInteger('score'); + $table->tinyInteger('score_type'); + $table->text('description')->nullable(); + $table->unsignedInteger('user_id')->nullable()->index('randd_voting_paper_answers_user_id_foreign'); + $table->bigInteger('q_id'); + $table->string('q_fa'); + $table->string('fullname')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('randd_voting_paper_answers'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_randd_votings_table.php b/database/migrations/2024_03_05_133823_create_randd_votings_table.php new file mode 100644 index 00000000..82de7f1b --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_randd_votings_table.php @@ -0,0 +1,35 @@ +bigIncrements('id'); + $table->unsignedInteger('project_id')->nullable()->index('randd_votings_project_id_foreign'); + $table->text('description')->nullable(); + $table->tinyInteger('status'); + $table->unsignedInteger('user_id')->nullable()->index('randd_votings_user_id_foreign'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('randd_votings'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_research_devs_table.php b/database/migrations/2024_03_05_133823_create_research_devs_table.php new file mode 100644 index 00000000..49324f56 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_research_devs_table.php @@ -0,0 +1,52 @@ +bigIncrements('id'); + $table->string('project_title', 500)->nullable(); + $table->string('province_id'); + $table->string('province_fa'); + $table->string('project_agent')->nullable(); + $table->string('final_report_one')->nullable(); + $table->string('final_report_three')->nullable(); + $table->string('final_report_four')->nullable(); + $table->string('final_report_two')->nullable(); + $table->boolean('project_status')->default(false); + $table->bigInteger('contract_amount')->nullable(); + $table->string('contract_date')->nullable(); + $table->string('contract_number')->nullable(); + $table->string('contract_term')->nullable(); + $table->string('domain_fa')->nullable(); + $table->boolean('contract_status')->nullable(); + $table->string('uuid'); + $table->timestamps(); + $table->string('expert_firstname'); + $table->string('expert_lastname'); + $table->string('expert_phone'); + $table->string('domain_id'); + $table->string('unique_id', 255)->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('research_devs'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_rms_reports_summary_table.php b/database/migrations/2024_03_05_133823_create_rms_reports_summary_table.php new file mode 100644 index 00000000..53866421 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_rms_reports_summary_table.php @@ -0,0 +1,33 @@ +bigIncrements('id'); + $table->string('report_name')->nullable(); + $table->longText('data')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('rms_reports_summary'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_road_items_projects_table.php b/database/migrations/2024_03_05_133823_create_road_items_projects_table.php new file mode 100644 index 00000000..a0dcfbb9 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_road_items_projects_table.php @@ -0,0 +1,70 @@ +bigIncrements('id'); + $table->unsignedInteger('user_id')->nullable()->index('road_items_projects_user_id_foreign'); + $table->decimal('start_lat', 12, 10)->index('start_lat'); + $table->decimal('start_lng', 12, 10)->index('start_lng'); + $table->decimal('end_lat', 12, 10)->nullable(); + $table->decimal('end_lng', 12, 10)->nullable(); + $table->string('project_distance')->nullable(); + $table->unsignedTinyInteger('item')->index('item'); + $table->string('item_fa')->nullable(); + $table->integer('sub_item')->nullable(); + $table->string('sub_item_fa')->nullable(); + $table->longText('sub_item_data')->nullable(); + $table->string('sub_items'); + $table->longText('sub_items_data')->nullable()->index('road_items_subss'); + $table->timestamps(); + $table->unsignedTinyInteger('province_id'); + $table->string('province_fa')->nullable(); + $table->bigInteger('city_id'); + $table->string('city_fa')->nullable(); + $table->boolean('is_new')->default(false)->index('road_items_projects_is_new_idx'); + $table->bigInteger('parent_id')->nullable()->default(0); + $table->bigInteger('start_way_id')->nullable(); + $table->bigInteger('end_way_id')->nullable(); + $table->string('unit_fa')->nullable(); + $table->string('user_name'); + $table->string('created_at_fa')->nullable(); + $table->integer('info_id')->nullable(); + $table->unsignedSmallInteger('status')->nullable()->index('temp'); + $table->string('status_fa', 100)->nullable(); + $table->integer('edarat_id')->nullable(); + $table->string('edarat_name', 100)->nullable(); + $table->string('edarat_type', 100)->nullable(); + $table->date('activity_date')->nullable(); + $table->time('activity_time')->nullable(); + $table->dateTime('activity_date_time')->nullable()->index('times'); + $table->integer('supervisor_id')->nullable(); + $table->string('supervisor_name')->nullable(); + $table->text('supervisor_description')->nullable(); + $table->timestamp('supervising_time')->nullable(); + + $table->index(['user_id', 'province_id'], 'province'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('road_items_projects'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_road_observation_histories_table.php b/database/migrations/2024_03_05_133823_create_road_observation_histories_table.php new file mode 100644 index 00000000..8d344711 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_road_observation_histories_table.php @@ -0,0 +1,35 @@ +unsignedBigInteger('id'); + $table->unsignedInteger('user_id')->nullable()->index('road_observation_histories_user_id_foreign'); + $table->string('action', 100)->nullable(); + $table->timestamps(); + $table->unsignedBigInteger('edarate_shahri_id')->nullable(); + $table->string('description', 255)->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('road_observation_histories'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_road_observed_histories_table.php b/database/migrations/2024_03_05_133823_create_road_observed_histories_table.php new file mode 100644 index 00000000..36c9e1f3 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_road_observed_histories_table.php @@ -0,0 +1,38 @@ +bigIncrements('id'); + $table->unsignedBigInteger('problem_id')->index('road_observed_histories_problem_id_foreign'); + $table->unsignedInteger('user_id')->nullable()->index('road_observed_histories_user_id_foreign'); + $table->boolean('previous_rms_status')->default(false); + $table->string('previous_rms_start_latlng')->nullable(); + $table->string('previous_rms_end_latlng')->nullable(); + $table->text('previous_rms_description')->nullable(); + $table->text('new_files')->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('road_observed_histories'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_road_observeds_table.php b/database/migrations/2024_03_05_133823_create_road_observeds_table.php new file mode 100644 index 00000000..6beea826 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_road_observeds_table.php @@ -0,0 +1,84 @@ +bigIncrements('id'); + $table->string('AutoID')->nullable(); + $table->string('Title')->nullable(); + $table->string('StartTime')->nullable(); + $table->string('EndTime')->nullable(); + $table->string('StartDate')->nullable(); + $table->string('EndDate')->nullable(); + $table->string('StartTime_DateTime')->nullable(); + $table->string('StartTime_DateTime_fa')->nullable(); + $table->string('EndTime_DateTime')->nullable(); + $table->string('fk_RegisteredEventMessage')->nullable(); + $table->string('fk_Country')->nullable(); + $table->string('ProvinceName')->nullable(); + $table->string('fk_Province')->nullable(); + $table->string('fk_Town')->nullable(); + $table->string('TownName')->nullable(); + $table->string('lat')->nullable(); + $table->string('lng')->nullable(); + $table->string('XLAM')->nullable(); + $table->string('YLAM')->nullable(); + $table->string('WeatherName')->nullable(); + $table->string('fk_Weather')->nullable(); + $table->string('EventTypeTitle')->nullable(); + $table->string('fk_EventType')->nullable(); + $table->string('FeatureTypeTitle')->nullable(); + $table->string('fk_FeatureType')->nullable(); + $table->text('Description')->nullable(); + $table->string('MobileForSendEventSms')->nullable(); + $table->unsignedTinyInteger('rms_province_id')->nullable()->index('road_observeds_rms_province_id_foreign'); + $table->unsignedSmallInteger('rms_city_id')->nullable()->index('road_observeds_rms_city_id_foreign'); + $table->boolean('rms_status')->default(false); + $table->string('rms_start_latlng')->nullable(); + $table->string('rms_end_latlng')->nullable(); + $table->text('rms_description')->nullable(); + $table->timestamps(); + $table->string('updated_at_fa')->nullable(); + $table->bigInteger('observed_way_id')->nullable(); + $table->bigInteger('handling_way_id')->nullable(); + $table->dateTime('rms_last_activity')->nullable(); + $table->string('rms_last_activity_fa', 100)->nullable(); + $table->string('image_before', 255)->nullable(); + $table->string('image_after', 255)->nullable(); + $table->unsignedBigInteger('edarate_shahri_id')->nullable()->index('road_observeds_edarate_shahri_foreign'); + $table->unsignedTinyInteger('province_id')->nullable()->index('road_observeds_province_id_foreign'); + $table->unsignedSmallInteger('city_id')->nullable()->index('road_observeds_fk'); + $table->string('province_fa')->nullable(); + $table->string('city_fa')->nullable(); + $table->string('refer_description', 255)->nullable(); + $table->string('restore_description', 255)->nullable(); + $table->unsignedSmallInteger('status')->nullable(); + $table->string('status_fa', 100)->nullable(); + $table->unsignedInteger('supervisor_id')->nullable(); + $table->text('supervisor_description')->nullable(); + $table->timestamp('supervising_time')->nullable(); + $table->string('supervisor_name')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('road_observeds'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_road_patrols_table.php b/database/migrations/2024_03_05_133823_create_road_patrols_table.php new file mode 100644 index 00000000..ceb816e6 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_road_patrols_table.php @@ -0,0 +1,58 @@ +bigIncrements('id'); + $table->double('start_lat', null, 0); + $table->double('start_lon', null, 0); + $table->double('end_lat', null, 0); + $table->double('end_lon', null, 0); + $table->string('officer_phone_number', 20)->nullable(); + $table->unsignedInteger('operator_id')->nullable()->index('road_patrols_operator_id_foreign'); + $table->string('operator_name')->nullable(); + $table->string('officer_plaque', 16)->nullable(); + $table->bigInteger('start_way_id')->nullable(); + $table->bigInteger('end_way_id')->nullable(); + $table->unsignedInteger('supervisor_id')->nullable()->index('road_patrols_supervisor_id_foreign'); + $table->string('supervisor_name')->nullable(); + $table->text('supervisor_description')->nullable(); + $table->timestamp('supervising_time')->nullable(); + $table->unsignedSmallInteger('status')->nullable(); + $table->string('status_fa', 100)->nullable(); + $table->double('distance', null, 0)->nullable(); + $table->timestamps(); + $table->unsignedTinyInteger('province_id')->nullable()->index('road_patrols_province_id_foreign'); + $table->string('province_fa')->nullable(); + $table->unsignedSmallInteger('city_id')->nullable()->index('road_patrols_city_id_foreign'); + $table->string('city_fa')->nullable(); + $table->unsignedBigInteger('edare_id')->nullable(); + $table->string('edare_name')->nullable(); + $table->timestamp('start_time')->default('0000-00-00 00:00:00'); + $table->timestamp('end_time')->default('0000-00-00 00:00:00'); + $table->string('officer_name')->nullable(); + $table->text('description')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('road_patrols'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_role_has_permissions_table.php b/database/migrations/2024_03_05_133823_create_role_has_permissions_table.php new file mode 100644 index 00000000..1e61eed1 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_role_has_permissions_table.php @@ -0,0 +1,33 @@ +unsignedBigInteger('permission_id'); + $table->unsignedBigInteger('role_id')->index('role_has_permissions_role_id_foreign'); + + $table->primary(['permission_id', 'role_id']); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('role_has_permissions'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_roles_table.php b/database/migrations/2024_03_05_133823_create_roles_table.php new file mode 100644 index 00000000..9c858b34 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_roles_table.php @@ -0,0 +1,36 @@ +bigIncrements('id'); + $table->string('name'); + $table->string('name_fa')->nullable(); + $table->string('guard_name'); + $table->string('description', 300)->nullable(); + $table->timestamps(); + $table->integer('for_report')->nullable()->default(0); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('roles'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_safety_and_privacy_table.php b/database/migrations/2024_03_05_133823_create_safety_and_privacy_table.php new file mode 100644 index 00000000..5aeabff8 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_safety_and_privacy_table.php @@ -0,0 +1,52 @@ +bigIncrements('id'); + $table->double('lat', null, 0); + $table->double('lon', null, 0); + $table->unsignedTinyInteger('province_id')->nullable()->index('safety_and_privacy_province_id_foreign'); + $table->string('province_fa')->nullable(); + $table->unsignedSmallInteger('city_id')->nullable()->index('safety_and_privacy_city_id_foreign'); + $table->string('city_fa')->nullable(); + $table->unsignedBigInteger('edare_shahri_id')->nullable(); + $table->string('edare_shahri_name')->nullable(); + $table->string('recognize_picture')->nullable(); + $table->dateTime('activity_date_time')->nullable(); + $table->text('judiciary_document'); + $table->dateTime('judiciary_document_upload_date'); + $table->string('action_picture'); + $table->dateTime('action_picture_document_upload_date')->nullable(); + $table->unsignedInteger('operator_id')->nullable()->index('safety_and_privacy_operator_id_foreign'); + $table->string('operator_name')->nullable(); + $table->bigInteger('way_id')->nullable(); + $table->boolean('step')->nullable()->default(false); + $table->string('step_fa')->nullable(); + $table->timestamps(); + $table->bigInteger('info_id')->nullable(); + $table->string('info_fa')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('safety_and_privacy'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_setad_provinces_table.php b/database/migrations/2024_03_05_133823_create_setad_provinces_table.php new file mode 100644 index 00000000..56f23107 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_setad_provinces_table.php @@ -0,0 +1,31 @@ +bigIncrements('id'); + $table->string('name_fa')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('setad_provinces'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_tarh_lists_table.php b/database/migrations/2024_03_05_133823_create_tarh_lists_table.php new file mode 100644 index 00000000..b3d94672 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_tarh_lists_table.php @@ -0,0 +1,33 @@ +increments('id'); + $table->string('tarh_number', 20)->nullable(); + $table->string('tarh_name', 200)->nullable(); + $table->string('old_number', 20)->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('tarh_lists'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_telescope_entries_table.php b/database/migrations/2024_03_05_133823_create_telescope_entries_table.php new file mode 100644 index 00000000..ce1095d4 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_telescope_entries_table.php @@ -0,0 +1,39 @@ +bigIncrements('sequence'); + $table->char('uuid', 36)->unique(); + $table->char('batch_id', 36)->index(); + $table->string('family_hash')->nullable()->index(); + $table->boolean('should_display_on_index')->default(true); + $table->string('type', 20); + $table->longText('content'); + $table->dateTime('created_at')->nullable()->index(); + + $table->index(['type', 'should_display_on_index']); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('telescope_entries'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_telescope_entries_tags_table.php b/database/migrations/2024_03_05_133823_create_telescope_entries_tags_table.php new file mode 100644 index 00000000..6c9b6134 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_telescope_entries_tags_table.php @@ -0,0 +1,33 @@ +char('entry_uuid', 36); + $table->string('tag')->index(); + + $table->primary(['entry_uuid', 'tag']); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('telescope_entries_tags'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_telescope_monitoring_table.php b/database/migrations/2024_03_05_133823_create_telescope_monitoring_table.php new file mode 100644 index 00000000..d9fb40a8 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_telescope_monitoring_table.php @@ -0,0 +1,30 @@ +string('tag')->primary(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('telescope_monitoring'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_units_table.php b/database/migrations/2024_03_05_133823_create_units_table.php new file mode 100644 index 00000000..746c6b98 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_units_table.php @@ -0,0 +1,31 @@ +bigIncrements('id'); + $table->string('unit_fa', 100)->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('units'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_user_activity_logs_table.php b/database/migrations/2024_03_05_133823_create_user_activity_logs_table.php new file mode 100644 index 00000000..4a0b14cc --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_user_activity_logs_table.php @@ -0,0 +1,55 @@ +bigIncrements('id'); + $table->unsignedInteger('user_id')->nullable()->index('user_activity_logs_user_id_foreign'); + $table->string('username', 100)->nullable(); + $table->string('user_name', 100)->nullable(); + $table->string('user_first_name', 100)->nullable(); + $table->string('user_last_name', 100)->nullable(); + $table->string('position', 100)->nullable(); + $table->string('mobile', 20)->nullable(); + $table->integer('province_id')->nullable(); + $table->string('province_fa', 100)->nullable(); + $table->integer('city_id')->nullable(); + $table->string('city_fa', 100)->nullable(); + $table->string('method', 20)->nullable(); + $table->string('agent', 200)->nullable(); + $table->string('ip', 30)->nullable(); + $table->text('url')->nullable(); + $table->text('query_parameter')->nullable(); + $table->string('log_unique_code', 100)->nullable(); + $table->string('description', 300); + $table->string('action_type', 100)->nullable(); + $table->text('model')->nullable(); + $table->timestamps(); + $table->integer('mm')->nullable()->storedAs('month(`created_at`)'); + $table->integer('yy')->nullable()->storedAs('year(`created_at`)'); + $table->integer('dd')->nullable()->storedAs('dayofmonth(`created_at`)'); + $table->integer('hh')->nullable()->storedAs('hour(`created_at`)'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('user_activity_logs'); + } +}; diff --git a/database/migrations/2024_03_05_133823_create_users_table.php b/database/migrations/2024_03_05_133823_create_users_table.php new file mode 100644 index 00000000..89fc3108 --- /dev/null +++ b/database/migrations/2024_03_05_133823_create_users_table.php @@ -0,0 +1,58 @@ +increments('id'); + $table->string('username')->unique(); + $table->string('password'); + $table->string('name')->nullable(); + $table->string('first_name', 100)->nullable(); + $table->string('last_name', 100)->nullable(); + $table->string('email')->nullable(); + $table->char('mobile', 11)->nullable(); + $table->string('position')->nullable(); + $table->string('major', 200)->nullable(); + $table->string('degree')->nullable(); + $table->unsignedTinyInteger('province_id')->nullable()->index('users_province_id_foreign'); + $table->string('province_fa')->nullable(); + $table->integer('setad_id')->nullable(); + $table->unsignedSmallInteger('city_id')->nullable()->index('users_city_id_foreign'); + $table->string('city_fa')->nullable(); + $table->string('photo')->nullable(); + $table->rememberToken(); + $table->boolean('confirmed')->default(false); + $table->boolean('enabled')->default(true); + $table->string('avatar')->nullable(); + $table->timestamps(); + $table->tinyInteger('checked')->nullable()->default(0); + $table->unsignedBigInteger('edarate_shahri_id')->nullable()->index('users_edarate_shahri_id_foreign'); + $table->string('edarate_shahri_name', 100)->nullable(); + $table->unsignedBigInteger('edarate_ostani_id')->nullable()->index('users_edarate_ostani_id_foreign'); + $table->string('edarate_ostani_name', 100)->nullable(); + $table->string('national_code', 10)->nullable(); + $table->dateTime('last_login')->nullable(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('users'); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to__abrar_plan_project_histories_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to__abrar_plan_project_histories_table.php new file mode 100644 index 00000000..592ea12f --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to__abrar_plan_project_histories_table.php @@ -0,0 +1,32 @@ +foreign(['user_id'], 'abrar_plan_project_histories_user_id_foreign')->references(['id'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('_abrar_plan_project_histories', function (Blueprint $table) { + $table->dropForeign('abrar_plan_project_histories_user_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to__abrar_plan_projects_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to__abrar_plan_projects_table.php new file mode 100644 index 00000000..9310c087 --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to__abrar_plan_projects_table.php @@ -0,0 +1,34 @@ +foreign(['city_id'], 'abrar_plan_projects_city_id_foreign')->references(['id'])->on('cities')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['province_id'], 'abrar_plan_projects_province_id_foreign')->references(['id'])->on('provinces')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('_abrar_plan_projects', function (Blueprint $table) { + $table->dropForeign('abrar_plan_projects_city_id_foreign'); + $table->dropForeign('abrar_plan_projects_province_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to__accident_251_points_histories_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to__accident_251_points_histories_table.php new file mode 100644 index 00000000..7dc6758e --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to__accident_251_points_histories_table.php @@ -0,0 +1,34 @@ +foreign(['point_id'], 'accident_251_points_histories_point_id_foreign')->references(['id'])->on('_accident_251_points')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['user_id'], 'accident_251_points_histories_user_id_foreign')->references(['id'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('_accident_251_points_histories', function (Blueprint $table) { + $table->dropForeign('accident_251_points_histories_point_id_foreign'); + $table->dropForeign('accident_251_points_histories_user_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to__accident_251_points_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to__accident_251_points_table.php new file mode 100644 index 00000000..8a583788 --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to__accident_251_points_table.php @@ -0,0 +1,36 @@ +foreign(['accident_point_id'], 'accident_251_points_accident_point_id_foreign')->references(['id'])->on('accident_points')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['city_id'], 'accident_251_points_city_id_foreign')->references(['id'])->on('cities')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['province_id'], 'accident_251_points_province_id_foreign')->references(['id'])->on('provinces')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('_accident_251_points', function (Blueprint $table) { + $table->dropForeign('accident_251_points_accident_point_id_foreign'); + $table->dropForeign('accident_251_points_city_id_foreign'); + $table->dropForeign('accident_251_points_province_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to__b_b_jaheshes_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to__b_b_jaheshes_table.php new file mode 100644 index 00000000..56c7d26b --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to__b_b_jaheshes_table.php @@ -0,0 +1,32 @@ +foreign(['province_id'], 'b_b_jaheshes_province_id_foreign')->references(['id'])->on('provinces')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('_b_b_jaheshes', function (Blueprint $table) { + $table->dropForeign('b_b_jaheshes_province_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to__b_b_openings_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to__b_b_openings_table.php new file mode 100644 index 00000000..a0d6c97e --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to__b_b_openings_table.php @@ -0,0 +1,32 @@ +foreign(['province_id'], 'b_b_openings_province_id_foreign')->references(['id'])->on('provinces')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('_b_b_openings', function (Blueprint $table) { + $table->dropForeign('b_b_openings_province_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to__jahesh_operation_histories_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to__jahesh_operation_histories_table.php new file mode 100644 index 00000000..dfaf8e86 --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to__jahesh_operation_histories_table.php @@ -0,0 +1,34 @@ +foreign(['jahesh_operation_id'], 'jahesh_operation_histories_jahesh_operation_id_foreign')->references(['id'])->on('_jahesh_operations')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['user_id'], 'jahesh_operation_histories_user_id_foreign')->references(['id'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('_jahesh_operation_histories', function (Blueprint $table) { + $table->dropForeign('jahesh_operation_histories_jahesh_operation_id_foreign'); + $table->dropForeign('jahesh_operation_histories_user_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to__jahesh_operations_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to__jahesh_operations_table.php new file mode 100644 index 00000000..fc212018 --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to__jahesh_operations_table.php @@ -0,0 +1,32 @@ +foreign(['province_id'], 'jahesh_operations_province_id_foreign')->references(['id'])->on('provinces')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('_jahesh_operations', function (Blueprint $table) { + $table->dropForeign('jahesh_operations_province_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to__rms_event_histories_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to__rms_event_histories_table.php new file mode 100644 index 00000000..3fc102e2 --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to__rms_event_histories_table.php @@ -0,0 +1,34 @@ +foreign(['rms_event_id'], 'rms_event_histories_rms_event_id_foreign')->references(['id'])->on('_rms_events')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['user_id'], 'rms_event_histories_user_id_foreign')->references(['id'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('_rms_event_histories', function (Blueprint $table) { + $table->dropForeign('rms_event_histories_rms_event_id_foreign'); + $table->dropForeign('rms_event_histories_user_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to__rms_events_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to__rms_events_table.php new file mode 100644 index 00000000..454a7c6c --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to__rms_events_table.php @@ -0,0 +1,32 @@ +foreign(['user_id'], 'rms_events_user_id_foreign')->references(['id'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('_rms_events', function (Blueprint $table) { + $table->dropForeign('rms_events_user_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_construction_projects_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_construction_projects_table.php new file mode 100644 index 00000000..63951ec4 --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_construction_projects_table.php @@ -0,0 +1,32 @@ +foreign(['user_id'], 'road_construction_projects_user_id_foreign')->references(['id'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('_road_construction_projects', function (Blueprint $table) { + $table->dropForeign('road_construction_projects_user_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_construction_rural_histories_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_construction_rural_histories_table.php new file mode 100644 index 00000000..3404d9cf --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_construction_rural_histories_table.php @@ -0,0 +1,34 @@ +foreign(['project_id'], 'road_construction_rural_histories_project_id_foreign')->references(['id'])->on('_road_construction_rurals')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['user_id'], 'road_construction_rural_histories_user_id_foreign')->references(['id'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('_road_construction_rural_histories', function (Blueprint $table) { + $table->dropForeign('road_construction_rural_histories_project_id_foreign'); + $table->dropForeign('road_construction_rural_histories_user_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_construction_rurals_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_construction_rurals_table.php new file mode 100644 index 00000000..a08019d0 --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_construction_rurals_table.php @@ -0,0 +1,34 @@ +foreign(['province_id'], 'road_construction_rurals_province_id_foreign')->references(['id'])->on('provinces')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['user_id'], 'road_construction_rurals_user_id_foreign')->references(['id'])->on('users')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('_road_construction_rurals', function (Blueprint $table) { + $table->dropForeign('road_construction_rurals_province_id_foreign'); + $table->dropForeign('road_construction_rurals_user_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_danger_prevention_histories_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_danger_prevention_histories_table.php new file mode 100644 index 00000000..b50445f6 --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_danger_prevention_histories_table.php @@ -0,0 +1,34 @@ +foreign(['project_id'], 'road_danger_prevention_histories_project_id_foreign')->references(['id'])->on('_road_danger_preventions')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['user_id'], 'road_danger_prevention_histories_user_id_foreign')->references(['id'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('_road_danger_prevention_histories', function (Blueprint $table) { + $table->dropForeign('road_danger_prevention_histories_project_id_foreign'); + $table->dropForeign('road_danger_prevention_histories_user_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_danger_preventions_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_danger_preventions_table.php new file mode 100644 index 00000000..d48be4ec --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_danger_preventions_table.php @@ -0,0 +1,34 @@ +foreign(['province_id'], 'road_danger_preventions_province_id_foreign')->references(['id'])->on('provinces')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['user_id'], 'road_danger_preventions_user_id_foreign')->references(['id'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('_road_danger_preventions', function (Blueprint $table) { + $table->dropForeign('road_danger_preventions_province_id_foreign'); + $table->dropForeign('road_danger_preventions_user_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_maintenance_project_histories_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_maintenance_project_histories_table.php new file mode 100644 index 00000000..e40d87e0 --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_maintenance_project_histories_table.php @@ -0,0 +1,34 @@ +foreign(['project_id'], 'road_maintenance_project_histories_project_id_foreign')->references(['id'])->on('_road_maintenance_projects')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['user_id'], 'road_maintenance_project_histories_user_id_foreign')->references(['id'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('_road_maintenance_project_histories', function (Blueprint $table) { + $table->dropForeign('road_maintenance_project_histories_project_id_foreign'); + $table->dropForeign('road_maintenance_project_histories_user_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_maintenance_projects_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_maintenance_projects_table.php new file mode 100644 index 00000000..aaa7bd68 --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_maintenance_projects_table.php @@ -0,0 +1,34 @@ +foreign(['province_id'], 'road_maintenance_projects_province_id_foreign')->references(['id'])->on('provinces')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['user_id'], 'road_maintenance_projects_user_id_foreign')->references(['id'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('_road_maintenance_projects', function (Blueprint $table) { + $table->dropForeign('road_maintenance_projects_province_id_foreign'); + $table->dropForeign('road_maintenance_projects_user_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_patrol_projects_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_patrol_projects_table.php new file mode 100644 index 00000000..ab34a359 --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_patrol_projects_table.php @@ -0,0 +1,32 @@ +foreign(['user_id'], 'road_patrol_projects_user_id_foreign')->references(['id'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('_road_patrol_projects', function (Blueprint $table) { + $table->dropForeign('road_patrol_projects_user_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_technical_building_histories_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_technical_building_histories_table.php new file mode 100644 index 00000000..01b281b1 --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_technical_building_histories_table.php @@ -0,0 +1,34 @@ +foreign(['project_id'], 'road_technical_building_histories_project_id_foreign')->references(['id'])->on('_road_technical_buildings')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['user_id'], 'road_technical_building_histories_user_id_foreign')->references(['id'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('_road_technical_building_histories', function (Blueprint $table) { + $table->dropForeign('road_technical_building_histories_project_id_foreign'); + $table->dropForeign('road_technical_building_histories_user_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_technical_buildings_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_technical_buildings_table.php new file mode 100644 index 00000000..dcce0671 --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_technical_buildings_table.php @@ -0,0 +1,34 @@ +foreign(['province_id'], 'road_technical_buildings_province_id_foreign')->references(['id'])->on('provinces')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['user_id'], 'road_technical_buildings_user_id_foreign')->references(['id'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('_road_technical_buildings', function (Blueprint $table) { + $table->dropForeign('road_technical_buildings_province_id_foreign'); + $table->dropForeign('road_technical_buildings_user_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_tollhouse_management_histories_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_tollhouse_management_histories_table.php new file mode 100644 index 00000000..a92b9626 --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_tollhouse_management_histories_table.php @@ -0,0 +1,34 @@ +foreign(['project_id'], 'road_tollhouse_management_histories_project_id_foreign')->references(['id'])->on('_road_tollhouse_managements')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['user_id'], 'road_tollhouse_management_histories_user_id_foreign')->references(['id'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('_road_tollhouse_management_histories', function (Blueprint $table) { + $table->dropForeign('road_tollhouse_management_histories_project_id_foreign'); + $table->dropForeign('road_tollhouse_management_histories_user_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_tollhouse_managements_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_tollhouse_managements_table.php new file mode 100644 index 00000000..da89ba6b --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_tollhouse_managements_table.php @@ -0,0 +1,34 @@ +foreign(['province_id'], 'road_tollhouse_managements_province_id_foreign')->references(['id'])->on('provinces')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['user_id'], 'road_tollhouse_managements_user_id_foreign')->references(['id'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('_road_tollhouse_managements', function (Blueprint $table) { + $table->dropForeign('road_tollhouse_managements_province_id_foreign'); + $table->dropForeign('road_tollhouse_managements_user_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_upgrade_safeties_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_upgrade_safeties_table.php new file mode 100644 index 00000000..a05e76d2 --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_upgrade_safeties_table.php @@ -0,0 +1,34 @@ +foreign(['province_id'], 'road_upgrade_safeties_province_id_foreign')->references(['id'])->on('provinces')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['user_id'], 'road_upgrade_safeties_user_id_foreign')->references(['id'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('_road_upgrade_safeties', function (Blueprint $table) { + $table->dropForeign('road_upgrade_safeties_province_id_foreign'); + $table->dropForeign('road_upgrade_safeties_user_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_upgrade_safety_histories_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_upgrade_safety_histories_table.php new file mode 100644 index 00000000..66b07304 --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to__road_upgrade_safety_histories_table.php @@ -0,0 +1,34 @@ +foreign(['project_id'], 'road_upgrade_safety_histories_project_id_foreign')->references(['id'])->on('_road_upgrade_safeties')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['user_id'], 'road_upgrade_safety_histories_user_id_foreign')->references(['id'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('_road_upgrade_safety_histories', function (Blueprint $table) { + $table->dropForeign('road_upgrade_safety_histories_project_id_foreign'); + $table->dropForeign('road_upgrade_safety_histories_user_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to_accident_damage_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to_accident_damage_table.php new file mode 100644 index 00000000..50d52bba --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to_accident_damage_table.php @@ -0,0 +1,34 @@ +foreign(['accident_id'], 'accident_damage_ibfk_1')->references(['id'])->on('accidents')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['damage_id'], 'accident_damage_ibfk_2')->references(['id'])->on('damages')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('accident_damage', function (Blueprint $table) { + $table->dropForeign('accident_damage_ibfk_1'); + $table->dropForeign('accident_damage_ibfk_2'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to_accident_point_histories_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to_accident_point_histories_table.php new file mode 100644 index 00000000..bf43c961 --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to_accident_point_histories_table.php @@ -0,0 +1,34 @@ +foreign(['point_id'])->references(['id'])->on('accident_points')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('accident_point_histories', function (Blueprint $table) { + $table->dropForeign('accident_point_histories_point_id_foreign'); + $table->dropForeign('accident_point_histories_user_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to_accident_points_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to_accident_points_table.php new file mode 100644 index 00000000..2b556b6d --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to_accident_points_table.php @@ -0,0 +1,34 @@ +foreign(['city_id'])->references(['id'])->on('cities')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['province_id'])->references(['id'])->on('provinces')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('accident_points', function (Blueprint $table) { + $table->dropForeign('accident_points_city_id_foreign'); + $table->dropForeign('accident_points_province_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to_camps_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to_camps_table.php new file mode 100644 index 00000000..40d30c38 --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to_camps_table.php @@ -0,0 +1,34 @@ +foreign(['province_id'])->references(['id'])->on('provinces')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('camps', function (Blueprint $table) { + $table->dropForeign('camps_province_id_foreign'); + $table->dropForeign('camps_user_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to_cities_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to_cities_table.php new file mode 100644 index 00000000..e39f4f7f --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to_cities_table.php @@ -0,0 +1,32 @@ +foreign(['province_id'])->references(['id'])->on('provinces')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('cities', function (Blueprint $table) { + $table->dropForeign('cities_province_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to_cmms_forms_histories_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to_cmms_forms_histories_table.php new file mode 100644 index 00000000..dc99bc15 --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to_cmms_forms_histories_table.php @@ -0,0 +1,32 @@ +foreign(['cmms_form_id'])->references(['id'])->on('cmms_forms')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('cmms_forms_histories', function (Blueprint $table) { + $table->dropForeign('cmms_forms_histories_cmms_form_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to_contract_sub_items_histories_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to_contract_sub_items_histories_table.php new file mode 100644 index 00000000..d49e143b --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to_contract_sub_items_histories_table.php @@ -0,0 +1,32 @@ +foreign(['subitem_id'])->references(['id'])->on('contract_subitems')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('contract_sub_items_histories', function (Blueprint $table) { + $table->dropForeign('contract_sub_items_histories_subitem_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to_contract_subitems_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to_contract_subitems_table.php new file mode 100644 index 00000000..009ce378 --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to_contract_subitems_table.php @@ -0,0 +1,32 @@ +foreign(['contract_id'], 'contract_foreign_key')->references(['id'])->on('contracts')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('contract_subitems', function (Blueprint $table) { + $table->dropForeign('contract_foreign_key'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to_contracts_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to_contracts_table.php new file mode 100644 index 00000000..c6053fbd --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to_contracts_table.php @@ -0,0 +1,34 @@ +foreign(['province_id'], 'province_foroign_key')->references(['id'])->on('provinces')->onUpdate('cascade')->onDelete('cascade'); + $table->foreign(['user_id'], 'user_foreign_key')->references(['id'])->on('users')->onUpdate('set null')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('contracts', function (Blueprint $table) { + $table->dropForeign('province_foroign_key'); + $table->dropForeign('user_foreign_key'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to_coridors_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to_coridors_table.php new file mode 100644 index 00000000..be245266 --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to_coridors_table.php @@ -0,0 +1,34 @@ +foreign(['city_id'])->references(['id'])->on('cities')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['province_id'])->references(['id'])->on('provinces')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('coridors', function (Blueprint $table) { + $table->dropForeign('coridors_city_id_foreign'); + $table->dropForeign('coridors_province_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to_danger_point_accidents_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to_danger_point_accidents_table.php new file mode 100644 index 00000000..be43ecc9 --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to_danger_point_accidents_table.php @@ -0,0 +1,34 @@ +foreign(['point_id'])->references(['id'])->on('danger_points')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('danger_point_accidents', function (Blueprint $table) { + $table->dropForeign('danger_point_accidents_point_id_foreign'); + $table->dropForeign('danger_point_accidents_user_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to_danger_point_histories_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to_danger_point_histories_table.php new file mode 100644 index 00000000..d0a77a54 --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to_danger_point_histories_table.php @@ -0,0 +1,34 @@ +foreign(['point_id'])->references(['id'])->on('danger_points')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('danger_point_histories', function (Blueprint $table) { + $table->dropForeign('danger_point_histories_point_id_foreign'); + $table->dropForeign('danger_point_histories_user_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to_danger_points_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to_danger_points_table.php new file mode 100644 index 00000000..31ceacad --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to_danger_points_table.php @@ -0,0 +1,36 @@ +foreign(['city_id'])->references(['id'])->on('cities')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['province_id'])->references(['id'])->on('provinces')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('danger_points', function (Blueprint $table) { + $table->dropForeign('danger_points_city_id_foreign'); + $table->dropForeign('danger_points_province_id_foreign'); + $table->dropForeign('danger_points_user_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to_model_has_permissions_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to_model_has_permissions_table.php new file mode 100644 index 00000000..802e1aca --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to_model_has_permissions_table.php @@ -0,0 +1,32 @@ +foreign(['permission_id'])->references(['id'])->on('permissions')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('model_has_permissions', function (Blueprint $table) { + $table->dropForeign('model_has_permissions_permission_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to_model_has_roles_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to_model_has_roles_table.php new file mode 100644 index 00000000..913f9fd6 --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to_model_has_roles_table.php @@ -0,0 +1,32 @@ +foreign(['role_id'])->references(['id'])->on('roles')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('model_has_roles', function (Blueprint $table) { + $table->dropForeign('model_has_roles_role_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to_observed_items_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to_observed_items_table.php new file mode 100644 index 00000000..afc86138 --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to_observed_items_table.php @@ -0,0 +1,34 @@ +foreign(['road_item_id'])->references(['id'])->on('road_items_projects')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['road_patrol_id'])->references(['id'])->on('road_patrols')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('observed_items', function (Blueprint $table) { + $table->dropForeign('observed_items_road_item_id_foreign'); + $table->dropForeign('observed_items_road_patrol_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to_rahdari_point_histories_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to_rahdari_point_histories_table.php new file mode 100644 index 00000000..b64c8b49 --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to_rahdari_point_histories_table.php @@ -0,0 +1,34 @@ +foreign(['point_id'])->references(['id'])->on('rahdari_points')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('rahdari_point_histories', function (Blueprint $table) { + $table->dropForeign('rahdari_point_histories_point_id_foreign'); + $table->dropForeign('rahdari_point_histories_user_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to_rahdari_points_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to_rahdari_points_table.php new file mode 100644 index 00000000..1f272400 --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to_rahdari_points_table.php @@ -0,0 +1,34 @@ +foreign(['city_id'])->references(['id'])->on('cities')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['province_id'])->references(['id'])->on('provinces')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('rahdari_points', function (Blueprint $table) { + $table->dropForeign('rahdari_points_city_id_foreign'); + $table->dropForeign('rahdari_points_province_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to_randd_voting_paper_answers_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to_randd_voting_paper_answers_table.php new file mode 100644 index 00000000..9c76d6ff --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to_randd_voting_paper_answers_table.php @@ -0,0 +1,34 @@ +foreign(['user_id'])->references(['id'])->on('users')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['vote_id'])->references(['id'])->on('randd_votings')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('randd_voting_paper_answers', function (Blueprint $table) { + $table->dropForeign('randd_voting_paper_answers_user_id_foreign'); + $table->dropForeign('randd_voting_paper_answers_vote_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to_randd_votings_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to_randd_votings_table.php new file mode 100644 index 00000000..43667dd1 --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to_randd_votings_table.php @@ -0,0 +1,34 @@ +foreign(['project_id'])->references(['id'])->on('new_randd')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['user_id'])->references(['id'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('randd_votings', function (Blueprint $table) { + $table->dropForeign('randd_votings_project_id_foreign'); + $table->dropForeign('randd_votings_user_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to_road_items_projects_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to_road_items_projects_table.php new file mode 100644 index 00000000..0943b035 --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to_road_items_projects_table.php @@ -0,0 +1,32 @@ +foreign(['user_id'])->references(['id'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('road_items_projects', function (Blueprint $table) { + $table->dropForeign('road_items_projects_user_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to_road_observation_histories_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to_road_observation_histories_table.php new file mode 100644 index 00000000..5b0915bd --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to_road_observation_histories_table.php @@ -0,0 +1,32 @@ +foreign(['user_id'])->references(['id'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('road_observation_histories', function (Blueprint $table) { + $table->dropForeign('road_observation_histories_user_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to_road_observed_histories_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to_road_observed_histories_table.php new file mode 100644 index 00000000..4a47e859 --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to_road_observed_histories_table.php @@ -0,0 +1,32 @@ +foreign(['user_id'])->references(['id'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('road_observed_histories', function (Blueprint $table) { + $table->dropForeign('road_observed_histories_user_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to_road_observeds_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to_road_observeds_table.php new file mode 100644 index 00000000..3a1967ac --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to_road_observeds_table.php @@ -0,0 +1,40 @@ +foreign(['edarate_shahri_id'], 'road_observeds_edarate_shahri_foreign')->references(['id'])->on('edarate_shahri')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['city_id'], 'road_observeds_FK')->references(['id'])->on('cities')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['province_id'])->references(['id'])->on('provinces')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['rms_city_id'])->references(['id'])->on('cities')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['rms_province_id'])->references(['id'])->on('provinces')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('road_observeds', function (Blueprint $table) { + $table->dropForeign('road_observeds_edarate_shahri_foreign'); + $table->dropForeign('road_observeds_FK'); + $table->dropForeign('road_observeds_province_id_foreign'); + $table->dropForeign('road_observeds_rms_city_id_foreign'); + $table->dropForeign('road_observeds_rms_province_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to_road_patrols_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to_road_patrols_table.php new file mode 100644 index 00000000..eeb5d83a --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to_road_patrols_table.php @@ -0,0 +1,38 @@ +foreign(['city_id'])->references(['id'])->on('cities')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['operator_id'])->references(['id'])->on('users')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['province_id'])->references(['id'])->on('provinces')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['supervisor_id'])->references(['id'])->on('users')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('road_patrols', function (Blueprint $table) { + $table->dropForeign('road_patrols_city_id_foreign'); + $table->dropForeign('road_patrols_operator_id_foreign'); + $table->dropForeign('road_patrols_province_id_foreign'); + $table->dropForeign('road_patrols_supervisor_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to_role_has_permissions_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to_role_has_permissions_table.php new file mode 100644 index 00000000..f3490fef --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to_role_has_permissions_table.php @@ -0,0 +1,32 @@ +foreign(['role_id'])->references(['id'])->on('roles')->onUpdate('cascade')->onDelete('no action'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('role_has_permissions', function (Blueprint $table) { + $table->dropForeign('role_has_permissions_role_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to_safety_and_privacy_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to_safety_and_privacy_table.php new file mode 100644 index 00000000..2af610e3 --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to_safety_and_privacy_table.php @@ -0,0 +1,36 @@ +foreign(['city_id'])->references(['id'])->on('cities')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['operator_id'])->references(['id'])->on('users')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['province_id'])->references(['id'])->on('provinces')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('safety_and_privacy', function (Blueprint $table) { + $table->dropForeign('safety_and_privacy_city_id_foreign'); + $table->dropForeign('safety_and_privacy_operator_id_foreign'); + $table->dropForeign('safety_and_privacy_province_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to_telescope_entries_tags_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to_telescope_entries_tags_table.php new file mode 100644 index 00000000..fedfff03 --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to_telescope_entries_tags_table.php @@ -0,0 +1,32 @@ +foreign(['entry_uuid'])->references(['uuid'])->on('telescope_entries')->onUpdate('no action')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('telescope_entries_tags', function (Blueprint $table) { + $table->dropForeign('telescope_entries_tags_entry_uuid_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to_user_activity_logs_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to_user_activity_logs_table.php new file mode 100644 index 00000000..83cf49a0 --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to_user_activity_logs_table.php @@ -0,0 +1,32 @@ +foreign(['user_id'])->references(['id'])->on('users')->onUpdate('cascade')->onDelete('cascade'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('user_activity_logs', function (Blueprint $table) { + $table->dropForeign('user_activity_logs_user_id_foreign'); + }); + } +}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to_users_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to_users_table.php new file mode 100644 index 00000000..6ef3c104 --- /dev/null +++ b/database/migrations/2024_03_05_133826_add_foreign_keys_to_users_table.php @@ -0,0 +1,38 @@ +foreign(['city_id'])->references(['id'])->on('cities')->onUpdate('no action')->onDelete('set null'); + $table->foreign(['edarate_ostani_id'])->references(['id'])->on('edarate_ostani')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['edarate_shahri_id'])->references(['id'])->on('edarate_shahri')->onUpdate('cascade')->onDelete('set null'); + $table->foreign(['province_id'])->references(['id'])->on('provinces')->onUpdate('cascade')->onDelete('set null'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('users', function (Blueprint $table) { + $table->dropForeign('users_city_id_foreign'); + $table->dropForeign('users_edarate_ostani_id_foreign'); + $table->dropForeign('users_edarate_shahri_id_foreign'); + $table->dropForeign('users_province_id_foreign'); + }); + } +}; diff --git a/tests/Feature/V2/Dashboard/SafetyAndPrivacy/operatorFirstStepStoreTest.php b/tests/Feature/V2/Dashboard/SafetyAndPrivacy/operatorFirstStepStoreTest.php new file mode 100644 index 00000000..32c2778f --- /dev/null +++ b/tests/Feature/V2/Dashboard/SafetyAndPrivacy/operatorFirstStepStoreTest.php @@ -0,0 +1,24 @@ +create(); + + $response = $this->post('v2/safety_and_privacy/operator/first_step'); + + $response->assertForbidden(); + } +} diff --git a/tests/Unit/ExampleTest.php b/tests/Unit/ExampleTest.php new file mode 100644 index 00000000..060063ba --- /dev/null +++ b/tests/Unit/ExampleTest.php @@ -0,0 +1,16 @@ +assertTrue(true); + } +} From c0d991cdc056f35096def46b31067a33061a418c Mon Sep 17 00:00:00 2001 From: amirghasempoor Date: Sat, 9 Mar 2024 13:59:02 +0330 Subject: [PATCH 09/10] write test for nominatim usage --- .env.testing | 65 ++++ app/Models/City.php | 2 + app/Models/EdarateOstani.php | 2 + app/Models/EdarateShahri.php | 2 + app/Models/InfoItem.php | 4 + app/Models/LogList.php | 5 +- app/Models/Permission.php | 12 + app/Models/UserActivityLog.php | 2 + database/factories/CityFactory.php | 23 ++ database/factories/EdarateOstaniFactory.php | 23 ++ database/factories/EdarateShahriFactory.php | 23 ++ database/factories/InfoItemFactory.php | 23 ++ database/factories/LogListFactory.php | 24 ++ database/factories/PermissionFactory.php | 23 ++ database/factories/UserActivityLogFactory.php | 23 ++ database/factories/UserFactory.php | 4 +- ...03_05_133823_create__geopoints_2_table.php | 4 +- ...4_03_05_133823_create__geopoints_table.php | 4 +- ...23_create_personal_access_tokens_table.php | 40 --- ...33823_create_road_items_projects_table.php | 2 +- ..._133823_create_telescope_entries_table.php | 39 --- ...23_create_telescope_entries_tags_table.php | 33 -- ...3823_create_telescope_monitoring_table.php | 30 -- ...n_keys_to_telescope_entries_tags_table.php | 32 -- phpunit.xml | 7 +- routes/v2.php | 1 + .../operatorFirstStepStoreTest.php | 282 +++++++++++++++++- 27 files changed, 550 insertions(+), 184 deletions(-) create mode 100644 .env.testing create mode 100644 app/Models/Permission.php create mode 100644 database/factories/CityFactory.php create mode 100644 database/factories/EdarateOstaniFactory.php create mode 100644 database/factories/EdarateShahriFactory.php create mode 100644 database/factories/InfoItemFactory.php create mode 100644 database/factories/LogListFactory.php create mode 100644 database/factories/PermissionFactory.php create mode 100644 database/factories/UserActivityLogFactory.php delete mode 100644 database/migrations/2024_03_05_133823_create_personal_access_tokens_table.php delete mode 100644 database/migrations/2024_03_05_133823_create_telescope_entries_table.php delete mode 100644 database/migrations/2024_03_05_133823_create_telescope_entries_tags_table.php delete mode 100644 database/migrations/2024_03_05_133823_create_telescope_monitoring_table.php delete mode 100644 database/migrations/2024_03_05_133826_add_foreign_keys_to_telescope_entries_tags_table.php diff --git a/.env.testing b/.env.testing new file mode 100644 index 00000000..9e25675d --- /dev/null +++ b/.env.testing @@ -0,0 +1,65 @@ +APP_NAME=Laravel +APP_ENV=local +APP_KEY=base64:R0FQ6mq9Ar2n5ToqeseUNN6zh94JGDnECsjF/pLOqaM= +APP_DEBUG=false +APP_URL=https://rms.witel.ir + +LOG_CHANNEL=stack + +DB_CONNECTION=mysql +DB_HOST=localhost +DB_PORT=3306 +DB_DATABASE=rms_db +DB_USERNAME=root +DB_PASSWORD=password + +DB_CONNECTION_2= +DB_HOST_2= +DB_PORT_2= +DB_DATABASE_2= +DB_USERNAME_2= +DB_PASSWORD_2= + +BROADCAST_DRIVER=log +CACHE_DRIVER=file +QUEUE_CONNECTION=sync +SESSION_DRIVER=file +SESSION_LIFETIME=120 + +REDIS_HOST=127.0.0.1 +REDIS_PASSWORD=null +REDIS_PORT=6379 + +MAIL_DRIVER=smtp +MAIL_HOST=smtp.mailtrap.io +MAIL_PORT=2525 +MAIL_USERNAME=null +MAIL_PASSWORD=null +MAIL_ENCRYPTION=null +MAIL_FROM_ADDRESS=null +MAIL_FROM_NAME="${APP_NAME}" + +AWS_ACCESS_KEY_ID= +AWS_SECRET_ACCESS_KEY= +AWS_DEFAULT_REGION=us-east-1 +AWS_BUCKET= + +PUSHER_APP_ID= +PUSHER_APP_KEY= +PUSHER_APP_SECRET= +PUSHER_APP_CLUSTER=mt1 + +MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" +MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" + + +PAYMENT_USERNAME="cspay" +PAYMENT_PASSWORD="cspay123" +PAYMENT_LINK="https://payment.rmto.ir" + +RMS_VERSION=3.0 +RMS_CTO_PHONE_NUMBER="09380220400" + +TELESCOPE_RESPONSE_SIZE_LIMIT=128 + +DEBUGBAR_ENABLED=false \ No newline at end of file diff --git a/app/Models/City.php b/app/Models/City.php index d6c6f89e..0aa06865 100644 --- a/app/Models/City.php +++ b/app/Models/City.php @@ -2,10 +2,12 @@ namespace App\Models; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class City extends Model { + use HasFactory; /** * The attributes that should be hidden for arrays. * diff --git a/app/Models/EdarateOstani.php b/app/Models/EdarateOstani.php index 1254eda3..c677a37f 100644 --- a/app/Models/EdarateOstani.php +++ b/app/Models/EdarateOstani.php @@ -2,10 +2,12 @@ namespace App\Models; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class EdarateOstani extends Model { + use HasFactory; protected $table = 'edarate_ostani'; public function roadObserved() diff --git a/app/Models/EdarateShahri.php b/app/Models/EdarateShahri.php index 2bc84ee3..2bb8d025 100644 --- a/app/Models/EdarateShahri.php +++ b/app/Models/EdarateShahri.php @@ -2,10 +2,12 @@ namespace App\Models; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class EdarateShahri extends Model { + use HasFactory; protected $table = 'edarate_shahri'; public function cities() diff --git a/app/Models/InfoItem.php b/app/Models/InfoItem.php index 0b71ea2e..b47fc192 100644 --- a/app/Models/InfoItem.php +++ b/app/Models/InfoItem.php @@ -2,10 +2,14 @@ namespace App\Models; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class InfoItem extends Model { + use HasFactory; + + public $timestamps = false; public function roadItemsProjects() { diff --git a/app/Models/LogList.php b/app/Models/LogList.php index f200410c..c7831a54 100644 --- a/app/Models/LogList.php +++ b/app/Models/LogList.php @@ -2,9 +2,12 @@ namespace App\Models; +use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class LogList extends Model { - // + use HasFactory; + + public $timestamps = false; } \ No newline at end of file diff --git a/app/Models/Permission.php b/app/Models/Permission.php new file mode 100644 index 00000000..e559c90d --- /dev/null +++ b/app/Models/Permission.php @@ -0,0 +1,12 @@ + + */ +class CityFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'name_fa' => $this->faker->name + ]; + } +} diff --git a/database/factories/EdarateOstaniFactory.php b/database/factories/EdarateOstaniFactory.php new file mode 100644 index 00000000..cb70e66c --- /dev/null +++ b/database/factories/EdarateOstaniFactory.php @@ -0,0 +1,23 @@ + + */ +class EdarateOstaniFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'name_fa' => $this->faker->name + ]; + } +} diff --git a/database/factories/EdarateShahriFactory.php b/database/factories/EdarateShahriFactory.php new file mode 100644 index 00000000..ff6f9ab2 --- /dev/null +++ b/database/factories/EdarateShahriFactory.php @@ -0,0 +1,23 @@ + + */ +class EdarateShahriFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'name_fa' => $this->faker->name + ]; + } +} diff --git a/database/factories/InfoItemFactory.php b/database/factories/InfoItemFactory.php new file mode 100644 index 00000000..23a901c1 --- /dev/null +++ b/database/factories/InfoItemFactory.php @@ -0,0 +1,23 @@ + + */ +class InfoItemFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'item' => $this->faker->randomNumber() + ]; + } +} diff --git a/database/factories/LogListFactory.php b/database/factories/LogListFactory.php new file mode 100644 index 00000000..e3a8ebe9 --- /dev/null +++ b/database/factories/LogListFactory.php @@ -0,0 +1,24 @@ + + */ +class LogListFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'description' => $this->faker->name, + 'log_unique_code' => 1134 + ]; + } +} diff --git a/database/factories/PermissionFactory.php b/database/factories/PermissionFactory.php new file mode 100644 index 00000000..f92e8630 --- /dev/null +++ b/database/factories/PermissionFactory.php @@ -0,0 +1,23 @@ + + */ +class PermissionFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'name' => $this->faker->name + ]; + } +} diff --git a/database/factories/UserActivityLogFactory.php b/database/factories/UserActivityLogFactory.php new file mode 100644 index 00000000..e993202b --- /dev/null +++ b/database/factories/UserActivityLogFactory.php @@ -0,0 +1,23 @@ + + */ +class UserActivityLogFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'description' => $this->faker->name + ]; + } +} diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index a335e139..f54ede76 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -17,7 +17,9 @@ class UserFactory extends Factory public function definition(): array { return [ - 'username' => $this->faker->name + 'username' => $this->faker->name, + 'enabled' => true, + 'confirmed' => 1 ]; } } diff --git a/database/migrations/2024_03_05_133823_create__geopoints_2_table.php b/database/migrations/2024_03_05_133823_create__geopoints_2_table.php index 388121dd..18177c12 100644 --- a/database/migrations/2024_03_05_133823_create__geopoints_2_table.php +++ b/database/migrations/2024_03_05_133823_create__geopoints_2_table.php @@ -16,8 +16,8 @@ return new class extends Migration Schema::create('_geopoints_2', function (Blueprint $table) { $table->integer('pid', true); $table->point('geopoint'); - - $table->spatialIndex(['geopoint'], 'geopoint'); +// +// $table->spatialIndex(['geopoint'], 'geopoint'); }); } diff --git a/database/migrations/2024_03_05_133823_create__geopoints_table.php b/database/migrations/2024_03_05_133823_create__geopoints_table.php index 97f7a65a..76c515f6 100644 --- a/database/migrations/2024_03_05_133823_create__geopoints_table.php +++ b/database/migrations/2024_03_05_133823_create__geopoints_table.php @@ -16,8 +16,8 @@ return new class extends Migration Schema::create('_geopoints', function (Blueprint $table) { $table->integer('pid', true); $table->point('geopoint'); - - $table->spatialIndex(['geopoint'], 'geopoint'); +// +// $table->spatialIndex(['geopoint'], 'geopoint'); }); } diff --git a/database/migrations/2024_03_05_133823_create_personal_access_tokens_table.php b/database/migrations/2024_03_05_133823_create_personal_access_tokens_table.php deleted file mode 100644 index f7cddbdc..00000000 --- a/database/migrations/2024_03_05_133823_create_personal_access_tokens_table.php +++ /dev/null @@ -1,40 +0,0 @@ -bigIncrements('id'); - $table->string('tokenable_type'); - $table->unsignedBigInteger('tokenable_id'); - $table->string('name'); - $table->string('token', 64)->unique(); - $table->text('abilities')->nullable(); - $table->timestamp('last_used_at')->nullable(); - $table->timestamp('expires_at')->nullable(); - $table->timestamps(); - - $table->index(['tokenable_type', 'tokenable_id']); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('personal_access_tokens'); - } -}; diff --git a/database/migrations/2024_03_05_133823_create_road_items_projects_table.php b/database/migrations/2024_03_05_133823_create_road_items_projects_table.php index a0dcfbb9..d3257d2d 100644 --- a/database/migrations/2024_03_05_133823_create_road_items_projects_table.php +++ b/database/migrations/2024_03_05_133823_create_road_items_projects_table.php @@ -27,7 +27,7 @@ return new class extends Migration $table->string('sub_item_fa')->nullable(); $table->longText('sub_item_data')->nullable(); $table->string('sub_items'); - $table->longText('sub_items_data')->nullable()->index('road_items_subss'); + $table->longText('sub_items_data')->nullable(); $table->timestamps(); $table->unsignedTinyInteger('province_id'); $table->string('province_fa')->nullable(); diff --git a/database/migrations/2024_03_05_133823_create_telescope_entries_table.php b/database/migrations/2024_03_05_133823_create_telescope_entries_table.php deleted file mode 100644 index ce1095d4..00000000 --- a/database/migrations/2024_03_05_133823_create_telescope_entries_table.php +++ /dev/null @@ -1,39 +0,0 @@ -bigIncrements('sequence'); - $table->char('uuid', 36)->unique(); - $table->char('batch_id', 36)->index(); - $table->string('family_hash')->nullable()->index(); - $table->boolean('should_display_on_index')->default(true); - $table->string('type', 20); - $table->longText('content'); - $table->dateTime('created_at')->nullable()->index(); - - $table->index(['type', 'should_display_on_index']); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('telescope_entries'); - } -}; diff --git a/database/migrations/2024_03_05_133823_create_telescope_entries_tags_table.php b/database/migrations/2024_03_05_133823_create_telescope_entries_tags_table.php deleted file mode 100644 index 6c9b6134..00000000 --- a/database/migrations/2024_03_05_133823_create_telescope_entries_tags_table.php +++ /dev/null @@ -1,33 +0,0 @@ -char('entry_uuid', 36); - $table->string('tag')->index(); - - $table->primary(['entry_uuid', 'tag']); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('telescope_entries_tags'); - } -}; diff --git a/database/migrations/2024_03_05_133823_create_telescope_monitoring_table.php b/database/migrations/2024_03_05_133823_create_telescope_monitoring_table.php deleted file mode 100644 index d9fb40a8..00000000 --- a/database/migrations/2024_03_05_133823_create_telescope_monitoring_table.php +++ /dev/null @@ -1,30 +0,0 @@ -string('tag')->primary(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('telescope_monitoring'); - } -}; diff --git a/database/migrations/2024_03_05_133826_add_foreign_keys_to_telescope_entries_tags_table.php b/database/migrations/2024_03_05_133826_add_foreign_keys_to_telescope_entries_tags_table.php deleted file mode 100644 index fedfff03..00000000 --- a/database/migrations/2024_03_05_133826_add_foreign_keys_to_telescope_entries_tags_table.php +++ /dev/null @@ -1,32 +0,0 @@ -foreign(['entry_uuid'])->references(['uuid'])->on('telescope_entries')->onUpdate('no action')->onDelete('cascade'); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('telescope_entries_tags', function (Blueprint $table) { - $table->dropForeign('telescope_entries_tags_entry_uuid_foreign'); - }); - } -}; diff --git a/phpunit.xml b/phpunit.xml index ff19ac12..27aac949 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -21,8 +21,11 @@ - - + + + + + diff --git a/routes/v2.php b/routes/v2.php index 4bdab8bb..f9320de7 100644 --- a/routes/v2.php +++ b/routes/v2.php @@ -341,6 +341,7 @@ Route::prefix('safety_and_privacy')->group(function () { /** TEST routes begin */ use Illuminate\Http\Request; +use Illuminate\Support\Facades\Route; if (App::environment('local')) { Route::get('otp', function (Request $request) { diff --git a/tests/Feature/V2/Dashboard/SafetyAndPrivacy/operatorFirstStepStoreTest.php b/tests/Feature/V2/Dashboard/SafetyAndPrivacy/operatorFirstStepStoreTest.php index 32c2778f..b6c94cd4 100644 --- a/tests/Feature/V2/Dashboard/SafetyAndPrivacy/operatorFirstStepStoreTest.php +++ b/tests/Feature/V2/Dashboard/SafetyAndPrivacy/operatorFirstStepStoreTest.php @@ -2,9 +2,17 @@ namespace Tests\Feature\V2\Dashboard\SafetyAndPrivacy; +use App\Models\City; +use App\Models\EdarateOstani; +use App\Models\EdarateShahri; +use App\Models\InfoItem; +use App\Models\LogList; +use App\Models\Permission; use App\Models\User; +use App\Models\UserActivityLog; use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Foundation\Testing\WithFaker; +use Illuminate\Http\UploadedFile; use Tests\TestCase; class operatorFirstStepStoreTest extends TestCase @@ -17,8 +25,280 @@ class operatorFirstStepStoreTest extends TestCase { $user = User::factory()->create(); - $response = $this->post('v2/safety_and_privacy/operator/first_step'); + $response = $this->actingAs($user)->postJson('v2/safety_and_privacy/operator/first_step'); $response->assertForbidden(); } + + public function test_user_should_not_have_city_id(): void + { + $edarateOstani = EdarateOstani::factory()->create(); + + $user = User::factory() + ->has(Permission::factory([ + 'name' => 'add-safety-and-privacy' + ])) + ->create([ + 'edarate_ostani_id' => $edarateOstani->id + ]); + + $response = $this->actingAs($user)->postJson('v2/safety_and_privacy/operator/first_step'); + + $response->assertStatus(400) + ->assertExactJson([ + 'message' => 'امکان ثبت این مورد برای ادارات استانی و ستادی وجود ندارد!' + ]); + } + + public function test_user_should_not_have_edarate_shahri_id(): void + { + $city = City::factory()->create(); + + $user = User::factory() + ->has(Permission::factory([ + 'name' => 'add-safety-and-privacy' + ])) + ->create([ + 'city_id' => $city->id + ]); + + $response = $this->actingAs($user)->postJson('v2/safety_and_privacy/operator/first_step'); + + $response->assertStatus(400) + ->assertExactJson([ + 'message' => 'اداره شهری برای شما در سامانه ثبت نشده است!' + ]); + } + + public function test_point_is_required(): void + { + $city = City::factory()->create(); + $edarateShari = EdarateShahri::factory()->create(); + + $user = User::factory() + ->has(Permission::factory([ + 'name' => 'add-safety-and-privacy' + ])) + ->create([ + 'city_id' => $city->id, + 'edarate_shahri_id' => $edarateShari->id + ]); + + $response = $this->actingAs($user)->postJson('v2/safety_and_privacy/operator/first_step'); + + $response->assertUnprocessable() + ->assertInvalid([ + 'point' => __('validation.required', ['attribute' => 'point']) + ]); + } + + public function test_info_id_is_required(): void + { + $city = City::factory()->create(); + $edarateShari = EdarateShahri::factory()->create(); + + $user = User::factory() + ->has(Permission::factory([ + 'name' => 'add-safety-and-privacy' + ])) + ->create([ + 'city_id' => $city->id, + 'edarate_shahri_id' => $edarateShari->id + ]); + + $response = $this->actingAs($user)->postJson('v2/safety_and_privacy/operator/first_step'); + + $response->assertUnprocessable() + ->assertInvalid([ + 'info_id' => __('validation.required', ['attribute' => 'info id']) + ]); + } + + public function test_activity_date_is_required(): void + { + $city = City::factory()->create(); + $edarateShari = EdarateShahri::factory()->create(); + + $user = User::factory() + ->has(Permission::factory([ + 'name' => 'add-safety-and-privacy' + ])) + ->create([ + 'city_id' => $city->id, + 'edarate_shahri_id' => $edarateShari->id + ]); + + $response = $this->actingAs($user)->postJson('v2/safety_and_privacy/operator/first_step'); + + $response->assertUnprocessable() + ->assertInvalid([ + 'activity_date' => __('validation.required', ['attribute' => 'تاریخ فعالیت']) + ]); + } + + public function test_activity_date_should_match_the_format(): void + { + $city = City::factory()->create(); + $edarateShari = EdarateShahri::factory()->create(); + + $user = User::factory() + ->has(Permission::factory([ + 'name' => 'add-safety-and-privacy' + ])) + ->create([ + 'city_id' => $city->id, + 'edarate_shahri_id' => $edarateShari->id + ]); + + $response = $this->actingAs($user)->postJson('v2/safety_and_privacy/operator/first_step', [ + 'activity_date' => $this->faker->date('d-m-Y-H-i-s') + ]); + + $response->assertUnprocessable() + ->assertInvalid([ + 'activity_date' => __('validation.date_format', ['attribute' => 'تاریخ فعالیت', 'format' => 'Y-m-d']) + ]); + } + + public function test_activity_time_is_required(): void + { + $city = City::factory()->create(); + $edarateShari = EdarateShahri::factory()->create(); + + $user = User::factory() + ->has(Permission::factory([ + 'name' => 'add-safety-and-privacy' + ])) + ->create([ + 'city_id' => $city->id, + 'edarate_shahri_id' => $edarateShari->id + ]); + + $response = $this->actingAs($user)->postJson('v2/safety_and_privacy/operator/first_step'); + + $response->assertUnprocessable() + ->assertInvalid([ + 'activity_time' => __('validation.required', ['attribute' => 'ساعت فعالیت']) + ]); + } + + public function test_activity_time_should_match_the_format(): void + { + $city = City::factory()->create(); + $edarateShari = EdarateShahri::factory()->create(); + + $user = User::factory() + ->has(Permission::factory([ + 'name' => 'add-safety-and-privacy' + ])) + ->create([ + 'city_id' => $city->id, + 'edarate_shahri_id' => $edarateShari->id + ]); + + $response = $this->actingAs($user)->postJson('v2/safety_and_privacy/operator/first_step', [ + 'activity_time' => $this->faker->date('d-m-Y-H-i-s') + ]); + + $response->assertUnprocessable() + ->assertInvalid([ + 'activity_time' => __('validation.date_format', ['attribute' => 'ساعت فعالیت', 'format' => 'H:i']) + ]); + } + + public function test_recognize_picture_is_required(): void + { + $city = City::factory()->create(); + $edarateShari = EdarateShahri::factory()->create(); + + $user = User::factory() + ->has(Permission::factory([ + 'name' => 'add-safety-and-privacy' + ])) + ->create([ + 'city_id' => $city->id, + 'edarate_shahri_id' => $edarateShari->id + ]); + + $response = $this->actingAs($user)->postJson('v2/safety_and_privacy/operator/first_step'); + + $response->assertUnprocessable() + ->assertInvalid([ + 'recognize_picture' => __('validation.required', ['attribute' => 'recognize picture']) + ]); + } + + public function test_recognize_picture_should_be_image(): void + { + $city = City::factory()->create(); + $edarateShari = EdarateShahri::factory()->create(); + + $user = User::factory() + ->has(Permission::factory([ + 'name' => 'add-safety-and-privacy' + ])) + ->create([ + 'city_id' => $city->id, + 'edarate_shahri_id' => $edarateShari->id + ]); + + $response = $this->actingAs($user)->postJson('v2/safety_and_privacy/operator/first_step', [ + 'recognize_picture' => $this->faker->name + ]); + + $response->assertUnprocessable() + ->assertInvalid([ + 'recognize_picture' => __('validation.image', ['attribute' => 'recognize picture']) + ]); + } + + public function test_new_safety_and_privacy_can_be_stored(): void + { + $this->withOutExceptionHandling(); + + $infoItem = InfoItem::factory()->create([ + 'item' => 17 + ]); + $city = City::factory()->create(); + $edarateShari = EdarateShahri::factory()->create(); + $logList = LogList::factory()->create(); + $userActivityLog = UserActivityLog::factory()->create(); + $image = UploadedFile::fake()->create('image.jpg', 10); + + $user = User::factory() + ->has(Permission::factory([ + 'name' => 'add-safety-and-privacy' + ])) + ->create([ + 'city_id' => $city->id, + 'edarate_shahri_id' => $edarateShari->id + ]); + + $data = [ + 'point' => '12,12', + 'info_id' => $infoItem->id, + 'activity_date' => $this->faker->date('Y-m-d'), + 'activity_time' => $this->faker->date('H:i'), + 'recognize_picture' => $image + ]; + + $response = $this->actingAs($user)->postJson('v2/safety_and_privacy/operator/first_step', $data); + + $response->assertOk(); + + $this->assertDatabaseHas('safety_and_privacy', [ + 'lat' => 12, + 'lon' => 12, + 'operator_id' => $user->id, + 'operator_name' => $user->name, + 'province_id' => $user->province_id, + 'province_fa' => $user->province_fa, + 'info_id' => $infoItem->id, + 'city_id' => $city->id, + 'city_fa' => $user->city_fa, + 'activity_date_time' => $data['activity_date']." ".$data['activity_time'], + 'edare_shahri_id' => $edarateShari->id, + 'edare_shahri_name' => $edarateShari->name, + ]); + } } From 6d6f5996b91f3fd768c54dd45cdf6cc6e95cda15 Mon Sep 17 00:00:00 2001 From: amirghasempoor Date: Sat, 9 Mar 2024 14:04:03 +0330 Subject: [PATCH 10/10] mock nominatim service --- .../SafetyAndPrivacy/operatorFirstStepStoreTest.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/Feature/V2/Dashboard/SafetyAndPrivacy/operatorFirstStepStoreTest.php b/tests/Feature/V2/Dashboard/SafetyAndPrivacy/operatorFirstStepStoreTest.php index b6c94cd4..d294831b 100644 --- a/tests/Feature/V2/Dashboard/SafetyAndPrivacy/operatorFirstStepStoreTest.php +++ b/tests/Feature/V2/Dashboard/SafetyAndPrivacy/operatorFirstStepStoreTest.php @@ -10,9 +10,11 @@ use App\Models\LogList; use App\Models\Permission; use App\Models\User; use App\Models\UserActivityLog; +use App\Services\NominatimService; use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Foundation\Testing\WithFaker; use Illuminate\Http\UploadedFile; +use Mockery\MockInterface; use Tests\TestCase; class operatorFirstStepStoreTest extends TestCase @@ -282,6 +284,12 @@ class operatorFirstStepStoreTest extends TestCase 'recognize_picture' => $image ]; + $mock = $this->mock(NominatimService::class, function (MockInterface $mock) { + $mock->shouldReceive('get_way_id_from_nominatim') + ->once() + ->andReturn(0); + }); + $response = $this->actingAs($user)->postJson('v2/safety_and_privacy/operator/first_step', $data); $response->assertOk(); @@ -299,6 +307,7 @@ class operatorFirstStepStoreTest extends TestCase 'activity_date_time' => $data['activity_date']." ".$data['activity_time'], 'edare_shahri_id' => $edarateShari->id, 'edare_shahri_name' => $edarateShari->name, + 'way_id' => 0 ]); } }