Skip to content

fix: fix image url key in split JSON and cleanup image_url references#394

Merged
zigzagdev merged 4 commits intofeat/clean-up-codefrom
fix/delete-redundant-code
Mar 29, 2026
Merged

fix: fix image url key in split JSON and cleanup image_url references#394
zigzagdev merged 4 commits intofeat/clean-up-codefrom
fix/delete-redundant-code

Conversation

@zigzagdev
Copy link
Copy Markdown
Owner

@zigzagdev zigzagdev commented Mar 29, 2026

What

  • SplitWorldHeritageJson: fix url key name (was incorrectly set to url_hash)
  • WorldHeritageQueryService_countEachRegionTest: remove image_url from test data
  • WorldHeritageSeeder: remove image_url from seeder data
  • Add migration to drop primary_image_url column from world_heritage_sites

Why

@github-actions github-actions bot added bug Something isn't working backend labels Mar 29, 2026
Copy link
Copy Markdown
Owner Author

@zigzagdev zigzagdev left a comment

Choose a reason for hiding this comment

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

Ok

@zigzagdev zigzagdev requested a review from Copilot March 29, 2026 07:30
@zigzagdev zigzagdev changed the title Fix/delete redundant code fix: fix image url key in split JSON and cleanup image_url references Mar 29, 2026
@zigzagdev zigzagdev self-assigned this Mar 29, 2026
@zigzagdev zigzagdev linked an issue Mar 29, 2026 that may be closed by this pull request
@zigzagdev zigzagdev merged commit 8fe1569 into feat/clean-up-code Mar 29, 2026
27 checks passed
@zigzagdev zigzagdev deleted the fix/delete-redundant-code branch March 29, 2026 07:31
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_url from WorldHeritageSeeder seed data and a query-service test record builder.
  • Add a migration to drop primary_image_url from world_heritage_sites.
  • Fix SplitWorldHeritageJson to output the real image URL (instead of a SHA-256 hash) for world_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');
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.
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: remove image_url references from test files

2 participants