Skip to content

fix: Forge::modifyColumn() for Postgre handler #9676

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

Merged
merged 2 commits into from
Aug 15, 2025

Conversation

michalsn
Copy link
Member

Description
This PR fixes a bug in Postgre where changing a column's default value via Config\Database\Forge::modifyColumn() would result in incorrect SQL syntax.

Fixes #9671

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@michalsn michalsn marked this pull request as draft August 12, 2025 19:09
@michalsn michalsn added the bug Verified issues on the current code behavior or pull requests that will fix them label Aug 12, 2025
@michalsn
Copy link
Member Author

michalsn commented Aug 13, 2025

@paulbalandan, given the recent testing challenges, do you have any thoughts on why this only happens with OCI8 and SQLSRV? Interestingly, migration locks (#9660) follow the same approach of creating a table for just one test case, but they don't seem to have these issues... unless I rebase - then it might be the same (but I'm not ready to test that yet) 😅

@paulbalandan
Copy link
Member

The test fails so the cleanup isn't reached causing test_stores to remain in the migration table. Though I'm not sure why your tests fail for those two DB only.

@michalsn
Copy link
Member Author

Idk what I was thinking... I totally missed the errors... sorry 🤦

@michalsn michalsn added the database Issues or pull requests that affect the database layer label Aug 13, 2025
@michalsn michalsn force-pushed the fix/modifyColumn-postgre branch from 14c5562 to 4721884 Compare August 14, 2025 06:54
@michalsn michalsn marked this pull request as ready for review August 14, 2025 07:10
Copy link
Contributor

@neznaika0 neznaika0 left a comment

Choose a reason for hiding this comment

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

I'm reviewing all the PR, but I don't know much for approval. It looks good.

@michalsn michalsn merged commit 031d5c6 into codeigniter4:develop Aug 15, 2025
84 of 85 checks passed
@michalsn
Copy link
Member Author

Thank you @paulbalandan and @neznaika0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified issues on the current code behavior or pull requests that will fix them database Issues or pull requests that affect the database layer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: duplicate the "DEFAULT" when trying to migrate
3 participants