Skip to content

馃悰 Issue with Enum Field Difference Detected During Database Migration Synchronization聽#484

Description

@alessandro-amos

No duplicates 馃ゲ.

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

What happened?

When generating a database migration and synchronizing it with the database, a difference is always detected with respect to the enum field. This occurs when I pass the enum values using the "VALUES" key directly in the attribute.

#[Column(type: 'enum', typecast: PaymentMethod::class, value: ['CASH', 'CREDIT', 'DEBIT'])]
protected PaymentMethod $method,

Running it twice, I have something like this:

public function up(): void
{
    $this->table('payments')
    ->alterColumn('method', 'enum', [
        'nullable' => false,
        'defaultValue' => null,
        'values' => ['CASH', 'CREDIT', 'DEBIT'],
    ])
    ->update();
}

public function down(): void
{
    $this->table('payments')
    ->alterColumn('method', 'enum', [
        'nullable' => false,
        'defaultValue' => null,
        'values' => ['CASH', 'CREDIT', 'DEBIT'],
    ])
    ->update();
}

Version

ORM 2.3.4
PHP 8.2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

  • Status
    Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions