File: /var/www/limestate-admin/database/migrations/2024_04_12_160000_map_complex_external_id.php
<?php
use App\Models\ExternalServiceRelation;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
public function up(): void
{
$map = [
11 => 15977,
14 => 2145,
19 => 15557,
36 => 48737,
46 => 1944,
48 => 48220,
49 => 13507,
53 => 48182,
55 => 46511,
56 => 48385,
59 => 46076,
63 => 15100,
65 => 40325,
71 => 48503,
73 => 52595,
76 => 27329,
78 => 36527,
79 => 15534,
80 => 57026,
81 => 57054,
82 => 14915,
86 => 46325,
90 => 73130,
95 => 15334,
99 => 47526,
102 => 139991,
103 => 73314,
107 => 180828,
108 => 73070,
111 => 20500,
116 => 44686,
117 => 131651,
118 => 46766,
120 => 186341,
122 => 16157,
127 => 42872,
141 => 325111,
142 => 194050,
146 => 517146,
148 => 398408,
151 => 313337,
157 => 492438,
164 => 199545,
177 => 1634044,
188 => 39908,
];
foreach ($map as $complexId => $externalId) {
ExternalServiceRelation::createYandexRelation(ExternalServiceRelation::MODEL_COMPLEX, $complexId, $externalId);
}
}
public function down(): void
{
Schema::dropIfExists('external_service_relations');
}
};