cycle / database

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

The generated migration does not respect the binary field size. #144

Closed iGrog closed 7 months ago

iGrog commented 8 months ago

CycleORM: 2.4 CycleMigrations: 4.2

Entity:

#[Entity]
class MyEntity
{
    #[Column(type: 'binary(16)', name: 'id', primary: true)]
    private Id $id;
}

will be generated as:

        $this->table('mytable')
        ->addColumn('id', 'binary', ['nullable' => false, 'default' => null])
        ->setPrimaryKeys(['id'])
        ->create();

Even if I change binary to binary(16) in the migration, the next cycle:migrate will generate and update to change the column type back to binary without any size.

Please allow specifying the size of binary columns.

roxblnfk commented 8 months ago

@msmakouz i think it may be fixed with the size-related attribute in the MySQLColumn