platform->getName() === 'postgresql' ? '' : '/*_*/'; $table = $schema->createTable( $prefix . $schemaSpec['name'] ); 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'] ?? [] ); } else { $table->addIndex( $index['columns'], $index['name'], $index['flags'] ?? [], $index['options'] ?? [] ); } } if ( isset( $schemaSpec['pk'] ) && $schemaSpec['pk'] !== [] ) { $table->setPrimaryKey( $schemaSpec['pk'] ); } if ( isset( $schemaSpec['table_options'] ) ) { $table->addOption( 'table_options', implode( ' ', $schemaSpec['table_options'] ) ); } else { $table->addOption( 'table_options', '/*$wgDBTableOptions*/' ); } return $schema; } }