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

Add varbinary support in MySQL #146

Merged
merged 11 commits into from
Dec 4, 2023
Merged

Add varbinary support in MySQL #146

merged 11 commits into from
Dec 4, 2023

Conversation

msmakouz
Copy link
Member

Varbinary

Support for varbinary in MySQL has been added with the ability to specify size. When specifying a binary type with size, a column of type varbinary with the required size will be automatically created.

#[Entity]
class User
{
    #[Column(type: 'binary(16)', primary: true)]
    private UuidInterface $uuid;
}

Prior to these changes, a column of type blob was created and the size was ignored.

Closes: #144

Size attribute

The size attribute is explicitly used in certain column types. Prior to these changes, for example, mistakenly specifying a size on a column of type json would lead to the generation of erroneous migrations.

@msmakouz msmakouz added this to the 2.6.x milestone Nov 28, 2023
@msmakouz msmakouz requested a review from roxblnfk November 28, 2023 10:33
@msmakouz msmakouz self-assigned this Nov 28, 2023
Copy link

codecov bot commented Nov 28, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (406928e) 95.03% compared to head (b4e75dd) 95.04%.

Additional details and impacted files
@@             Coverage Diff              @@
##                2.x     #146      +/-   ##
============================================
+ Coverage     95.03%   95.04%   +0.01%     
- Complexity     1798     1805       +7     
============================================
  Files           128      128              
  Lines          4952     4965      +13     
============================================
+ Hits           4706     4719      +13     
  Misses          246      246              

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

@msmakouz msmakouz marked this pull request as draft November 28, 2023 11:27
@msmakouz msmakouz marked this pull request as ready for review November 28, 2023 15:08
@roxblnfk roxblnfk removed this from the 2.6.x milestone Nov 28, 2023
src/Driver/MySQL/Schema/MySQLColumn.php Outdated Show resolved Hide resolved
src/Driver/MySQL/Schema/MySQLColumn.php Outdated Show resolved Hide resolved
src/Driver/MySQL/Schema/MySQLColumn.php Outdated Show resolved Hide resolved
src/Driver/SQLite/Schema/SQLiteColumn.php Outdated Show resolved Hide resolved
@msmakouz msmakouz requested a review from roxblnfk November 29, 2023 16:24
@roxblnfk roxblnfk merged commit be80d1c into 2.x Dec 4, 2023
39 checks passed
@roxblnfk roxblnfk deleted the bugfix/size branch December 4, 2023 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The generated migration does not respect the binary field size.
3 participants