Repository navigation
feat(doctrine): doctrine.table_name_prefix replaces the nowo_http_log_ part of the table name - #38
Merged
Merged
Conversation
…_ part of the table name New doctrine.table_name_prefix option (default nowo_http_log_) replaces the nowo_http_log_ part of the table name, e.g. http_log_ gives http_log_entry. The idx_http_log_* index names do not contain it and stay unchanged; doctrine.table_prefix keeps prepending to the result. With the defaults the listener is not registered and the table, index and unique names are byte-identical (golden SchemaNamesTest). UPGRADING lists the rename SQL for MySQL/MariaDB and PostgreSQL, checked against MySQL 8.0 and PostgreSQL 17.
|
@coderabbitai review |
…able prefixes - nowo_http_log.doctrine.entry_table publishes the physical table name. - HttpLogPersonalDataEraserInterface (public service): count and keyset- batched delete of entries by user identifier or client IP, through DQL so the configured table name always applies. - table_prefix / table_name_prefix must match /^[a-z][a-z0-9_]*\z/ and may not make a generated name longer than 63 characters; checked at compile time and in the listener constructor for %env()% values. - UPGRADING: name clashes, entries dropped during the rename window, host SQL on the old name, transactional behaviour per platform.
…table prefixes - E1: the SQL = only pre-filters (MySQL utf8mb4 *_ci collations also match ANA / Ana / ana-acute / ss-sharp-s); each candidate is compared with === in PHP before it is counted or deleted, in keyset batches. Test with a case-insensitive (NOCASE) fake; also checked on MySQL 8.0 utf8mb4_0900_ai_ci. - E2: values containing a NUL byte are rejected (PDO cuts them at NUL). - E3: IP addresses are compared as logged, without normalisation (documented). - N2: %env()% is rejected for doctrine.table_prefix / table_name_prefix with a clear message (fail-closed); docs no longer claim env support.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds
nowo_http_log.doctrine.table_name_prefix(defaultnowo_http_log_), which replaces thenowo_http_log_part of the table name. symfony-beacon asked for this and will sethttp_log_, which gives the tablehttp_log_entry.table_name: this follows house style. TaskBoard (task_board_), Wiki (wiki_), TimeTrack, and the ChatKit / SeoKit PRs opened alongside this one all expose a prefix with fixed<name>suffixes. Hosts get one convention for every bundle, and it still works if the bundle gains a second table.idx_http_log_*index names do not containnowo_http_log_, so they stay the same under anytable_name_prefix. Doctrine derives therequest_idunique name (UNIQ_*) from the table name, so it follows the table.doctrine.table_prefixkeeps its meaning and is prepended after the replacement. With both defaults the listener is not registered, so every name is byte-identical. The goldentests/Integration/Doctrine/SchemaNamesTest.phpbuilds the schema from the extension config for the default,http_log_andapp_cases. I also ran it againstmaincode for the default andapp_cases.http_log_install.doctrinesection, INSTALLATION, UPGRADING, CHANGELOG Unreleased, spec FR-ORM-002 and code inventory.Type of Change
Checklist
docs/CHANGELOG.mdif applicableTesting
Run locally: translation parity, cs-check, rector-dry, phpstan, igor (worker-mode compatible), and PHPUnit with 356 tests at 100% line coverage.
🤖 Generated with Claude Code