fix(migration): set explicit primary key and index names for Oracle compatibility#79
Merged
vitormattos merged 2 commits intomainfrom Apr 14, 2026
Merged
Conversation
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
…ompatibility - setPrimaryKey with explicit name 'pf_definitions_pk' (16 chars) for profile_fields_definitions table (table name without prefix is 26 chars, requires explicit PK name when >= 23 chars per NC Oracle constraint) - setPrimaryKey with explicit name 'pf_values_pk' for profile_fields_values - rename unique index 'profile_fields_val_field_user_uk' (32 chars) to 'pf_val_def_user_uk' (18 chars); Oracle max identifier length is 30 Fixes #65 Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
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.
Problem
Issue #65 was re-opened because the bug persists even after v1.0.2.
After the previous fix (PR #74 shortened
profile_fields_def_active_order_idx), two more Oracle naming constraint violations remain inVersion1000Date20260309120000:1. Primary key —
profile_fields_definitionstableNextcloud NC 32
ensureOracleConstraintsrule: if no explicit primary key name is set (DBAL default'primary'), the table name without prefix must be < 23 chars. Theprofile_fields_definitionstable is 26 chars, so fresh installs fail with:2. Unique index —
profile_fields_valuestableprofile_fields_val_field_user_ukis 32 chars, exceeding Oracle's 30-char limit.Fix
profile_fields_definitions:setPrimaryKey(['id'], 'pf_definitions_pk')(16 chars)profile_fields_values:setPrimaryKey(['id'], 'pf_values_pk')+ renameprofile_fields_val_field_user_uk→pf_val_def_user_uk(18 chars)Test
Added
Version1000Date20260309120000Test::testAllNamesPassOracleConstraintsreplicating NC 32 Oracle constraint checks — confirmed red before fix, green after.Closes #65