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
When using PostgreSQL 16 with UTF8 charset and collation, schema updates are continuously being triggered despite no actual schema changes existing.
Current behavior
The database schema is continuously being flagged for updates when using the migration system, causing unnecessary migration files to be generated. Upon debugging in the Comparator, the issue appears to be with the Platform Options - specifically with charset and collation for PostgreSQL 16.
The debug output shows that while oldColumn._platformOptions is {array[0]} (empty), newColumn._platformOptions contains {array[2]} with charset and collate both set to "UTF8".
This difference in platform options causes the schema comparator to believe there's a change requiring migration, even though functionally nothing has changed.
How to reproduce
Set up a Symfony 7.2 project with auditor-bundle ^6.0
Configure PostgreSQL 16 database with UTF8 charset and collation
Create a basic entity with auditing enabled
Run bin/console doctrine:migrations:diff
Apply migration
Run bin/console doctrine:migrations:diff again without making any schema changes
Observe that a new migration is generated despite no actual changes
Expected behavior
The schema comparator should properly handle PostgreSQL 16's default UTF8 charset and collation settings, and not flag them as differences requiring migration when no actual schema changes exist. After running a migration, subsequent doctrine:migrations:diff commands should not generate new migrations if no entity changes were made.
The text was updated successfully, but these errors were encountered:
I've identified the commit that appears to be causing this issue: 2fd99aa
The commit message "fixes" is quite inadequate and provides no insight into the purpose of these changes. This commit seems to be adding specific charset and collation handling that's causing PostgreSQL schema comparisons to continuously detect differences even when there aren't any actual schema changes.
It would be helpful if the package maintainers could provide more context about why this change was made and consider a fix that prevents these false positive schema differences with PostgreSQL 16.
auditor
versionSummary
When using PostgreSQL 16 with UTF8 charset and collation, schema updates are continuously being triggered despite no actual schema changes existing.
Current behavior
The database schema is continuously being flagged for updates when using the migration system, causing unnecessary migration files to be generated. Upon debugging in the Comparator, the issue appears to be with the Platform Options - specifically with charset and collation for PostgreSQL 16.
The debug output shows that while oldColumn._platformOptions is {array[0]} (empty), newColumn._platformOptions contains {array[2]} with charset and collate both set to "UTF8".
oldColumn = {Doctrine\DBAL\Schema\Column}
_name = "ip"
_namespace = null
_quoted = false
_type = {Doctrine\DBAL\Types\StringType}
_length = {int} 45
_precision = null
_scale = {int} 0
_unsigned = false
_fixed = false
_notnull = false
_default = null
_autoincrement = false
_values = {array[0]}
_platformOptions = {array[0]}
newColumn = {Doctrine\DBAL\Schema\Column}
_name = "ip"
_namespace = null
_quoted = false
_type = {Doctrine\DBAL\Types\StringType}
_length = {int} 45
_precision = null
_scale = {int} 0
_unsigned = false
_fixed = false
_notnull = false
_default = null
_autoincrement = false
_values = {array[0]}
_platformOptions = {array[2]}
charset = "UTF8"
collate = "UTF8"
This difference in platform options causes the schema comparator to believe there's a change requiring migration, even though functionally nothing has changed.
How to reproduce
Expected behavior
The schema comparator should properly handle PostgreSQL 16's default UTF8 charset and collation settings, and not flag them as differences requiring migration when no actual schema changes exist. After running a migration, subsequent doctrine:migrations:diff commands should not generate new migrations if no entity changes were made.
The text was updated successfully, but these errors were encountered: