Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Latest
* [#89](https://github.com/cleverage/ui-process-bundle/issues/89) `ProcessConfigurationsManager`: resolve the `ui.default` option with a normalizer instead of nested options defined with `setDefault()` (deprecated since symfony/options-resolver 7.3, removed in 8.0). With Symfony 8, a process launched with the UI form (`ui_launch_mode: form`) without `ui.default` no longer fails (`Cannot use object of type Closure as array`), and `ui.default` is validated again. Add tests.
* [#91](https://github.com/cleverage/ui-process-bundle/issues/91) `LoginController`: pass `error` and `last_username` (`AuthenticationUtils`) to the login template, so that a failed login displays the error message and keeps the email. Test updated.
* [#95](https://github.com/cleverage/ui-process-bundle/issues/95) `DoctrineProcessHandler`: detach the written `LogRecord` entities after each flush (the Monolog records were detached instead), so that the identity map no longer grows during long processes; `LogRecord::$processExecution` cascade reduced from `all` to `persist`, so that detaching a log record does not detach the current process execution (which would then be inserted again). Add tests.
* [#97](https://github.com/cleverage/ui-process-bundle/issues/97) Align the mapping and the schema created by the migrations: `ProcessSchedule::$input` mapped as `VARCHAR(255)` as created by the migrations (was `TEXT`); `Version20261005120000` migration (MySQL / MariaDB, PostgreSQL) making `log_record.process_execution_id` `NOT NULL` as in the mapping (log records without process execution are deleted).
* [#97](https://github.com/cleverage/ui-process-bundle/issues/97) Align the mapping and the schema created by the migrations: `ProcessSchedule::$input` mapped as `VARCHAR(255)` as created by the migrations (was `TEXT`); `Version20261005120000` migration (MySQL / MariaDB, PostgreSQL) making `log_record.process_execution_id` `NOT NULL` (log records without process execution are deleted) and `process_execution.context` nullable, as in the mapping.
* [#99](https://github.com/cleverage/ui-process-bundle/issues/99) Fix the migrations on PostgreSQL (they could not create a working schema): id columns created as identity columns (the sequences were not used: inserts failed with the IDENTITY generation), `process_schedule` created with the PostgreSQL syntax (`AUTO_INCREMENT` failed). PostgreSQL support documented.

v3.0.2
Expand Down
11 changes: 9 additions & 2 deletions src/Migrations/Version20261005120000.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@
use Doctrine\Migrations\AbstractMigration;

/**
* Align log_record.process_execution_id, created as nullable by Version20231006111525, on the entity mapping.
* Align on the entity mapping log_record.process_execution_id, created as nullable by Version20231006111525, and
* process_execution.context, created as NOT NULL by Version20241007152613.
*/
final class Version20261005120000 extends AbstractMigration
{
#[\Override]
public function getDescription(): string
{
return 'Make log_record.process_execution_id NOT NULL';
return 'Make log_record.process_execution_id NOT NULL, process_execution.context nullable';
}

public function up(Schema $schema): void
Expand All @@ -43,6 +44,9 @@ public function up(Schema $schema): void
$this->addSql($mySql
? 'ALTER TABLE log_record MODIFY process_execution_id INT NOT NULL'
: 'ALTER TABLE log_record ALTER process_execution_id SET NOT NULL');
$this->addSql($mySql
? 'ALTER TABLE process_execution MODIFY context JSON DEFAULT NULL'
: 'ALTER TABLE process_execution ALTER context DROP NOT NULL');
}

#[\Override]
Expand All @@ -57,5 +61,8 @@ public function down(Schema $schema): void
$this->addSql($mySql
? 'ALTER TABLE log_record MODIFY process_execution_id INT DEFAULT NULL'
: 'ALTER TABLE log_record ALTER process_execution_id DROP NOT NULL');
$this->addSql($mySql
? 'ALTER TABLE process_execution MODIFY context JSON NOT NULL'
: 'ALTER TABLE process_execution ALTER context SET NOT NULL');
}
}
Loading