You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using symfony/* v5.4.23 and a mariadb database v10.5.15. I have the following problem every time I run console doctrine:migrations:diff. The output always regenerates an ALTER on the enum field.
Here is an example output:
final class Version20230512083413 extends AbstractMigration
{
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE catalog_product CHANGE publication_status publication_status ENUM(\'pending\', \'published\', \'deleted\') DEFAULT \'pending\' NOT NULL COMMENT \'(DC2Type:enum_status)\'');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE catalog_product CHANGE publication_status publication_status ENUM(\'pending\', \'published\', \'deleted\') DEFAULT \'pending\' DEFAULT \'pending\' NOT NULL COMMENT \'(DC2Type:enum_status)\'');
}
}
This is my EnumType:
final class EnumStatusType extends AbstractEnumType
{
public const STATUS_PENDING = 'pending';
public const STATUS_PUBLISHED = 'published';
public const STATUS_DELETED = 'deleted';
protected static array $choices = [
self::STATUS_PENDING => 'pending',
self::STATUS_PUBLISHED => 'published',
self::STATUS_DELETED => 'deleted',
];
public static function getDefaultValue(): string
{
return self::STATUS_PENDING; // This value will be used as default in DDL statement
}
}
I am using symfony/* v5.4.23 and a mariadb database v10.5.15. I have the following problem every time I run console doctrine:migrations:diff. The output always regenerates an ALTER on the enum field.
Here is an example output:
This is my EnumType:
This is my doctrine config:
This is my entity property:
And finally, this is a quick scope about my current dependencies versions:
doctrine/dbal 3.6.2
doctrine/doctrine-migrations-bundle 3.2.2
doctrine/migrations 3.5.5
fresh/doctrine-enum-bundle v7.4.0
Any help would be appreciated.
The text was updated successfully, but these errors were encountered: