diff --git a/apps/files_external/appinfo/database.xml b/apps/files_external/appinfo/database.xml index 2c3615a4d4c..54ee642ead6 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 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':