Skip to content

fix #99 Fix the migrations on PostgreSQL and document its support - #100

Merged
njoubert-cleverage merged 2 commits into
mainfrom
99
Oct 5, 2026
Merged

njoubert-cleverage merged 2 commits into
mainfrom
99

Conversation

@njoubert-cleverage

@njoubert-cleverage njoubert-cleverage commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Description

Fixes #99.

No project runs the bundle on PostgreSQL: none of its migrations has been executed on PostgreSQL, so their PostgreSQL branches are fixed in place (no new migration):

  • Version20231006111525: the id columns of log_record, process_execution and process_user are created as identity columns (id INT GENERATED BY DEFAULT AS IDENTITY, as generated by Doctrine). The standalone <table>_id_seq sequences were not used as default value: inserts without id (IDENTITY generation, the doctrine/orm 3 default) failed with null value in column "id".
  • Version20240729151928: process_schedule created with the PostgreSQL syntax (was AUTO_INCREMENT: syntax error, the migrations stopped there).
  • Docs: docs/index.md mentions the supported databases (MySQL / MariaDB and PostgreSQL).

process_execution.context (NOT NULL in the migrations, nullable in the mapping) is a mapping / schema difference, not a PostgreSQL issue (ADD ... NOT NULL works on the empty table of a fresh installation): handled with #97.

Tests of the migrations removed (tests/Migrations/, separate commit): they only asserted the generated SQL, never executed on a database, and did not catch these PostgreSQL failures.

Checked with the bundle migrations run by doctrine/migrations, then SchemaTool and ORM inserts (doctrine/orm 3.7, DBAL 4.5):

  • PostgreSQL 16, fresh database: migrations OK; schema diff: only the cosmetic (DC2Type:...) column comments; ORM inserts of User, ProcessExecution, LogRecord, ProcessSchedule OK. Before this PR: syntax error at or near "AUTO_INCREMENT"
  • PostgreSQL 16, down to the first migration then up: OK, same schema, inserts OK
  • MySQL 9.1, fresh database: migrations OK, schema diff: only the (DC2Type:...) comments
  • process-bundle-demo on PostgreSQL 16 (cleverage/ui-process-bundle#99 - Allow running the demo on PostgreSQL instead of MySQL process-bundle-demo#70): make start migrations and fixtures, doctrine demo processes, UI login, launch from the UI consumed by the worker, schedule creation
  • bundle (Symfony 8.1, PHP 8.5): 257 tests OK (330 before the removal of the migration tests). PHPStan, PHP-CS-Fixer, Rector OK

Not handled here: running the migrations on PostgreSQL / MySQL in the CI.

Requirements

  • Documentation updates
    • Reference
    • Changelog
  • Unit tests

Breaking changes

None: the PostgreSQL migrations failed, no project runs on PostgreSQL.

🤖 Generated with Claude Code

njoubert-cleverage and others added 2 commits October 5, 2026 15:15
No migration of the bundle could have run on PostgreSQL, so their PostgreSQL branches are fixed in place:
- Version20231006111525: id columns created as identity columns (the sequences were not used as default value:
  inserts failed with the IDENTITY generation, the doctrine/orm 3 default)
- Version20240729151928: process_schedule created with the PostgreSQL syntax (AUTO_INCREMENT failed)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
They only asserted the generated SQL, never executed on a database: they did not catch the PostgreSQL failures of #99.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrations broken on PostgreSQL: AUTO_INCREMENT syntax, ids without generation

1 participant