summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-02-18 11:18:32 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-02-18 11:18:32 +0100
commit73d46afc3c5ef237cc8a5431aa1bef4686a7521b (patch)
treeb1fbcdf3e1556ade24e0a7fdcc051c1735f5bf3f /lib/private
parentbba8875fb5669dcf0d93033a63824e942a823622 (diff)
parentb14e8fa427c2204570879104feee3e20670787ac (diff)
downloadnextcloud-server-73d46afc3c5ef237cc8a5431aa1bef4686a7521b.tar.gz
nextcloud-server-73d46afc3c5ef237cc8a5431aa1bef4686a7521b.zip
Merge pull request #22399 from owncloud/issue-22394-index-names-for-oracle
Add index names so Doctrine does not use a too long random string
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/db/mdb2schemareader.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/private/db/mdb2schemareader.php b/lib/private/db/mdb2schemareader.php
index 6f99206e5c8..94c48d61f06 100644
--- a/lib/private/db/mdb2schemareader.php
+++ b/lib/private/db/mdb2schemareader.php
@@ -30,6 +30,7 @@
namespace OC\DB;
use Doctrine\DBAL\Platforms\AbstractPlatform;
+use Doctrine\DBAL\Schema\SchemaConfig;
use OCP\IConfig;
class MDB2SchemaReader {
@@ -48,6 +49,9 @@ class MDB2SchemaReader {
*/
protected $platform;
+ /** @var \Doctrine\DBAL\Schema\SchemaConfig $schemaConfig */
+ protected $schemaConfig;
+
/**
* @param \OCP\IConfig $config
* @param \Doctrine\DBAL\Platforms\AbstractPlatform $platform
@@ -56,6 +60,12 @@ class MDB2SchemaReader {
$this->platform = $platform;
$this->DBNAME = $config->getSystemValue('dbname', 'owncloud');
$this->DBTABLEPREFIX = $config->getSystemValue('dbtableprefix', 'oc_');
+
+ // Oracle does not support longer index names then 30 characters.
+ // We use this limit for all DBs to make sure it does not cause a
+ // problem.
+ $this->schemaConfig = new SchemaConfig();
+ $this->schemaConfig->setMaxIdentifierLength(30);
}
/**
@@ -107,6 +117,7 @@ class MDB2SchemaReader {
$name = $this->platform->quoteIdentifier($name);
$table = $schema->createTable($name);
$table->addOption('collate', 'utf8_bin');
+ $table->setSchemaConfig($this->schemaConfig);
break;
case 'create':
case 'overwrite':