Skip to content

Feat/clean up code#395

Merged
zigzagdev merged 9 commits intochore/integrate-image_url-into-image-tablefrom
feat/clean-up-code
Mar 29, 2026
Merged

Feat/clean up code#395
zigzagdev merged 9 commits intochore/integrate-image_url-into-image-tablefrom
feat/clean-up-code

Conversation

@zigzagdev
Copy link
Copy Markdown
Owner

No description provided.

@zigzagdev zigzagdev changed the base branch from main to chore/integrate-image_url-into-image-table March 29, 2026 07:33
@zigzagdev zigzagdev self-assigned this Mar 29, 2026
@zigzagdev zigzagdev requested a review from Copilot March 29, 2026 07:33
@zigzagdev zigzagdev linked an issue Mar 29, 2026 that may be closed by this pull request
4 tasks
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 merged commit 7c42616 into chore/integrate-image_url-into-image-table Mar 29, 2026
27 checks passed
@zigzagdev zigzagdev deleted the feat/clean-up-code branch March 29, 2026 07:34
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

This PR removes the legacy image_url/primary_image_url columns from world_heritage_sites and updates read/indexing flows to use the world_heritage_site_images relationship as the source of thumbnail/primary image URLs.

Changes:

  • Drop image_url and primary_image_url columns via new migrations and remove related writes from seed/test/import code.
  • Update read/query paths (including Algolia import) to fetch primary images through the images relation.
  • Fix JSON split output to store the actual image URL (not a hash) for later import.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/database/seeders/WorldHeritageSeeder.php Removes image_url from seeded world_heritage_sites rows.
src/database/migrations/2026_03_29_151147_drop_image_url_from_world_heritage_sites.php Drops legacy image_url column (with rollback).
src/database/migrations/2026_03_29_155722_drop_primary_image_url_from_world_heritage_sites.php Drops legacy primary_image_url column (with rollback).
src/app/Packages/Domains/WorldHeritageReadQueryService.php Eager-loads primary image via images relation instead of selecting image_url.
src/app/Packages/Domains/Test/QueryService/WorldHeritageQueryService_countEachRegionTest.php Removes image_url from inserted test records.
src/app/Console/Commands/SplitWorldHeritageJson.php Outputs raw image URL into split images payload (instead of hashing).
src/app/Console/Commands/ImportWorldHeritageSiteFromSplitFile.php Stops importing image_url into world_heritage_sites.
src/app/Console/Commands/AlgoliaImportWorldHeritages.php Uses primary image from images relation for thumbnail_url.

💡 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.

down() re-adds primary_image_url as string() after short_description, but the column was originally created as text() (see 2025_12_31_163422_add_primary_image_url_to_world_heritage_table.php). Rolling back this migration would therefore not restore the original schema and could truncate longer URLs. Consider restoring it as text()->nullable() and (optionally) placing it after image_url when that column exists (fallback to no after() or after('short_description') when it doesn’t).

Suggested change
$table->string('primary_image_url')->nullable()->after('short_description');
$table->text('primary_image_url')->nullable()->after('short_description');

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cleanup / backfill (optional, only if you already have legacy data)

2 participants