cycle / schema-builder

Declarative schema generation for Cycle ORM
MIT License
15 stars 11 forks source link

Column attributes aren't copied on relations generation #60

Closed roxblnfk closed 1 year ago

roxblnfk commented 1 year ago

Auto-generated columns don't have the same attributes like in the related source column

see https://discord.com/channels/538114875570913290/988308945045180436/1074709906017501325

#[Cycle\Entity(table: 'country')]
class Country
{
    #[Cycle\Column(type: 'primary' /*, unsigned: true*/)]
    private ?int $id = null;
}
#[Cycle\Entity(table: 'city')]
class City
{
    #[Cycle\Column(type: 'primary')]
    private ?int $id = null;

    #[Cycle\Relation\BelongsTo(target: Country::class, nullable: true)]
    private ?Country $country = null;
}
msmakouz commented 1 year ago

This issue is related to the bug in the cycle/database. PR: https://github.com/cycle/database/pull/105