80 lines
3.4 KiB
PHP
80 lines
3.4 KiB
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use Illuminate\Database\Seeder;
|
|
use Illuminate\Support\Facades\DB;
|
|
use Modules\ProjectManagement\Models\ProjectClassification;
|
|
|
|
class ProjectClassificationSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Seed project classifications for construction projects.
|
|
*/
|
|
public function run(): void
|
|
{
|
|
$classifications = [
|
|
[
|
|
'code' => 'ROAD-HWY',
|
|
'name' => 'road highway, pavement, railways, airport horizontal structures and bridges',
|
|
'description' => 'Horizontal infrastructure including roads, highways, pavements, railways, airport runways/taxiways, and bridges.',
|
|
],
|
|
[
|
|
'code' => 'IRR-FLD',
|
|
'name' => 'irrigation and flood control',
|
|
'description' => 'Irrigation networks, canals, flood mitigation structures, drainage basins, and river dikes.',
|
|
],
|
|
[
|
|
'code' => 'DAM-RES',
|
|
'name' => 'dam, reservoir, and tunneling',
|
|
'description' => 'Dam structures, water reservoirs, underground tunneling, and heavy subterranean excavation.',
|
|
],
|
|
[
|
|
'code' => 'WAT-SUP',
|
|
'name' => 'water supply',
|
|
'description' => 'Potable water transmission pipelines, distribution networks, pumping stations, and overhead storage tanks.',
|
|
],
|
|
[
|
|
'code' => 'PORT-ENG',
|
|
'name' => 'port, harbor and offshore engineering',
|
|
'description' => 'Seaport piers, wharves, harbor jetties, breakwaters, coastal protection, and offshore marine structures.',
|
|
],
|
|
[
|
|
'code' => 'BLD-PLANT',
|
|
'name' => 'building and industrial plant',
|
|
'description' => 'Commercial, institutional, and high-rise residential buildings, manufacturing facilities, and heavy industrial plants.',
|
|
],
|
|
[
|
|
'code' => 'SEW-TREAT',
|
|
'name' => 'sewerage treatment/disposal plant',
|
|
'description' => 'Sewerage treatment plants, wastewater filtration facilities, and effluent disposal networks.',
|
|
],
|
|
[
|
|
'code' => 'WTR-TREAT',
|
|
'name' => 'water treatment plant and system',
|
|
'description' => 'Raw water purification facilities, chemical dosing systems, and municipal water treatment plants.',
|
|
],
|
|
[
|
|
'code' => 'REC-PARK',
|
|
'name' => 'park, playground and recreational work',
|
|
'description' => 'Public community parks, open-air recreational sports facilities, playgrounds, and landscape civil works.',
|
|
],
|
|
[
|
|
'code' => 'ELEC-WRK',
|
|
'name' => 'electrical work',
|
|
'description' => 'High/medium voltage substations, transmission power lines, industrial switchgear, and civil-electrical infrastructure.',
|
|
],
|
|
];
|
|
|
|
// Clear existing items and re-seed the exact defined enumeration
|
|
\Illuminate\Support\Facades\Schema::disableForeignKeyConstraints();
|
|
DB::table('project_classification_pivot')->delete();
|
|
DB::table('project_classifications')->delete();
|
|
\Illuminate\Support\Facades\Schema::enableForeignKeyConstraints();
|
|
|
|
foreach ($classifications as $item) {
|
|
ProjectClassification::create($item);
|
|
}
|
|
}
|
|
}
|