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 alter column error in Postgres QueryBuilder (issue yiisoft#19929). #19930

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

daniil-khaletsky
Copy link

@daniil-khaletsky daniil-khaletsky commented Aug 17, 2023

Q A
Is bugfix? ✔️
New feature?
Breaks BC?
Fixed issues #19929

@what-the-diff
Copy link

what-the-diff bot commented Aug 17, 2023

PR Summary

  • Improvement of Query Builder
    The component responsible for building queries to the database, located in the framework/db/pgsql directory, underwent some significant modifications.

  • Column Default Value Extraction
    The way we extract the default value of a column has been refined to ensure it is more accurate, using the preg_match function.

  • Removal of Column Default Value
    Adjustments have been made using the preg_replace function to improve how we remove a column's default value from the column type.

  • Alter Statement Addition
    An additional alter statement has been included to set the column's default value with the improved extracted value.

These improvements will ensure both a better management of the database column default values and an overall more efficient and reliable queries flow.

@codecov
Copy link

codecov bot commented Aug 17, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (73902f0) 48.90% compared to head (bea3284) 48.90%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #19930   +/-   ##
=======================================
  Coverage   48.90%   48.90%           
=======================================
  Files         445      445           
  Lines       42806    42806           
=======================================
  Hits        20935    20935           
  Misses      21871    21871           
Files Changed Coverage Δ
framework/db/pgsql/QueryBuilder.php 43.95% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@samdark samdark requested review from terabytesoftw and a team August 18, 2023 11:39
@samdark
Copy link
Member

samdark commented Aug 18, 2023

@terabytesoftw is that something we want to fix in yiisoft/db?

@terabytesoftw
Copy link
Member

terabytesoftw commented Sep 14, 2023

@terabytesoftw is that something we want to fix in yiisoft/db?

I'm going to check this case, but in Yii3, all the default values work correctly and have tests.

@terabytesoftw
Copy link
Member

@daniil-khaletsky You can add a unit test to properly check the case, thanks.

@terabytesoftw terabytesoftw added the pr:request for unit tests Unit tests are needed. label Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr:request for unit tests Unit tests are needed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants