]> source.dussan.org Git - nextcloud-server.git/commitdiff
Deduplicate index names 14878/head
authorJoas Schilling <coding@schilljs.com>
Wed, 27 Mar 2019 11:11:35 +0000 (12:11 +0100)
committerRoeland Jago Douma <roeland@famdouma.nl>
Wed, 27 Mar 2019 12:32:59 +0000 (13:32 +0100)
Signed-off-by: Joas Schilling <coding@schilljs.com>
apps/dav/lib/Migration/Version1004Date20170924124212.php
core/Application.php
core/Command/Db/AddMissingIndices.php

index 5a684b6a92616d79736022696e4ba39be4486c36..7a87f6d2b0444228e69359042a4c3bbab8468f66 100644 (file)
@@ -40,10 +40,10 @@ class Version1004Date20170924124212 extends SimpleMigrationStep {
                $schema = $schemaClosure();
 
                $table = $schema->getTable('cards');
-               $table->addIndex(['addressbookid'], 'addressbookid');
+               $table->addIndex(['addressbookid'], 'cards_abid');
 
                $table = $schema->getTable('cards_properties');
-               $table->addIndex(['addressbookid'], 'addressbookid');
+               $table->addIndex(['addressbookid'], 'cards_prop_abid');
 
                return $schema;
        }
index 1a7cf8aa10c694ee27e06fa1357d8abdca3849d1..5ba07e2cb481cabb2d79933f6b9612dd5cfd92e1 100644 (file)
@@ -119,16 +119,16 @@ class Application extends App {
                                if ($schema->hasTable('cards')) {
                                        $table = $schema->getTable('cards');
 
-                                       if (!$table->hasIndex('addressbookid')) {
-                                               $subject->addHintForMissingSubject($table->getName(), 'addressbookid');
+                                       if (!$table->hasIndex('cards_abid')) {
+                                               $subject->addHintForMissingSubject($table->getName(), 'cards_abid');
                                        }
                                }
 
                                if ($schema->hasTable('cards_properties')) {
                                        $table = $schema->getTable('cards_properties');
 
-                                       if (!$table->hasIndex('addressbookid')) {
-                                               $subject->addHintForMissingSubject($table->getName(), 'addressbookid');
+                                       if (!$table->hasIndex('cards_prop_abid')) {
+                                               $subject->addHintForMissingSubject($table->getName(), 'cards_prop_abid');
                                        }
                                }
                        }
index 9df76f67b7bab67eabf4256af4d44dd2fb735c85..0bb6658e85e1340b6704d5331d941628709b3b33 100644 (file)
@@ -186,8 +186,8 @@ class AddMissingIndices extends Command {
                $output->writeln('<info>Check indices of the cards table.</info>');
                if ($schema->hasTable('cards')) {
                        $table = $schema->getTable('cards');
-                       if (!$table->hasIndex('addressbookid')) {
-                               $output->writeln('<info>Adding addressbookid index to the cards table, this can take some time...</info>');
+                       if (!$table->hasIndex('cards_abid')) {
+                               $output->writeln('<info>Adding cards_abid index to the cards table, this can take some time...</info>');
 
                                foreach ($table->getIndexes() as $index) {
                                        if ($index->getColumns() === ['addressbookid']) {
@@ -195,7 +195,7 @@ class AddMissingIndices extends Command {
                                        }
                                }
 
-                               $table->addIndex(['addressbookid'], 'addressbookid');
+                               $table->addIndex(['addressbookid'], 'cards_abid');
                                $this->connection->migrateToSchema($schema->getWrappedSchema());
                                $updated = true;
                                $output->writeln('<info>cards table updated successfully.</info>');
@@ -205,8 +205,8 @@ class AddMissingIndices extends Command {
                $output->writeln('<info>Check indices of the cards_properties table.</info>');
                if ($schema->hasTable('cards_properties')) {
                        $table = $schema->getTable('cards_properties');
-                       if (!$table->hasIndex('addressbookid')) {
-                               $output->writeln('<info>Adding addressbookid index to the cards_properties table, this can take some time...</info>');
+                       if (!$table->hasIndex('cards_prop_abid')) {
+                               $output->writeln('<info>Adding cards_prop_abid index to the cards_properties table, this can take some time...</info>');
 
                                foreach ($table->getIndexes() as $index) {
                                        if ($index->getColumns() === ['addressbookid']) {
@@ -214,7 +214,7 @@ class AddMissingIndices extends Command {
                                        }
                                }
 
-                               $table->addIndex(['addressbookid'], 'addressbookid');
+                               $table->addIndex(['addressbookid'], 'cards_prop_abid');
                                $this->connection->migrateToSchema($schema->getWrappedSchema());
                                $updated = true;
                                $output->writeln('<info>cards_properties table updated successfully.</info>');