Skip to content

🐛 OptimisticLock schema generation #28

@iGrog

Description

@iGrog

No duplicates 🥲.

  • I have searched for a similar issue in our bug tracker and didn't find any solutions.

What happened?

Using example from this link: https://cycle-orm.dev/docs/entity-behaviors-optimistic-lock

#[Entity]
#[OptimisticLock(
  field: 'version',                         // Required. By default 'version' 
  column: 'version',                        // Optional. By default 'null'. If not set, will be used information from property declaration.
  rule: OptimisticLock::RULE_INCREMENT      // Optional. By default OptimisticLock::RULE_INCREMENT
)]
class Page
{
    #[Column(type: 'primary')]
    private int $id;
    
    #[Column(type: 'integer')]
    private int $version;
}

During schema generation an error was received:
In RegistryModifier.php line 61: Field version must be of type integer

If remove attribute #[Column(type: 'integer')] - then works.

Version

entity-behavior v1.1.1
orm v2.2.1,
PHP 8.1

Metadata

Metadata

Labels

Type

No type

Projects

Status

Released

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions