summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2019-03-27 12:11:35 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2019-03-27 13:32:59 +0100
commit592093079f35bab1b6311a58411881e122950e12 (patch)
tree9b46e2fd01b609fd1f032fee83d88adce6782bb8
parent274658629d2f7e72de123a8763f2578f79cb3376 (diff)
downloadnextcloud-server-592093079f35bab1b6311a58411881e122950e12.tar.gz
nextcloud-server-592093079f35bab1b6311a58411881e122950e12.zip
Deduplicate index names
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r--apps/dav/lib/Migration/Version1004Date20170924124212.php4
-rw-r--r--core/Application.php8
-rw-r--r--core/Command/Db/AddMissingIndices.php12
3 files changed, 12 insertions, 12 deletions
diff --git a/apps/dav/lib/Migration/Version1004Date20170924124212.php b/apps/dav/lib/Migration/Version1004Date20170924124212.php
index 5a684b6a926..7a87f6d2b04 100644
--- a/apps/dav/lib/Migration/Version1004Date20170924124212.php
+++ b/apps/dav/lib/Migration/Version1004Date20170924124212.php
@@ -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;
}
diff --git a/core/Application.php b/core/Application.php
index 1a7cf8aa10c..5ba07e2cb48 100644
--- a/core/Application.php
+++ b/core/Application.php
@@ -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');
}
}
}
diff --git a/core/Command/Db/AddMissingIndices.php b/core/Command/Db/AddMissingIndices.php
index 9df76f67b7b..0bb6658e85e 100644
--- a/core/Command/Db/AddMissingIndices.php
+++ b/core/Command/Db/AddMissingIndices.php
@@ -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>');