kopia lustrzana https://github.com/nextcloud/social
Merge pull request #975 from nextcloud/bugfix/noid/ci
Only add index if does not exist yetpull/972/head
commit
ce03cb997e
|
@ -1056,7 +1056,7 @@ class Version0003Date20200611000001 extends SimpleMigrationStep {
|
|||
);
|
||||
|
||||
$table->setPrimaryKey(['id']);
|
||||
$table->addIndex(['chunk'], 'chunk');
|
||||
$table->addIndex(['chunk'], 'chunk_act');
|
||||
$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->addIndex(['type', 'subtype'], 'ts');
|
||||
}
|
||||
|
|
|
@ -73,9 +73,9 @@ class Version0003Date20200730213528 extends SimpleMigrationStep {
|
|||
/** @var ISchemaWrapper $schema */
|
||||
$schema = $schemaClosure();
|
||||
|
||||
$this->addChunkToTable($schema, 'social_3_stream');
|
||||
$this->addChunkToTable($schema, 'social_3_stream_act');
|
||||
$this->addChunkToTable($schema, 'social_3_stream_dest');
|
||||
$this->addChunkToTable($schema, 'social_3_stream', '');
|
||||
$this->addChunkToTable($schema, 'social_3_stream_act', '_act');
|
||||
$this->addChunkToTable($schema, 'social_3_stream_dest', '_dest');
|
||||
|
||||
return $schema;
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ class Version0003Date20200730213528 extends SimpleMigrationStep {
|
|||
*
|
||||
* @throws SchemaException
|
||||
*/
|
||||
private function addChunkToTable(ISchemaWrapper $schema, string $tableName) {
|
||||
private function addChunkToTable(ISchemaWrapper $schema, string $tableName, string $indexName) {
|
||||
if (!$schema->hasTable($tableName)) {
|
||||
return;
|
||||
}
|
||||
|
@ -105,8 +105,9 @@ class Version0003Date20200730213528 extends SimpleMigrationStep {
|
|||
'unsigned' => true
|
||||
]
|
||||
);
|
||||
|
||||
$table->addIndex(['chunk'], 'chunk');
|
||||
if (!$table->hasIndex('chunk' . $indexName)) {
|
||||
$table->addIndex(['chunk'], 'chunk' . $indexName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue