-
-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Labels
Description
No duplicates 🥲.
- I have searched for a similar issue in our bug tracker and didn't find any solutions.
What happened?
I'm trying to add a SERIAL field as incremental_id
. When creating a table, if I set nullable: true
, it seems that this annotation is ignored.
Example:
#[Entity(repository: CheckoutRepository::class)]
class Checkout
{
#[Column(type: 'serial', nullable: true, unique: true)]
public ?int $incrementalId = null;
#[Column(type: 'uuid', primary: true, typecast: [CheckoutId::class, 'castValue'], unique: true)]
private CheckoutId $id;
// ...
When migrations are generated, in code I see:
$this->table('checkouts')
->addColumn('id', 'uuid', ['nullable' => false, 'defaultValue' => null, 'unique' => true])
->addColumn('incremental_id', 'serial', ['nullable' => false, 'defaultValue' => null])
Version
PHP 8.2
cycle/migrations v4.2.3
cycle/annotated: v3.4.0
cycle/database: v2.7.1
cycle/orm v2.6.1
Initial PR, that added support for SERIAL:
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Todo