Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: data type mismatch in the subscriptions migration #138

Merged
merged 2 commits into from
Nov 6, 2024

Conversation

ibnsultan
Copy link
Contributor

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Build-related changes

Description

This PR addresses an issue with the foreign key constraint between the subscriptions and plans tables. The constraint failed due to a data type mismatch between the plan_id in the subscriptions table and the id in the plans table.

Fixes Implemented:

  • Reordered Migrations: The migration for the subscription table was reordered to run after the plans table, ensuring that the foreign key reference is established correctly during the migration process.
  • Data Type Mismatch Fix: Adjusted the data type of the plan_id in the subscriptions table to match that of the id in the plans table, resolving the constraint error.

Does this PR introduce a breaking change?

  • Yes
  • No

Related Issue

None

reordered `subscription` migration to come after the `plans` as it has a FK that refers to the `plans` migrations
@bobbyiliev bobbyiliev requested a review from tnylea October 27, 2024 15:57
Copy link
Collaborator

@bobbyiliev bobbyiliev left a comment

Choose a reason for hiding this comment

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

This looks good to me! I'll let @tnylea also check it out before merging!

@adamthomason
Copy link

In addition to this, there's a further issue in that the *_create_plans_table.php file has a later timestamp than the *_create_subscrpitions_table.php which causes a failure when migration. The subscriptions table references the plans table in its migration, so the plans table should be created first.

@vipxr
Copy link

vipxr commented Oct 31, 2024

I had the same problem and fixed it myself and wanted to fix it here too but you did it thank you

@tnylea
Copy link
Contributor

tnylea commented Nov 6, 2024

Looks great to me. Thanks guys!

@adamthomason would you mind submitting a PR for that issue with the migration you were experiencing. Thanks.

@tnylea tnylea merged commit 16d9709 into thedevdojo:main Nov 6, 2024
2 checks passed
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.

5 participants