Skip to content

Commit 8fe1569

Browse files
authored
Merge pull request #394 from zigzagdev/fix/delete-redundant-code
fix: fix image url key in split JSON and cleanup image_url references
2 parents 85a9865 + 7fb4385 commit 8fe1569

File tree

4 files changed

+29
-11
lines changed

4 files changed

+29
-11
lines changed

src/app/Console/Commands/SplitWorldHeritageJson.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ public function handle(): int
282282
foreach ($imageUrls as $idx => $url) {
283283
$images[] = [
284284
'world_heritage_site_id' => $siteId,
285-
'url' => hash('sha256', $url),
285+
'url' => $url,
286286
'sort_order' => $idx,
287287
'is_primary' => ($idx === 0) ? 1 : 0,
288288
];

src/app/Packages/Domains/Test/QueryService/WorldHeritageQueryService_countEachRegionTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ private function baseRecord(array $override = []): array
6969
'latitude' => null,
7070
'longitude' => null,
7171
'short_description' => '',
72-
'image_url' => null,
7372
'unesco_site_url' => null,
7473
'created_at' => $now,
7574
'updated_at' => $now,
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*/
12+
public function up(): void
13+
{
14+
Schema::table('world_heritage_sites', function (Blueprint $table) {
15+
$table->dropColumn('primary_image_url');
16+
});
17+
}
18+
19+
/**
20+
* Reverse the migrations.
21+
*/
22+
public function down(): void
23+
{
24+
Schema::table('world_heritage_sites', function (Blueprint $table) {
25+
$table->string('primary_image_url')->nullable()->after('short_description');
26+
});
27+
}
28+
};

src/database/seeders/WorldHeritageSeeder.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ public function run(): void
3232
'latitude' => 34.8394,
3333
'longitude' => 134.6939,
3434
'short_description' => '白鷺城の名で知られる城郭建築の傑作。天守群と縄張りが良好に保存される。',
35-
'image_url' => null,
3635
'unesco_site_url' => 'https://whc.unesco.org/en/list/661',
3736
'created_at' => $now, 'updated_at' => $now,
3837
],
@@ -56,7 +55,6 @@ public function run(): void
5655
'latitude' => null,
5756
'longitude' => null,
5857
'short_description' => '巨樹・照葉樹林に代表される生態系と景観が特筆される島。',
59-
'image_url' => null,
6058
'unesco_site_url' => 'https://whc.unesco.org/en/list/662',
6159
'created_at' => $now, 'updated_at' => $now,
6260
],
@@ -80,7 +78,6 @@ public function run(): void
8078
'latitude' => null,
8179
'longitude' => null,
8280
'short_description' => '日本最大級のブナ天然林を中心とする山地生態系。',
83-
'image_url' => null,
8481
'unesco_site_url' => 'https://whc.unesco.org/en/list/663',
8582
'created_at' => $now, 'updated_at' => $now,
8683
],
@@ -104,7 +101,6 @@ public function run(): void
104101
'latitude' => 0.0,
105102
'longitude' => 0.0,
106103
'short_description' => '京都・宇治・大津に点在する社寺・庭園・城郭などから成る文化遺産群。',
107-
'image_url' => null,
108104
'unesco_site_url' => 'https://whc.unesco.org/en/list/688',
109105
'created_at' => $now, 'updated_at' => $now,
110106
],
@@ -128,7 +124,6 @@ public function run(): void
128124
'latitude' => 0.0,
129125
'longitude' => 0.0,
130126
'short_description' => '氷期後のブナの自然拡散史を示すヨーロッパ各地の原生的ブナ林群から成る越境・連続資産。',
131-
'image_url' => '',
132127
'unesco_site_url' => 'https://whc.unesco.org/en/list/1133',
133128
'created_at' => $now, 'updated_at' => $now,
134129
],
@@ -152,7 +147,6 @@ public function run(): void
152147
'latitude' => 0.0,
153148
'longitude' => 0.0,
154149
'short_description' => '熊野三山・高野山・吉野・大峯を結ぶ霊場と参詣道の文化的景観。',
155-
'image_url' => null,
156150
'unesco_site_url' => 'https://whc.unesco.org/en/list/1142',
157151
'created_at' => $now, 'updated_at' => $now,
158152
],
@@ -176,7 +170,6 @@ public function run(): void
176170
'latitude' => 0.0,
177171
'longitude' => 0.0,
178172
'short_description' => '日本の象徴たる霊峰。信仰・芸術・登拝文化に深い影響を与えた文化的景観。',
179-
'image_url' => null,
180173
'unesco_site_url' => 'https://whc.unesco.org/en/list/1418',
181174
'created_at' => $now, 'updated_at' => $now,
182175
],
@@ -200,7 +193,6 @@ public function run(): void
200193
'latitude' => 0.0,
201194
'longitude' => 0.0,
202195
'short_description' => '中国・カザフスタン・キルギスにまたがるオアシス都市や遺跡群で構成され、東西交流の歴史を物証する文化遺産群。',
203-
'image_url' => '',
204196
'unesco_site_url' => 'https://whc.unesco.org/en/list/1442',
205197
'created_at' => $now, 'updated_at' => $now,
206198
],
@@ -224,7 +216,6 @@ public function run(): void
224216
'latitude' => 0.0,
225217
'longitude' => 0.0,
226218
'short_description' => '中央アジアのザラフシャン谷からカラクム砂漠にかけて展開するオアシス都市・交易遺跡群の連続資産。',
227-
'image_url' => null,
228219
'unesco_site_url' => 'https://whc.unesco.org/en/list/1662',
229220
'created_at' => $now, 'updated_at' => $now,
230221
],

0 commit comments

Comments
 (0)