cycle / database

Database Abstraction Layer, Schema Introspection, Schema Generation, Query Builders
MIT License
53 stars 22 forks source link

Add `varbinary` support in MySQL #146

Closed msmakouz closed 7 months ago

msmakouz commented 7 months ago

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.

codecov[bot] commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

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

Additional details and impacted files ```diff @@ 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 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.