Skip to content

Create new migration files & Eloquent#67

Merged
zigzagdev merged 2 commits intofeature/balkansfrom
feature/eloquent-fix
Aug 20, 2025
Merged

Create new migration files & Eloquent#67
zigzagdev merged 2 commits intofeature/balkansfrom
feature/eloquent-fix

Conversation

@zigzagdev
Copy link
Copy Markdown
Owner

what I have done

  • renew my docker-compose.yml
  • create country migration file & eloquent model for making world heritage which spans multiple countries.

@zigzagdev zigzagdev self-assigned this Aug 20, 2025
@zigzagdev zigzagdev requested a review from Copilot August 20, 2025 12:28
@zigzagdev zigzagdev linked an issue Aug 20, 2025 that may be closed by this pull request
@zigzagdev zigzagdev merged commit b6b6ee6 into feature/balkans Aug 20, 2025
@zigzagdev zigzagdev deleted the feature/eloquent-fix branch August 20, 2025 12:28
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 establishes database support for world heritage sites that span multiple countries by creating new migration files and Eloquent models. It also simplifies the Docker Compose configuration by removing unnecessary services and streamlining the formatting.

  • Creates a countries table and a many-to-many relationship table (site_state_parties) to link world heritage sites with multiple countries
  • Adds Country and updated WorldHeritage Eloquent models with proper many-to-many relationships
  • Simplifies Docker Compose configuration by removing nginx service and reformatting existing services

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/database/migrations/2025_08_18_080451_countries.php Creates countries table with state party codes and names
src/database/migrations/2025_08_18_080644_site_state_parties.php Creates pivot table linking heritage sites to countries with additional metadata
src/app/Models/Country.php New Eloquent model for countries with many-to-many relationship to heritage sites
src/app/Models/WorldHeritage.php Updated model to include many-to-many relationship with countries
docker-compose.yml Simplified configuration with removed nginx service and condensed formatting

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


public function down(): void
{
Schema::dropIfExists('state_party_world_heritage_site');
Copy link

Copilot AI Aug 20, 2025

Choose a reason for hiding this comment

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

The table name in the down() method doesn't match the table created in up(). It should be 'site_state_parties' instead of 'state_party_world_heritage_site'.

Suggested change
Schema::dropIfExists('state_party_world_heritage_site');
Schema::dropIfExists('site_state_parties');

Copilot uses AI. Check for mistakes.
*/
public function down(): void
{
//
Copy link

Copilot AI Aug 20, 2025

Choose a reason for hiding this comment

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

The down() method should implement the rollback logic to drop the 'countries' table using Schema::dropIfExists('countries').

Suggested change
//
Schema::dropIfExists('countries');

Copilot uses AI. Check for mistakes.
'state_party_code',
'id',
'state_party_code'
)->withPivot(['is_primary','inscription_year'])
Copy link

Copilot AI Aug 20, 2025

Choose a reason for hiding this comment

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

[nitpick] Missing spaces after commas in the array. Should be ['is_primary', 'inscription_year'] for consistent code formatting.

Suggested change
)->withPivot(['is_primary','inscription_year'])
)->withPivot(['is_primary', 'inscription_year'])

Copilot uses AI. Check for mistakes.
'world_heritage_site_id',
'state_party_code',
'id'
)->withPivot(['is_primary','inscription_year'])
Copy link

Copilot AI Aug 20, 2025

Choose a reason for hiding this comment

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

[nitpick] Missing spaces after commas in the array. Should be ['is_primary', 'inscription_year'] for consistent code formatting.

Suggested change
)->withPivot(['is_primary','inscription_year'])
)->withPivot(['is_primary', 'inscription_year'])

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix DB Design

2 participants