summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2019-04-01 09:03:30 +0200
committerGitHub <noreply@github.com>2019-04-01 09:03:30 +0200
commita7c0254b45c1966c5c2a3d6f18b0b749d0eb1062 (patch)
tree79e6e9d3bc7cfe9485bea153a2944b4461a5da64 /lib
parentc55ac95e1bb208e838189520b7b544f355e240b4 (diff)
parentf557e1e214cd7e441fcc43e593591d6d89795d6b (diff)
downloadnextcloud-server-a7c0254b45c1966c5c2a3d6f18b0b749d0eb1062.tar.gz
nextcloud-server-a7c0254b45c1966c5c2a3d6f18b0b749d0eb1062.zip
Merge pull request #14902 from nextcloud/bugfix/noid/fix-non-default-prefix
Indeces, columns and sequences don't have the table prefix
Diffstat (limited to 'lib')
-rw-r--r--lib/private/DB/MigrationService.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/private/DB/MigrationService.php b/lib/private/DB/MigrationService.php
index 97f1dd269d1..d26337990d1 100644
--- a/lib/private/DB/MigrationService.php
+++ b/lib/private/DB/MigrationService.php
@@ -507,19 +507,19 @@ class MigrationService {
}
foreach ($table->getColumns() as $thing) {
- if ((!$sourceTable instanceof Table || !$sourceTable->hasColumn($thing->getName())) && \strlen($thing->getName()) - $prefixLength > 27) {
+ if ((!$sourceTable instanceof Table || !$sourceTable->hasColumn($thing->getName())) && \strlen($thing->getName()) > 30) {
throw new \InvalidArgumentException('Column name "' . $table->getName() . '"."' . $thing->getName() . '" is too long.');
}
}
foreach ($table->getIndexes() as $thing) {
- if ((!$sourceTable instanceof Table || !$sourceTable->hasIndex($thing->getName())) && \strlen($thing->getName()) - $prefixLength > 27) {
+ if ((!$sourceTable instanceof Table || !$sourceTable->hasIndex($thing->getName())) && \strlen($thing->getName()) > 30) {
throw new \InvalidArgumentException('Index name "' . $table->getName() . '"."' . $thing->getName() . '" is too long.');
}
}
foreach ($table->getForeignKeys() as $thing) {
- if ((!$sourceTable instanceof Table || !$sourceTable->hasForeignKey($thing->getName())) && \strlen($thing->getName()) - $prefixLength > 27) {
+ if ((!$sourceTable instanceof Table || !$sourceTable->hasForeignKey($thing->getName())) && \strlen($thing->getName()) > 30) {
throw new \InvalidArgumentException('Foreign key name "' . $table->getName() . '"."' . $thing->getName() . '" is too long.');
}
}
@@ -544,17 +544,17 @@ class MigrationService {
$isUsingDefaultName = strtolower($defaultName) === $indexName;
}
- if (!$isUsingDefaultName && \strlen($indexName) - $prefixLength > 27) {
+ if (!$isUsingDefaultName && \strlen($indexName) > 30) {
throw new \InvalidArgumentException('Primary index name on "' . $table->getName() . '" is too long.');
}
- if ($isUsingDefaultName && \strlen($table->getName()) - $prefixLength > 23) {
+ if ($isUsingDefaultName && \strlen($table->getName()) > 26) {
throw new \InvalidArgumentException('Primary index name on "' . $table->getName() . '" is too long.');
}
}
}
foreach ($sequences as $sequence) {
- if (!$sourceSchema->hasSequence($sequence->getName()) && \strlen($sequence->getName()) - $prefixLength > 27) {
+ if (!$sourceSchema->hasSequence($sequence->getName()) && \strlen($sequence->getName()) > 30) {
throw new \InvalidArgumentException('Sequence name "' . $sequence->getName() . '" is too long.');
}
}