Skip to content

Fix bit type#723

Closed
Tigrov wants to merge 1 commit into
yiisoft:masterfrom
Tigrov:fix-bit-type
Closed

Fix bit type#723
Tigrov wants to merge 1 commit into
yiisoft:masterfrom
Tigrov:fix-bit-type

Conversation

@Tigrov

@Tigrov Tigrov commented Jun 27, 2023

Copy link
Copy Markdown
Member

For yiisoft/db-pgsql

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

@what-the-diff

what-the-diff Bot commented Jun 27, 2023

Copy link
Copy Markdown

PR Summary

  • Inclusion of a New Case for TYPE_BIT
    The AbstractSchema.php file now includes a new case consideration for TYPE_BIT within the getColumnPhpType() method. This means that the system can now handle and interpret TYPE_BIT information when processing data.

  • Addition of TYPE_BIT Constant
    In the SchemaInterface.php file, a new constant named TYPE_BIT has been introduced. This constant will be used across the system wherever TYPE_BIT data types need to be referred or processed.

@codecov

codecov Bot commented Jun 27, 2023

Copy link
Copy Markdown

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (25c1e46) 99.77% compared to head (55cc14f) 99.77%.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #723   +/-   ##
=========================================
  Coverage     99.77%   99.77%           
  Complexity     1281     1281           
=========================================
  Files            63       63           
  Lines          3045     3046    +1     
=========================================
+ Hits           3038     3039    +1     
  Misses            7        7           
Impacted Files Coverage Δ
src/Schema/AbstractSchema.php 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@samdark samdark requested review from darkdef and terabytesoftw June 30, 2023 03:09
SchemaInterface::TYPE_SMALLINT => SchemaInterface::PHP_TYPE_INTEGER,
SchemaInterface::TYPE_INTEGER => SchemaInterface::PHP_TYPE_INTEGER,
SchemaInterface::TYPE_BIGINT => SchemaInterface::PHP_TYPE_INTEGER,
SchemaInterface::TYPE_BIT => SchemaInterface::PHP_TYPE_INTEGER,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

In MSSQL BIT is 1, 0, or NULL only. Can it be problem?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

May be use name "BIT_STRING"?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The changes are only for yiisoft/db-pgsql

For yiisoft/db-mssql it is as before:

https://github.com/yiisoft/db-mssql/blob/master/src/Schema.php#L74C9-L74C38

'bit' => self::TYPE_SMALLINT,

I do not know any issues with type bit in MSSQL but if it is required it is possible to change it to 'bit' => self::TYPE_BIT, and cast bit value in ColumnSchema::dbTypecast() or ColumnSchema::phpTypecast().

Comment thread src/Schema/SchemaInterface.php
@Tigrov

Tigrov commented Jul 6, 2023

Copy link
Copy Markdown
Member Author

Code moved to yiisoft/db-pgsql

@Tigrov Tigrov closed this Jul 6, 2023
@terabytesoftw

Copy link
Copy Markdown
Member

Thank you. 👍

@Tigrov Tigrov deleted the fix-bit-type branch July 11, 2023 03:13
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.

4 participants