8000 🐛 Issue with Enum Field Difference Detected During Database Migration Synchronization · Issue #484 · cycle/orm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
🐛 Issue with Enum Field Difference Detected During Database Migration Synchronization #484
Open
@alessandro-amos

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0