From 7e4c3b577cb3442dfa948dcf37599761823e1059 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 15 Feb 2016 14:52:41 +0100 Subject: [PATCH 1/2] Add index names so Doctrine does not use a too long random string --- apps/files_external/appinfo/database.xml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/files_external/appinfo/database.xml b/apps/files_external/appinfo/database.xml index 2c3615a4d4..54ee642ead 100644 --- a/apps/files_external/appinfo/database.xml +++ b/apps/files_external/appinfo/database.xml @@ -79,13 +79,16 @@ text 64 + + applicable_mount mount_id ascending + applicable_type_value type ascending @@ -96,6 +99,7 @@ + applicable_type_value_mount true type @@ -112,6 +116,7 @@ + *dbprefix*external_config @@ -144,12 +149,14 @@ + config_mount mount_id ascending + config_mount_key true mount_id @@ -162,6 +169,7 @@
+ *dbprefix*external_options @@ -194,6 +202,7 @@ + option_mount mount_id ascending From b14e8fa427c2204570879104feee3e20670787ac Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 15 Feb 2016 15:02:15 +0100 Subject: [PATCH 2/2] Make sure our index names fit in oracle --- lib/private/db/mdb2schemareader.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/private/db/mdb2schemareader.php b/lib/private/db/mdb2schemareader.php index 6f99206e5c..94c48d61f0 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':