rdbms: Make adding a PK optional in DoctrineAbstractSchemaTrait.php
Bug: T268591 Change-Id: I08c24b6846006d7d92531b3868163c865465bee4
This commit is contained in:
parent
fb19c8b235
commit
02a1fc5937
1 changed files with 5 additions and 1 deletions
|
|
@ -32,6 +32,7 @@ trait DoctrineAbstractSchemaTrait {
|
|||
foreach ( $schemaSpec['columns'] as $column ) {
|
||||
$table->addColumn( $column['name'], $column['type'], $column['options'] );
|
||||
}
|
||||
|
||||
foreach ( $schemaSpec['indexes'] as $index ) {
|
||||
if ( $index['unique'] === true ) {
|
||||
$table->addUniqueIndex( $index['columns'], $index['name'], $index['options'] ?? [] );
|
||||
|
|
@ -39,7 +40,10 @@ trait DoctrineAbstractSchemaTrait {
|
|||
$table->addIndex( $index['columns'], $index['name'], $index['flags'] ?? [], $index['options'] ?? [] );
|
||||
}
|
||||
}
|
||||
$table->setPrimaryKey( $schemaSpec['pk'] );
|
||||
|
||||
if ( isset( $schemaSpec['pk'] ) ) {
|
||||
$table->setPrimaryKey( $schemaSpec['pk'] );
|
||||
}
|
||||
|
||||
if ( isset( $schemaSpec['options'] )
|
||||
&& isset( $schemaSpec['options'][0]['table_options'] )
|
||||
|
|
|
|||
Loading…
Reference in a new issue