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
{{ message }}
Repository navigation
Mapping and schema created by the migrations differ: process_schedule.input, log_record.process_execution_id, process_execution.context #97
The schema created by the migrations of the bundle differs from the entity mapping on three columns:
process_schedule.input: VARCHAR(255) in Version20240729151928, Types::TEXT in ProcessSchedule. With MySQL in strict mode (default), a schedule whose input is longer than 255 characters fails with Data too long for column 'input', while the mapping (and the form) allow it.
All are reported by doctrine:schema:validate / doctrine:schema:update --dump-sql on an application whose schema was created by the migrations.
Reproduction
Create the schema with the migrations of the bundle (MySQL)
bin/console doctrine:schema:update --dump-sql: ALTER TABLE process_schedule CHANGE input input LONGTEXT DEFAULT NULL, ALTER TABLE log_record CHANGE process_execution_id process_execution_id INT NOT NULL, ...
Save a schedule with an input of 300 characters: ERROR 1406 (22001): Data too long for column 'input'
Expected: the schema created by the migrations matches the mapping.
Tested on main (001843b) in process-bundle-demo: MySQL 9.1, doctrine/dbal 4.5, doctrine/orm 3.7, PHP 8.5, Symfony 7.4.
Proposed fix
process_schedule.input: keep VARCHAR(255) (the schedule input is a single-line value such as a file path) and fix the mapping instead: #[ORM\Column(length: 255, nullable: true)] No schema change (validating the length of the fields is a broader topic).
log_record.process_execution_id: a new migration (MySQL / MariaDB, PostgreSQL) deleting the log records without process execution (never displayed by the UI) then making the column NOT NULL.
Description
The schema created by the migrations of the bundle differs from the entity mapping on three columns:
process_schedule.input:VARCHAR(255)inVersion20240729151928,Types::TEXTinProcessSchedule. With MySQL in strict mode (default), a schedule whose input is longer than 255 characters fails withData too long for column 'input', while the mapping (and the form) allow it.log_record.process_execution_id:DEFAULT NULLinVersion20231006111525,nullable: falseinLogRecord.process_execution.context:NOT NULLinVersion20241007152613,nullable: trueinProcessExecution(no failure today:ProcessExecutionalways sets at least[]). Found after fix #97 Align process_schedule.input (VARCHAR(255) in the mapping) and log_record.process_execution_id (migration) #98 was merged.All are reported by
doctrine:schema:validate/doctrine:schema:update --dump-sqlon an application whose schema was created by the migrations.Reproduction
bin/console doctrine:schema:update --dump-sql:ALTER TABLE process_schedule CHANGE input input LONGTEXT DEFAULT NULL,ALTER TABLE log_record CHANGE process_execution_id process_execution_id INT NOT NULL, ...ERROR 1406 (22001): Data too long for column 'input'Expected: the schema created by the migrations matches the mapping.
Tested on
main(001843b) in process-bundle-demo: MySQL 9.1, doctrine/dbal 4.5, doctrine/orm 3.7, PHP 8.5, Symfony 7.4.Proposed fix
process_schedule.input: keepVARCHAR(255)(the schedule input is a single-line value such as a file path) and fix the mapping instead:#[ORM\Column(length: 255, nullable: true)]No schema change (validating the length of the fields is a broader topic).log_record.process_execution_id: a new migration (MySQL / MariaDB, PostgreSQL) deleting the log records without process execution (never displayed by the UI) then making the columnNOT NULL.process_execution.context(after fix #97 Align process_schedule.input (VARCHAR(255) in the mapping) and log_record.process_execution_id (migration) #98): made nullable in the same migration (Version20261005120000, never released).The remaining differences (
(DC2Type:...)column comments written by the migrations, useless since DBAL 4) are cosmetic and not handled here.Requirements
Breaking changes
None. The log records without process execution, if any, are deleted by the migration.