kopia lustrzana https://github.com/nextcloud/social
Only add index if does not exist yet
Signed-off-by: Julius Härtl <jus@bitgrid.net>pull/975/head
rodzic
db2b8912bc
commit
71918f1a0e
|
@ -1056,7 +1056,7 @@ class Version0003Date20200611000001 extends SimpleMigrationStep {
|
||||||
);
|
);
|
||||||
|
|
||||||
$table->setPrimaryKey(['id']);
|
$table->setPrimaryKey(['id']);
|
||||||
$table->addIndex(['chunk'], 'chunk');
|
$table->addIndex(['chunk'], 'chunk_act');
|
||||||
$table->addUniqueIndex(['stream_id_prim', 'actor_id_prim'], 'sa');
|
$table->addUniqueIndex(['stream_id_prim', 'actor_id_prim'], 'sa');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1111,7 +1111,7 @@ class Version0003Date20200611000001 extends SimpleMigrationStep {
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
$table->addIndex(['chunk'], 'chunk');
|
$table->addIndex(['chunk'], 'chunk_dest');
|
||||||
$table->addUniqueIndex(['stream_id', 'actor_id', 'type'], 'sat');
|
$table->addUniqueIndex(['stream_id', 'actor_id', 'type'], 'sat');
|
||||||
$table->addIndex(['type', 'subtype'], 'ts');
|
$table->addIndex(['type', 'subtype'], 'ts');
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,9 +73,9 @@ class Version0003Date20200730213528 extends SimpleMigrationStep {
|
||||||
/** @var ISchemaWrapper $schema */
|
/** @var ISchemaWrapper $schema */
|
||||||
$schema = $schemaClosure();
|
$schema = $schemaClosure();
|
||||||
|
|
||||||
$this->addChunkToTable($schema, 'social_3_stream');
|
$this->addChunkToTable($schema, 'social_3_stream', '');
|
||||||
$this->addChunkToTable($schema, 'social_3_stream_act');
|
$this->addChunkToTable($schema, 'social_3_stream_act', '_act');
|
||||||
$this->addChunkToTable($schema, 'social_3_stream_dest');
|
$this->addChunkToTable($schema, 'social_3_stream_dest', '_dest');
|
||||||
|
|
||||||
return $schema;
|
return $schema;
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,7 @@ class Version0003Date20200730213528 extends SimpleMigrationStep {
|
||||||
*
|
*
|
||||||
* @throws SchemaException
|
* @throws SchemaException
|
||||||
*/
|
*/
|
||||||
private function addChunkToTable(ISchemaWrapper $schema, string $tableName) {
|
private function addChunkToTable(ISchemaWrapper $schema, string $tableName, string $indexName) {
|
||||||
if (!$schema->hasTable($tableName)) {
|
if (!$schema->hasTable($tableName)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -105,8 +105,9 @@ class Version0003Date20200730213528 extends SimpleMigrationStep {
|
||||||
'unsigned' => true
|
'unsigned' => true
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
if (!$table->hasIndex('chunk' . $indexName)) {
|
||||||
$table->addIndex(['chunk'], 'chunk');
|
$table->addIndex(['chunk'], 'chunk' . $indexName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue