5use Doctrine\DBAL\Platforms\AbstractPlatform;
6use Doctrine\DBAL\Schema\Schema;
24 $this->schema =
new Schema();
32 $table = $this->schema->createTable( self::TABLE_PREFIX .
$schema[
'name'] );
33 foreach (
$schema[
'columns'] as $column ) {
34 $table->addColumn( $column[
'name'], $column[
'type'], $column[
'options'] );
36 foreach (
$schema[
'indexes'] as $index ) {
37 if ( $index[
'unique'] ===
true ) {
38 $table->addUniqueIndex( $index[
'columns'], $index[
'name'] );
40 $table->addIndex( $index[
'columns'], $index[
'name'] );
43 $table->setPrimaryKey(
$schema[
'pk'] );
44 $table->addOption(
'table_options',
'/*$wgDBTableOptions*/' );
51 return $this->schema->toSql( $this->platform );