Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2016-02-15 17:02:15 +0300
committerJoas Schilling <nickvergessen@owncloud.com>2016-02-16 11:28:29 +0300
commitb14e8fa427c2204570879104feee3e20670787ac (patch)
tree95e0848fe167a186eede88fc0268973a0e9f20f8
parent7e4c3b577cb3442dfa948dcf37599761823e1059 (diff)
Make sure our index names fit in oracle
-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':