Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app/Console/Commands/SplitWorldHeritageJson.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ public function handle(): int
foreach ($imageUrls as $idx => $url) {
$images[] = [
'world_heritage_site_id' => $siteId,
'url' => hash('sha256', $url),
'url' => $url,
'sort_order' => $idx,
'is_primary' => ($idx === 0) ? 1 : 0,
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ private function baseRecord(array $override = []): array
'latitude' => null,
'longitude' => null,
'short_description' => '',
'image_url' => null,
'unesco_site_url' => null,
'created_at' => $now,
'updated_at' => $now,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('world_heritage_sites', function (Blueprint $table) {
$table->dropColumn('primary_image_url');
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: the dropColumn line is over-indented relative to the surrounding block, making the migration harder to scan. Please align indentation within the Schema::table callback.

Suggested change
$table->dropColumn('primary_image_url');
$table->dropColumn('primary_image_url');

Copilot uses AI. Check for mistakes.
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('world_heritage_sites', function (Blueprint $table) {
$table->string('primary_image_url')->nullable()->after('short_description');
Copy link

Copilot AI Mar 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The down() migration re-creates primary_image_url as string after short_description, but the column was originally introduced as text (and positioned after image_url). Re-adding it as string can truncate long URLs and makes rollbacks produce a different schema than before; consider restoring it as text, and if column ordering matters, handle placement based on whether image_url exists.

Suggested change
$table->string('primary_image_url')->nullable()->after('short_description');
if (Schema::hasColumn('world_heritage_sites', 'image_url')) {
$table->text('primary_image_url')->nullable()->after('image_url');
} else {
$table->text('primary_image_url')->nullable();
}

Copilot uses AI. Check for mistakes.
});
}
};
9 changes: 0 additions & 9 deletions src/database/seeders/WorldHeritageSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ public function run(): void
'latitude' => 34.8394,
'longitude' => 134.6939,
'short_description' => '白鷺城の名で知られる城郭建築の傑作。天守群と縄張りが良好に保存される。',
'image_url' => null,
'unesco_site_url' => 'https://whc.unesco.org/en/list/661',
'created_at' => $now, 'updated_at' => $now,
],
Expand All @@ -56,7 +55,6 @@ public function run(): void
'latitude' => null,
'longitude' => null,
'short_description' => '巨樹・照葉樹林に代表される生態系と景観が特筆される島。',
'image_url' => null,
'unesco_site_url' => 'https://whc.unesco.org/en/list/662',
'created_at' => $now, 'updated_at' => $now,
],
Expand All @@ -80,7 +78,6 @@ public function run(): void
'latitude' => null,
'longitude' => null,
'short_description' => '日本最大級のブナ天然林を中心とする山地生態系。',
'image_url' => null,
'unesco_site_url' => 'https://whc.unesco.org/en/list/663',
'created_at' => $now, 'updated_at' => $now,
],
Expand All @@ -104,7 +101,6 @@ public function run(): void
'latitude' => 0.0,
'longitude' => 0.0,
'short_description' => '京都・宇治・大津に点在する社寺・庭園・城郭などから成る文化遺産群。',
'image_url' => null,
'unesco_site_url' => 'https://whc.unesco.org/en/list/688',
'created_at' => $now, 'updated_at' => $now,
],
Expand All @@ -128,7 +124,6 @@ public function run(): void
'latitude' => 0.0,
'longitude' => 0.0,
'short_description' => '氷期後のブナの自然拡散史を示すヨーロッパ各地の原生的ブナ林群から成る越境・連続資産。',
'image_url' => '',
'unesco_site_url' => 'https://whc.unesco.org/en/list/1133',
'created_at' => $now, 'updated_at' => $now,
],
Expand All @@ -152,7 +147,6 @@ public function run(): void
'latitude' => 0.0,
'longitude' => 0.0,
'short_description' => '熊野三山・高野山・吉野・大峯を結ぶ霊場と参詣道の文化的景観。',
'image_url' => null,
'unesco_site_url' => 'https://whc.unesco.org/en/list/1142',
'created_at' => $now, 'updated_at' => $now,
],
Expand All @@ -176,7 +170,6 @@ public function run(): void
'latitude' => 0.0,
'longitude' => 0.0,
'short_description' => '日本の象徴たる霊峰。信仰・芸術・登拝文化に深い影響を与えた文化的景観。',
'image_url' => null,
'unesco_site_url' => 'https://whc.unesco.org/en/list/1418',
'created_at' => $now, 'updated_at' => $now,
],
Expand All @@ -200,7 +193,6 @@ public function run(): void
'latitude' => 0.0,
'longitude' => 0.0,
'short_description' => '中国・カザフスタン・キルギスにまたがるオアシス都市や遺跡群で構成され、東西交流の歴史を物証する文化遺産群。',
'image_url' => '',
'unesco_site_url' => 'https://whc.unesco.org/en/list/1442',
'created_at' => $now, 'updated_at' => $now,
],
Expand All @@ -224,7 +216,6 @@ public function run(): void
'latitude' => 0.0,
'longitude' => 0.0,
'short_description' => '中央アジアのザラフシャン谷からカラクム砂漠にかけて展開するオアシス都市・交易遺跡群の連続資産。',
'image_url' => null,
'unesco_site_url' => 'https://whc.unesco.org/en/list/1662',
'created_at' => $now, 'updated_at' => $now,
],
Expand Down
Loading