Skip to content

Unexpected migration loop: persistent schema diff for DOUBLE PRECISION column with default value #7313

@axzx

Description

@axzx

Bug Report

Q A
Version 4.0.0
  • PHP 8.5.2 (cli) (built: Feb 3 2026 02:28:01) (ZTS)
  • mysql Ver 8.0.32 for Linux on x86_64 (MySQL Community Server - GPL)
  • Symfony 8.0
  • DoctrineMigrationsBundle 4.0.0
  • doctrine/dbal 4.4.1
  • doctrine/doctrine-bundle 3.2.2

Summary

I am experiencing an issue where doctrine:migrations:diff constantly generates the same migration for a DOUBLE PRECISION column, even after the migration has been executed. It seems like Doctrine detects a difference between the database state and the mapping, but they are actually in sync.

Entity Mapping

#[ORM\Column(options: ['default' => 0])]
private float $amountDone = 0;

Generated Migration

Each time I run bin/console doctrine:migrations:diff, the following SQL is generated:

public function up(Schema $schema): void
{
    $this->addSql('ALTER TABLE contract__element CHANGE amount_done amount_done DOUBLE PRECISION DEFAULT 0 NOT NULL');
}

public function down(Schema $schema): void
{
    $this->addSql('ALTER TABLE contract__element CHANGE amount_done amount_done DOUBLE PRECISION DEFAULT \'0\' NOT NULL');
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions