Skip to content

Commit 71d2eef

Browse files
committed
fix(migration): set explicit primary key and index names for Oracle compatibility
- 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>
1 parent b11d27b commit 71d2eef

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/Migration/Version1000Date20260309120000.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
6464
$table->addColumn('created_at', Types::DATETIME, []);
6565
$table->addColumn('updated_at', Types::DATETIME, []);
6666

67-
$table->setPrimaryKey(['id']);
67+
$table->setPrimaryKey(['id'], 'pf_definitions_pk');
6868
$table->addUniqueIndex(['field_key'], 'profile_fields_def_key_uk');
6969
$table->addIndex(['active', 'sort_order'], 'pf_def_active_sort_idx');
7070
}
@@ -91,8 +91,8 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
9191
]);
9292
$table->addColumn('updated_at', Types::DATETIME, []);
9393

94-
$table->setPrimaryKey(['id']);
95-
$table->addUniqueIndex(['field_definition_id', 'user_uid'], 'profile_fields_val_field_user_uk');
94+
$table->setPrimaryKey(['id'], 'pf_values_pk');
95+
$table->addUniqueIndex(['field_definition_id', 'user_uid'], 'pf_val_def_user_uk');
9696
$table->addIndex(['user_uid'], 'profile_fields_val_user_idx');
9797
$table->addIndex(['field_definition_id'], 'profile_fields_val_field_idx');
9898
$table->addForeignKeyConstraint(

0 commit comments

Comments
 (0)