fix: fix image url key in split JSON and cleanup image_url references#394
fix: fix image url key in split JSON and cleanup image_url references#394zigzagdev merged 4 commits intofeat/clean-up-codefrom
Conversation
There was a problem hiding this comment.
Pull request overview
Removes legacy image URL fields from world heritage data and schema, and aligns the JSON split output with the expected image import format.
Changes:
- Remove
image_urlfromWorldHeritageSeederseed data and a query-service test record builder. - Add a migration to drop
primary_image_urlfromworld_heritage_sites. - Fix
SplitWorldHeritageJsonto output the real image URL (instead of a SHA-256 hash) forworld_heritage_site_images.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/database/seeders/WorldHeritageSeeder.php |
Removes image_url field from seeded world_heritage_sites rows. |
src/database/migrations/2026_03_29_155722_drop_primary_image_url_from_world_heritage_sites.php |
Drops the primary_image_url column from world_heritage_sites. |
src/app/Packages/Domains/Test/QueryService/WorldHeritageQueryService_countEachRegionTest.php |
Updates test fixture to stop inserting image_url into world_heritage_sites. |
src/app/Console/Commands/SplitWorldHeritageJson.php |
Outputs actual image URLs in the generated world_heritage_site_images.json. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| public function down(): void | ||
| { | ||
| Schema::table('world_heritage_sites', function (Blueprint $table) { | ||
| $table->string('primary_image_url')->nullable()->after('short_description'); |
There was a problem hiding this comment.
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.
| $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(); | |
| } |
| public function up(): void | ||
| { | ||
| Schema::table('world_heritage_sites', function (Blueprint $table) { | ||
| $table->dropColumn('primary_image_url'); |
There was a problem hiding this comment.
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.
| $table->dropColumn('primary_image_url'); | |
| $table->dropColumn('primary_image_url'); |
What
Why