Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Issue with Enum Field Difference Detected During Database Migration Synchronization #484

Open
1 task done
alessandro-amos opened this issue May 23, 2024 · 0 comments
Assignees
Labels
status:to be verified Needs to be reproduced and validated. type:bug Bug

Comments

@alessandro-amos
Copy link

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
@alessandro-amos alessandro-amos added status:to be verified Needs to be reproduced and validated. type:bug Bug labels May 23, 2024
@roxblnfk roxblnfk moved this to Todo in Cycle May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:to be verified Needs to be reproduced and validated. type:bug Bug
Projects
Status: Todo
Development

No branches or pull requests

2 participants