Merge pull request #21639 from nextcloud/techdebt/noid/move-away-from-database-xml
Move away from database xml
This commit is contained in:
commit
7ad0381e5c
|
@ -1,41 +0,0 @@
|
||||||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Keep a mapping of the share ID stored in the local oc_share table
|
|
||||||
and the share ID stored in the remote servers oc_share table.
|
|
||||||
This is needed in order to send updates in both directions between
|
|
||||||
the servers (e.g. permissions change, unshare,...)
|
|
||||||
-->
|
|
||||||
|
|
||||||
<database>
|
|
||||||
<name>*dbname*</name>
|
|
||||||
<create>true</create>
|
|
||||||
<overwrite>false</overwrite>
|
|
||||||
<charset>utf8</charset>
|
|
||||||
<table>
|
|
||||||
<name>*dbprefix*federated_reshares</name>
|
|
||||||
<declaration>
|
|
||||||
<field>
|
|
||||||
<name>share_id</name>
|
|
||||||
<type>integer</type>
|
|
||||||
<notnull>true</notnull>
|
|
||||||
<length>4</length>
|
|
||||||
</field>
|
|
||||||
<field>
|
|
||||||
<name>remote_id</name>
|
|
||||||
<type>integer</type>
|
|
||||||
<notnull>true</notnull>
|
|
||||||
<length>4</length>
|
|
||||||
<comments>share ID at the remote server</comments>
|
|
||||||
</field>
|
|
||||||
<index>
|
|
||||||
<name>share_id_index</name>
|
|
||||||
<unique>true</unique>
|
|
||||||
<field>
|
|
||||||
<name>share_id</name>
|
|
||||||
<sorting>ascending</sorting>
|
|
||||||
</field>
|
|
||||||
</index>
|
|
||||||
</declaration>
|
|
||||||
</table>
|
|
||||||
</database>
|
|
|
@ -5,7 +5,7 @@
|
||||||
<name>Federated file sharing</name>
|
<name>Federated file sharing</name>
|
||||||
<summary>Provide federated file sharing across servers</summary>
|
<summary>Provide federated file sharing across servers</summary>
|
||||||
<description>Provide federated file sharing across servers</description>
|
<description>Provide federated file sharing across servers</description>
|
||||||
<version>1.10.0</version>
|
<version>1.10.1</version>
|
||||||
<licence>agpl</licence>
|
<licence>agpl</licence>
|
||||||
<author>Bjoern Schiessle</author>
|
<author>Bjoern Schiessle</author>
|
||||||
<author>Roeland Jago Douma</author>
|
<author>Roeland Jago Douma</author>
|
||||||
|
|
|
@ -12,6 +12,7 @@ return array(
|
||||||
'OCA\\FederatedFileSharing\\Controller\\MountPublicLinkController' => $baseDir . '/../lib/Controller/MountPublicLinkController.php',
|
'OCA\\FederatedFileSharing\\Controller\\MountPublicLinkController' => $baseDir . '/../lib/Controller/MountPublicLinkController.php',
|
||||||
'OCA\\FederatedFileSharing\\Controller\\RequestHandlerController' => $baseDir . '/../lib/Controller/RequestHandlerController.php',
|
'OCA\\FederatedFileSharing\\Controller\\RequestHandlerController' => $baseDir . '/../lib/Controller/RequestHandlerController.php',
|
||||||
'OCA\\FederatedFileSharing\\FederatedShareProvider' => $baseDir . '/../lib/FederatedShareProvider.php',
|
'OCA\\FederatedFileSharing\\FederatedShareProvider' => $baseDir . '/../lib/FederatedShareProvider.php',
|
||||||
|
'OCA\\FederatedFileSharing\\Migration\\Version1010Date20200630191755' => $baseDir . '/../lib/Migration/Version1010Date20200630191755.php',
|
||||||
'OCA\\FederatedFileSharing\\Notifications' => $baseDir . '/../lib/Notifications.php',
|
'OCA\\FederatedFileSharing\\Notifications' => $baseDir . '/../lib/Notifications.php',
|
||||||
'OCA\\FederatedFileSharing\\Notifier' => $baseDir . '/../lib/Notifier.php',
|
'OCA\\FederatedFileSharing\\Notifier' => $baseDir . '/../lib/Notifier.php',
|
||||||
'OCA\\FederatedFileSharing\\OCM\\CloudFederationProviderFiles' => $baseDir . '/../lib/OCM/CloudFederationProviderFiles.php',
|
'OCA\\FederatedFileSharing\\OCM\\CloudFederationProviderFiles' => $baseDir . '/../lib/OCM/CloudFederationProviderFiles.php',
|
||||||
|
|
|
@ -27,6 +27,7 @@ class ComposerStaticInitFederatedFileSharing
|
||||||
'OCA\\FederatedFileSharing\\Controller\\MountPublicLinkController' => __DIR__ . '/..' . '/../lib/Controller/MountPublicLinkController.php',
|
'OCA\\FederatedFileSharing\\Controller\\MountPublicLinkController' => __DIR__ . '/..' . '/../lib/Controller/MountPublicLinkController.php',
|
||||||
'OCA\\FederatedFileSharing\\Controller\\RequestHandlerController' => __DIR__ . '/..' . '/../lib/Controller/RequestHandlerController.php',
|
'OCA\\FederatedFileSharing\\Controller\\RequestHandlerController' => __DIR__ . '/..' . '/../lib/Controller/RequestHandlerController.php',
|
||||||
'OCA\\FederatedFileSharing\\FederatedShareProvider' => __DIR__ . '/..' . '/../lib/FederatedShareProvider.php',
|
'OCA\\FederatedFileSharing\\FederatedShareProvider' => __DIR__ . '/..' . '/../lib/FederatedShareProvider.php',
|
||||||
|
'OCA\\FederatedFileSharing\\Migration\\Version1010Date20200630191755' => __DIR__ . '/..' . '/../lib/Migration/Version1010Date20200630191755.php',
|
||||||
'OCA\\FederatedFileSharing\\Notifications' => __DIR__ . '/..' . '/../lib/Notifications.php',
|
'OCA\\FederatedFileSharing\\Notifications' => __DIR__ . '/..' . '/../lib/Notifications.php',
|
||||||
'OCA\\FederatedFileSharing\\Notifier' => __DIR__ . '/..' . '/../lib/Notifier.php',
|
'OCA\\FederatedFileSharing\\Notifier' => __DIR__ . '/..' . '/../lib/Notifier.php',
|
||||||
'OCA\\FederatedFileSharing\\OCM\\CloudFederationProviderFiles' => __DIR__ . '/..' . '/../lib/OCM/CloudFederationProviderFiles.php',
|
'OCA\\FederatedFileSharing\\OCM\\CloudFederationProviderFiles' => __DIR__ . '/..' . '/../lib/OCM/CloudFederationProviderFiles.php',
|
||||||
|
|
|
@ -0,0 +1,58 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
/**
|
||||||
|
* @copyright Copyright (c) 2020 Joas Schilling <coding@schilljs.com>
|
||||||
|
*
|
||||||
|
* @author Joas Schilling <coding@schilljs.com>
|
||||||
|
*
|
||||||
|
* @license GNU AGPL version 3 or any later version
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as
|
||||||
|
* published by the Free Software Foundation, either version 3 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
namespace OCA\FederatedFileSharing\Migration;
|
||||||
|
|
||||||
|
use Closure;
|
||||||
|
use Doctrine\DBAL\Types\Types;
|
||||||
|
use OCP\DB\ISchemaWrapper;
|
||||||
|
use OCP\Migration\IOutput;
|
||||||
|
use OCP\Migration\SimpleMigrationStep;
|
||||||
|
|
||||||
|
class Version1010Date20200630191755 extends SimpleMigrationStep {
|
||||||
|
/**
|
||||||
|
* @param IOutput $output
|
||||||
|
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
|
||||||
|
* @param array $options
|
||||||
|
* @return null|ISchemaWrapper
|
||||||
|
*/
|
||||||
|
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) {
|
||||||
|
/** @var ISchemaWrapper $schema */
|
||||||
|
$schema = $schemaClosure();
|
||||||
|
|
||||||
|
if (!$schema->hasTable('federated_reshares')) {
|
||||||
|
$table = $schema->createTable('federated_reshares');
|
||||||
|
$table->addColumn('share_id', Types::INTEGER, [
|
||||||
|
'notnull' => true,
|
||||||
|
'length' => 4,
|
||||||
|
]);
|
||||||
|
$table->addColumn('remote_id', Types::INTEGER, [
|
||||||
|
'notnull' => true,
|
||||||
|
'length' => 4,
|
||||||
|
]);
|
||||||
|
$table->addUniqueIndex(['share_id'], 'share_id_index');
|
||||||
|
}
|
||||||
|
return $schema;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,68 +0,0 @@
|
||||||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
|
||||||
<database>
|
|
||||||
<name>*dbname*</name>
|
|
||||||
<create>true</create>
|
|
||||||
<overwrite>false</overwrite>
|
|
||||||
<charset>utf8</charset>
|
|
||||||
<table>
|
|
||||||
<name>*dbprefix*trusted_servers</name>
|
|
||||||
<declaration>
|
|
||||||
<field>
|
|
||||||
<name>id</name>
|
|
||||||
<type>integer</type>
|
|
||||||
<default>0</default>
|
|
||||||
<notnull>true</notnull>
|
|
||||||
<autoincrement>1</autoincrement>
|
|
||||||
<length>4</length>
|
|
||||||
</field>
|
|
||||||
<field>
|
|
||||||
<name>url</name>
|
|
||||||
<type>text</type>
|
|
||||||
<notnull>true</notnull>
|
|
||||||
<length>512</length>
|
|
||||||
<comments>Url of trusted server</comments>
|
|
||||||
</field>
|
|
||||||
<field>
|
|
||||||
<name>url_hash</name>
|
|
||||||
<type>text</type>
|
|
||||||
<default></default>
|
|
||||||
<notnull>true</notnull>
|
|
||||||
<comments>sha1 hash of the url without the protocol</comments>
|
|
||||||
</field>
|
|
||||||
<field>
|
|
||||||
<name>token</name>
|
|
||||||
<type>text</type>
|
|
||||||
<length>128</length>
|
|
||||||
<comments>token used to exchange the shared secret</comments>
|
|
||||||
</field>
|
|
||||||
<field>
|
|
||||||
<name>shared_secret</name>
|
|
||||||
<type>text</type>
|
|
||||||
<length>256</length>
|
|
||||||
<comments>shared secret used to authenticate</comments>
|
|
||||||
</field>
|
|
||||||
<field>
|
|
||||||
<name>status</name>
|
|
||||||
<type>integer</type>
|
|
||||||
<length>4</length>
|
|
||||||
<notnull>true</notnull>
|
|
||||||
<default>2</default>
|
|
||||||
<comments>current status of the connection</comments>
|
|
||||||
</field>
|
|
||||||
<field>
|
|
||||||
<name>sync_token</name>
|
|
||||||
<type>text</type>
|
|
||||||
<length>512</length>
|
|
||||||
<comments>cardDav sync token</comments>
|
|
||||||
</field>
|
|
||||||
<index>
|
|
||||||
<name>url_hash</name>
|
|
||||||
<unique>true</unique>
|
|
||||||
<field>
|
|
||||||
<name>url_hash</name>
|
|
||||||
<sorting>ascending</sorting>
|
|
||||||
</field>
|
|
||||||
</index>
|
|
||||||
</declaration>
|
|
||||||
</table>
|
|
||||||
</database>
|
|
|
@ -5,7 +5,7 @@
|
||||||
<name>Federation</name>
|
<name>Federation</name>
|
||||||
<summary>Federation allows you to connect with other trusted servers to exchange the user directory.</summary>
|
<summary>Federation allows you to connect with other trusted servers to exchange the user directory.</summary>
|
||||||
<description>Federation allows you to connect with other trusted servers to exchange the user directory. For example this will be used to auto-complete external users for federated sharing.</description>
|
<description>Federation allows you to connect with other trusted servers to exchange the user directory. For example this will be used to auto-complete external users for federated sharing.</description>
|
||||||
<version>1.10.0</version>
|
<version>1.10.1</version>
|
||||||
<licence>agpl</licence>
|
<licence>agpl</licence>
|
||||||
<author>Bjoern Schiessle</author>
|
<author>Bjoern Schiessle</author>
|
||||||
<namespace>Federation</namespace>
|
<namespace>Federation</namespace>
|
||||||
|
|
|
@ -16,6 +16,7 @@ return array(
|
||||||
'OCA\\Federation\\DbHandler' => $baseDir . '/../lib/DbHandler.php',
|
'OCA\\Federation\\DbHandler' => $baseDir . '/../lib/DbHandler.php',
|
||||||
'OCA\\Federation\\Hooks' => $baseDir . '/../lib/Hooks.php',
|
'OCA\\Federation\\Hooks' => $baseDir . '/../lib/Hooks.php',
|
||||||
'OCA\\Federation\\Middleware\\AddServerMiddleware' => $baseDir . '/../lib/Middleware/AddServerMiddleware.php',
|
'OCA\\Federation\\Middleware\\AddServerMiddleware' => $baseDir . '/../lib/Middleware/AddServerMiddleware.php',
|
||||||
|
'OCA\\Federation\\Migration\\Version1010Date20200630191302' => $baseDir . '/../lib/Migration/Version1010Date20200630191302.php',
|
||||||
'OCA\\Federation\\Settings\\Admin' => $baseDir . '/../lib/Settings/Admin.php',
|
'OCA\\Federation\\Settings\\Admin' => $baseDir . '/../lib/Settings/Admin.php',
|
||||||
'OCA\\Federation\\SyncFederationAddressBooks' => $baseDir . '/../lib/SyncFederationAddressBooks.php',
|
'OCA\\Federation\\SyncFederationAddressBooks' => $baseDir . '/../lib/SyncFederationAddressBooks.php',
|
||||||
'OCA\\Federation\\SyncJob' => $baseDir . '/../lib/SyncJob.php',
|
'OCA\\Federation\\SyncJob' => $baseDir . '/../lib/SyncJob.php',
|
||||||
|
|
|
@ -31,6 +31,7 @@ class ComposerStaticInitFederation
|
||||||
'OCA\\Federation\\DbHandler' => __DIR__ . '/..' . '/../lib/DbHandler.php',
|
'OCA\\Federation\\DbHandler' => __DIR__ . '/..' . '/../lib/DbHandler.php',
|
||||||
'OCA\\Federation\\Hooks' => __DIR__ . '/..' . '/../lib/Hooks.php',
|
'OCA\\Federation\\Hooks' => __DIR__ . '/..' . '/../lib/Hooks.php',
|
||||||
'OCA\\Federation\\Middleware\\AddServerMiddleware' => __DIR__ . '/..' . '/../lib/Middleware/AddServerMiddleware.php',
|
'OCA\\Federation\\Middleware\\AddServerMiddleware' => __DIR__ . '/..' . '/../lib/Middleware/AddServerMiddleware.php',
|
||||||
|
'OCA\\Federation\\Migration\\Version1010Date20200630191302' => __DIR__ . '/..' . '/../lib/Migration/Version1010Date20200630191302.php',
|
||||||
'OCA\\Federation\\Settings\\Admin' => __DIR__ . '/..' . '/../lib/Settings/Admin.php',
|
'OCA\\Federation\\Settings\\Admin' => __DIR__ . '/..' . '/../lib/Settings/Admin.php',
|
||||||
'OCA\\Federation\\SyncFederationAddressBooks' => __DIR__ . '/..' . '/../lib/SyncFederationAddressBooks.php',
|
'OCA\\Federation\\SyncFederationAddressBooks' => __DIR__ . '/..' . '/../lib/SyncFederationAddressBooks.php',
|
||||||
'OCA\\Federation\\SyncJob' => __DIR__ . '/..' . '/../lib/SyncJob.php',
|
'OCA\\Federation\\SyncJob' => __DIR__ . '/..' . '/../lib/SyncJob.php',
|
||||||
|
|
|
@ -0,0 +1,83 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
/**
|
||||||
|
* @copyright Copyright (c) 2020 Joas Schilling <coding@schilljs.com>
|
||||||
|
*
|
||||||
|
* @author Joas Schilling <coding@schilljs.com>
|
||||||
|
*
|
||||||
|
* @license GNU AGPL version 3 or any later version
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as
|
||||||
|
* published by the Free Software Foundation, either version 3 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace OCA\Federation\Migration;
|
||||||
|
|
||||||
|
use Closure;
|
||||||
|
use Doctrine\DBAL\Types\Types;
|
||||||
|
use OCP\DB\ISchemaWrapper;
|
||||||
|
use OCP\Migration\IOutput;
|
||||||
|
use OCP\Migration\SimpleMigrationStep;
|
||||||
|
|
||||||
|
class Version1010Date20200630191302 extends SimpleMigrationStep {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param IOutput $output
|
||||||
|
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
|
||||||
|
* @param array $options
|
||||||
|
* @return null|ISchemaWrapper
|
||||||
|
*/
|
||||||
|
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) {
|
||||||
|
/** @var ISchemaWrapper $schema */
|
||||||
|
$schema = $schemaClosure();
|
||||||
|
|
||||||
|
if (!$schema->hasTable('trusted_servers')) {
|
||||||
|
$table = $schema->createTable('trusted_servers');
|
||||||
|
$table->addColumn('id', Types::INTEGER, [
|
||||||
|
'autoincrement' => true,
|
||||||
|
'notnull' => true,
|
||||||
|
'length' => 4,
|
||||||
|
]);
|
||||||
|
$table->addColumn('url', Types::STRING, [
|
||||||
|
'notnull' => true,
|
||||||
|
'length' => 512,
|
||||||
|
]);
|
||||||
|
$table->addColumn('url_hash', Types::STRING, [
|
||||||
|
'notnull' => true,
|
||||||
|
'default' => '',
|
||||||
|
]);
|
||||||
|
$table->addColumn('token', Types::STRING, [
|
||||||
|
'notnull' => false,
|
||||||
|
'length' => 128,
|
||||||
|
]);
|
||||||
|
$table->addColumn('shared_secret', Types::STRING, [
|
||||||
|
'notnull' => false,
|
||||||
|
'length' => 256,
|
||||||
|
]);
|
||||||
|
$table->addColumn('status', Types::INTEGER, [
|
||||||
|
'notnull' => true,
|
||||||
|
'length' => 4,
|
||||||
|
'default' => 2,
|
||||||
|
]);
|
||||||
|
$table->addColumn('sync_token', Types::STRING, [
|
||||||
|
'notnull' => false,
|
||||||
|
'length' => 512,
|
||||||
|
]);
|
||||||
|
$table->setPrimaryKey(['id']);
|
||||||
|
$table->addUniqueIndex(['url_hash'], 'url_hash');
|
||||||
|
}
|
||||||
|
return $schema;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,225 +0,0 @@
|
||||||
<database>
|
|
||||||
<name>*dbname*</name>
|
|
||||||
<create>true</create>
|
|
||||||
<overwrite>false</overwrite>
|
|
||||||
<charset>utf8</charset>
|
|
||||||
<table>
|
|
||||||
<name>*dbprefix*external_mounts</name>
|
|
||||||
<declaration>
|
|
||||||
<field>
|
|
||||||
<name>mount_id</name>
|
|
||||||
<type>integer</type>
|
|
||||||
<default>0</default>
|
|
||||||
<notnull>true</notnull>
|
|
||||||
<autoincrement>1</autoincrement>
|
|
||||||
<length>6</length>
|
|
||||||
</field>
|
|
||||||
<field>
|
|
||||||
<name>mount_point</name>
|
|
||||||
<type>text</type>
|
|
||||||
<length>128</length>
|
|
||||||
<notnull>true</notnull>
|
|
||||||
</field>
|
|
||||||
<field>
|
|
||||||
<name>storage_backend</name>
|
|
||||||
<type>text</type>
|
|
||||||
<length>64</length>
|
|
||||||
<notnull>true</notnull>
|
|
||||||
</field>
|
|
||||||
<field>
|
|
||||||
<name>auth_backend</name>
|
|
||||||
<type>text</type>
|
|
||||||
<length>64</length>
|
|
||||||
<notnull>true</notnull>
|
|
||||||
</field>
|
|
||||||
<field>
|
|
||||||
<name>priority</name>
|
|
||||||
<type>integer</type>
|
|
||||||
<default>100</default>
|
|
||||||
<length>4</length>
|
|
||||||
<notnull>true</notnull>
|
|
||||||
</field>
|
|
||||||
<!-- admin = 1, personal = 2-->
|
|
||||||
<field>
|
|
||||||
<name>type</name>
|
|
||||||
<type>integer</type>
|
|
||||||
<length>4</length>
|
|
||||||
<notnull>true</notnull>
|
|
||||||
</field>
|
|
||||||
</declaration>
|
|
||||||
</table>
|
|
||||||
<table>
|
|
||||||
<name>*dbprefix*external_applicable</name>
|
|
||||||
<declaration>
|
|
||||||
<field>
|
|
||||||
<name>applicable_id</name>
|
|
||||||
<type>integer</type>
|
|
||||||
<default>0</default>
|
|
||||||
<notnull>true</notnull>
|
|
||||||
<autoincrement>1</autoincrement>
|
|
||||||
<length>6</length>
|
|
||||||
</field>
|
|
||||||
<field>
|
|
||||||
<!--foreign key: external_mounts.mount_id-->
|
|
||||||
<name>mount_id</name>
|
|
||||||
<type>integer</type>
|
|
||||||
<notnull>true</notnull>
|
|
||||||
<length>6</length>
|
|
||||||
</field>
|
|
||||||
<field>
|
|
||||||
<!-- possible mount types: global = 1, group = 2, user = 3 -->
|
|
||||||
<name>type</name>
|
|
||||||
<type>integer</type>
|
|
||||||
<length>4</length>
|
|
||||||
<notnull>true</notnull>
|
|
||||||
</field>
|
|
||||||
<field>
|
|
||||||
<!-- user_id, group_id or null for global mounts -->
|
|
||||||
<name>value</name>
|
|
||||||
<type>text</type>
|
|
||||||
<length>64</length>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<index>
|
|
||||||
<name>applicable_mount</name>
|
|
||||||
<field>
|
|
||||||
<name>mount_id</name>
|
|
||||||
<sorting>ascending</sorting>
|
|
||||||
</field>
|
|
||||||
</index>
|
|
||||||
<index>
|
|
||||||
<name>applicable_type_value</name>
|
|
||||||
<field>
|
|
||||||
<name>type</name>
|
|
||||||
<sorting>ascending</sorting>
|
|
||||||
</field>
|
|
||||||
<field>
|
|
||||||
<name>value</name>
|
|
||||||
<sorting>ascending</sorting>
|
|
||||||
</field>
|
|
||||||
</index>
|
|
||||||
<index>
|
|
||||||
<name>applicable_type_value_mount</name>
|
|
||||||
<unique>true</unique>
|
|
||||||
<field>
|
|
||||||
<name>type</name>
|
|
||||||
<sorting>ascending</sorting>
|
|
||||||
</field>
|
|
||||||
<field>
|
|
||||||
<name>value</name>
|
|
||||||
<sorting>ascending</sorting>
|
|
||||||
</field>
|
|
||||||
<field>
|
|
||||||
<name>mount_id</name>
|
|
||||||
<sorting>ascending</sorting>
|
|
||||||
</field>
|
|
||||||
</index>
|
|
||||||
</declaration>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<table>
|
|
||||||
<name>*dbprefix*external_config</name>
|
|
||||||
<declaration>
|
|
||||||
<field>
|
|
||||||
<name>config_id</name>
|
|
||||||
<type>integer</type>
|
|
||||||
<default>0</default>
|
|
||||||
<notnull>true</notnull>
|
|
||||||
<autoincrement>1</autoincrement>
|
|
||||||
<length>6</length>
|
|
||||||
</field>
|
|
||||||
<field>
|
|
||||||
<!--foreign key: external_mounts.mount_id-->
|
|
||||||
<name>mount_id</name>
|
|
||||||
<type>integer</type>
|
|
||||||
<notnull>true</notnull>
|
|
||||||
<length>6</length>
|
|
||||||
</field>
|
|
||||||
<field>
|
|
||||||
<name>key</name>
|
|
||||||
<type>text</type>
|
|
||||||
<notnull>true</notnull>
|
|
||||||
<length>64</length>
|
|
||||||
</field>
|
|
||||||
<field>
|
|
||||||
<name>value</name>
|
|
||||||
<type>text</type>
|
|
||||||
<notnull>false</notnull>
|
|
||||||
<length>4096</length>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<index>
|
|
||||||
<name>config_mount</name>
|
|
||||||
<field>
|
|
||||||
<name>mount_id</name>
|
|
||||||
<sorting>ascending</sorting>
|
|
||||||
</field>
|
|
||||||
</index>
|
|
||||||
<index>
|
|
||||||
<name>config_mount_key</name>
|
|
||||||
<unique>true</unique>
|
|
||||||
<field>
|
|
||||||
<name>mount_id</name>
|
|
||||||
<sorting>ascending</sorting>
|
|
||||||
</field>
|
|
||||||
<field>
|
|
||||||
<name>key</name>
|
|
||||||
<sorting>ascending</sorting>
|
|
||||||
</field>
|
|
||||||
</index>
|
|
||||||
</declaration>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<table>
|
|
||||||
<name>*dbprefix*external_options</name>
|
|
||||||
<declaration>
|
|
||||||
<field>
|
|
||||||
<name>option_id</name>
|
|
||||||
<type>integer</type>
|
|
||||||
<default>0</default>
|
|
||||||
<notnull>true</notnull>
|
|
||||||
<autoincrement>1</autoincrement>
|
|
||||||
<length>6</length>
|
|
||||||
</field>
|
|
||||||
<field>
|
|
||||||
<!--foreign key: external_mounts.mount_id-->
|
|
||||||
<name>mount_id</name>
|
|
||||||
<type>integer</type>
|
|
||||||
<notnull>true</notnull>
|
|
||||||
<length>6</length>
|
|
||||||
</field>
|
|
||||||
<field>
|
|
||||||
<name>key</name>
|
|
||||||
<type>text</type>
|
|
||||||
<notnull>true</notnull>
|
|
||||||
<length>64</length>
|
|
||||||
</field>
|
|
||||||
<field>
|
|
||||||
<name>value</name>
|
|
||||||
<type>text</type>
|
|
||||||
<notnull>true</notnull>
|
|
||||||
<length>256</length>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<index>
|
|
||||||
<name>option_mount</name>
|
|
||||||
<field>
|
|
||||||
<name>mount_id</name>
|
|
||||||
<sorting>ascending</sorting>
|
|
||||||
</field>
|
|
||||||
</index>
|
|
||||||
<index>
|
|
||||||
<name>option_mount_key</name>
|
|
||||||
<unique>true</unique>
|
|
||||||
<field>
|
|
||||||
<name>mount_id</name>
|
|
||||||
<sorting>ascending</sorting>
|
|
||||||
</field>
|
|
||||||
<field>
|
|
||||||
<name>key</name>
|
|
||||||
<sorting>ascending</sorting>
|
|
||||||
</field>
|
|
||||||
</index>
|
|
||||||
</declaration>
|
|
||||||
</table>
|
|
||||||
</database>
|
|
|
@ -9,7 +9,7 @@ This application enables administrators to configure connections to external sto
|
||||||
|
|
||||||
External storage can be configured using the GUI or at the command line. This second option provides the advanced user with more flexibility for configuring bulk external storage mounts and setting mount priorities. More information is available in the external storage GUI documentation and the external storage Configuration File documentation.
|
External storage can be configured using the GUI or at the command line. This second option provides the advanced user with more flexibility for configuring bulk external storage mounts and setting mount priorities. More information is available in the external storage GUI documentation and the external storage Configuration File documentation.
|
||||||
</description>
|
</description>
|
||||||
<version>1.11.0</version>
|
<version>1.11.1</version>
|
||||||
<licence>agpl</licence>
|
<licence>agpl</licence>
|
||||||
<author>Robin Appelman</author>
|
<author>Robin Appelman</author>
|
||||||
<author>Michael Gapczynski</author>
|
<author>Michael Gapczynski</author>
|
||||||
|
|
|
@ -0,0 +1,150 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
/**
|
||||||
|
* @copyright Copyright (c) 2020 Joas Schilling <coding@schilljs.com>
|
||||||
|
*
|
||||||
|
* @author Joas Schilling <coding@schilljs.com>
|
||||||
|
*
|
||||||
|
* @license GNU AGPL version 3 or any later version
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as
|
||||||
|
* published by the Free Software Foundation, either version 3 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace OCA\Files_External\Migration;
|
||||||
|
|
||||||
|
use Closure;
|
||||||
|
use Doctrine\DBAL\Types\Types;
|
||||||
|
use OCP\DB\ISchemaWrapper;
|
||||||
|
use OCP\Migration\IOutput;
|
||||||
|
use OCP\Migration\SimpleMigrationStep;
|
||||||
|
|
||||||
|
class Version1011Date20200630192246 extends SimpleMigrationStep {
|
||||||
|
/**
|
||||||
|
* @param IOutput $output
|
||||||
|
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
|
||||||
|
* @param array $options
|
||||||
|
* @return null|ISchemaWrapper
|
||||||
|
*/
|
||||||
|
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) {
|
||||||
|
/** @var ISchemaWrapper $schema */
|
||||||
|
$schema = $schemaClosure();
|
||||||
|
|
||||||
|
if (!$schema->hasTable('external_mounts')) {
|
||||||
|
$table = $schema->createTable('external_mounts');
|
||||||
|
$table->addColumn('mount_id', Types::BIGINT, [
|
||||||
|
'autoincrement' => true,
|
||||||
|
'notnull' => true,
|
||||||
|
'length' => 6,
|
||||||
|
]);
|
||||||
|
$table->addColumn('mount_point', Types::STRING, [
|
||||||
|
'notnull' => true,
|
||||||
|
'length' => 128,
|
||||||
|
]);
|
||||||
|
$table->addColumn('storage_backend', Types::STRING, [
|
||||||
|
'notnull' => true,
|
||||||
|
'length' => 64,
|
||||||
|
]);
|
||||||
|
$table->addColumn('auth_backend', Types::STRING, [
|
||||||
|
'notnull' => true,
|
||||||
|
'length' => 64,
|
||||||
|
]);
|
||||||
|
$table->addColumn('priority', Types::INTEGER, [
|
||||||
|
'notnull' => true,
|
||||||
|
'length' => 4,
|
||||||
|
'default' => 100,
|
||||||
|
]);
|
||||||
|
$table->addColumn('type', Types::INTEGER, [
|
||||||
|
'notnull' => true,
|
||||||
|
'length' => 4,
|
||||||
|
]);
|
||||||
|
$table->setPrimaryKey(['mount_id']);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$schema->hasTable('external_applicable')) {
|
||||||
|
$table = $schema->createTable('external_applicable');
|
||||||
|
$table->addColumn('applicable_id', Types::BIGINT, [
|
||||||
|
'autoincrement' => true,
|
||||||
|
'notnull' => true,
|
||||||
|
'length' => 6,
|
||||||
|
]);
|
||||||
|
$table->addColumn('mount_id', Types::BIGINT, [
|
||||||
|
'notnull' => true,
|
||||||
|
'length' => 6,
|
||||||
|
]);
|
||||||
|
$table->addColumn('type', Types::INTEGER, [
|
||||||
|
'notnull' => true,
|
||||||
|
'length' => 4,
|
||||||
|
]);
|
||||||
|
$table->addColumn('value', Types::STRING, [
|
||||||
|
'notnull' => false,
|
||||||
|
'length' => 64,
|
||||||
|
]);
|
||||||
|
$table->setPrimaryKey(['applicable_id']);
|
||||||
|
$table->addIndex(['mount_id'], 'applicable_mount');
|
||||||
|
$table->addIndex(['type', 'value'], 'applicable_type_value');
|
||||||
|
$table->addUniqueIndex(['type', 'value', 'mount_id'], 'applicable_type_value_mount');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$schema->hasTable('external_config')) {
|
||||||
|
$table = $schema->createTable('external_config');
|
||||||
|
$table->addColumn('config_id', Types::BIGINT, [
|
||||||
|
'autoincrement' => true,
|
||||||
|
'notnull' => true,
|
||||||
|
'length' => 6,
|
||||||
|
]);
|
||||||
|
$table->addColumn('mount_id', Types::BIGINT, [
|
||||||
|
'notnull' => true,
|
||||||
|
'length' => 6,
|
||||||
|
]);
|
||||||
|
$table->addColumn('key', Types::STRING, [
|
||||||
|
'notnull' => true,
|
||||||
|
'length' => 64,
|
||||||
|
]);
|
||||||
|
$table->addColumn('value', Types::STRING, [
|
||||||
|
'notnull' => false,
|
||||||
|
'length' => 4096,
|
||||||
|
]);
|
||||||
|
$table->setPrimaryKey(['config_id']);
|
||||||
|
$table->addIndex(['mount_id'], 'config_mount');
|
||||||
|
$table->addUniqueIndex(['mount_id', 'key'], 'config_mount_key');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$schema->hasTable('external_options')) {
|
||||||
|
$table = $schema->createTable('external_options');
|
||||||
|
$table->addColumn('option_id', Types::BIGINT, [
|
||||||
|
'autoincrement' => true,
|
||||||
|
'notnull' => true,
|
||||||
|
'length' => 6,
|
||||||
|
]);
|
||||||
|
$table->addColumn('mount_id', Types::BIGINT, [
|
||||||
|
'notnull' => true,
|
||||||
|
'length' => 6,
|
||||||
|
]);
|
||||||
|
$table->addColumn('key', Types::STRING, [
|
||||||
|
'notnull' => true,
|
||||||
|
'length' => 64,
|
||||||
|
]);
|
||||||
|
$table->addColumn('value', Types::STRING, [
|
||||||
|
'notnull' => true,
|
||||||
|
'length' => 256,
|
||||||
|
]);
|
||||||
|
$table->setPrimaryKey(['option_id']);
|
||||||
|
$table->addIndex(['mount_id'], 'option_mount');
|
||||||
|
$table->addUniqueIndex(['mount_id', 'key'], 'option_mount_key');
|
||||||
|
}
|
||||||
|
return $schema;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,101 +0,0 @@
|
||||||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
|
||||||
<database>
|
|
||||||
|
|
||||||
<name>*dbname*</name>
|
|
||||||
<create>true</create>
|
|
||||||
<overwrite>false</overwrite>
|
|
||||||
|
|
||||||
<charset>utf8</charset>
|
|
||||||
|
|
||||||
<table>
|
|
||||||
|
|
||||||
<name>*dbprefix*files_trash</name>
|
|
||||||
|
|
||||||
<declaration>
|
|
||||||
|
|
||||||
<field>
|
|
||||||
<name>auto_id</name>
|
|
||||||
<type>integer</type>
|
|
||||||
<default>0</default>
|
|
||||||
<notnull>true</notnull>
|
|
||||||
<autoincrement>1</autoincrement>
|
|
||||||
<length>4</length>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field>
|
|
||||||
<name>id</name>
|
|
||||||
<type>text</type>
|
|
||||||
<default></default>
|
|
||||||
<notnull>true</notnull>
|
|
||||||
<length>250</length>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field>
|
|
||||||
<name>user</name>
|
|
||||||
<type>text</type>
|
|
||||||
<default></default>
|
|
||||||
<notnull>true</notnull>
|
|
||||||
<length>64</length>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field>
|
|
||||||
<name>timestamp</name>
|
|
||||||
<type>text</type>
|
|
||||||
<default></default>
|
|
||||||
<notnull>true</notnull>
|
|
||||||
<length>12</length>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field>
|
|
||||||
<name>location</name>
|
|
||||||
<type>text</type>
|
|
||||||
<default></default>
|
|
||||||
<notnull>true</notnull>
|
|
||||||
<length>512</length>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field>
|
|
||||||
<name>type</name>
|
|
||||||
<type>text</type>
|
|
||||||
<default></default>
|
|
||||||
<notnull>false</notnull>
|
|
||||||
<length>4</length>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field>
|
|
||||||
<name>mime</name>
|
|
||||||
<type>text</type>
|
|
||||||
<default></default>
|
|
||||||
<notnull>false</notnull>
|
|
||||||
<length>255</length>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<index>
|
|
||||||
<name>id_index</name>
|
|
||||||
<field>
|
|
||||||
<name>id</name>
|
|
||||||
<sorting>ascending</sorting>
|
|
||||||
</field>
|
|
||||||
</index>
|
|
||||||
|
|
||||||
<index>
|
|
||||||
<name>timestamp_index</name>
|
|
||||||
<field>
|
|
||||||
<name>timestamp</name>
|
|
||||||
<sorting>ascending</sorting>
|
|
||||||
</field>
|
|
||||||
</index>
|
|
||||||
|
|
||||||
<index>
|
|
||||||
<name>user_index</name>
|
|
||||||
<field>
|
|
||||||
<name>user</name>
|
|
||||||
<sorting>ascending</sorting>
|
|
||||||
</field>
|
|
||||||
</index>
|
|
||||||
|
|
||||||
</declaration>
|
|
||||||
|
|
||||||
</table>
|
|
||||||
|
|
||||||
</database>
|
|
|
@ -9,7 +9,7 @@ This application enables users to restore files that were deleted from the syste
|
||||||
To prevent a user from running out of disk space, the Deleted files app will not utilize more than 50% of the currently available free quota for deleted files. If the deleted files exceed this limit, the app deletes the oldest files until it gets below this limit. More information is available in the Deleted Files documentation.
|
To prevent a user from running out of disk space, the Deleted files app will not utilize more than 50% of the currently available free quota for deleted files. If the deleted files exceed this limit, the app deletes the oldest files until it gets below this limit. More information is available in the Deleted Files documentation.
|
||||||
|
|
||||||
</description>
|
</description>
|
||||||
<version>1.10.0</version>
|
<version>1.10.1</version>
|
||||||
<licence>agpl</licence>
|
<licence>agpl</licence>
|
||||||
<author>Bjoern Schiessle</author>
|
<author>Bjoern Schiessle</author>
|
||||||
<namespace>Files_Trashbin</namespace>
|
<namespace>Files_Trashbin</namespace>
|
||||||
|
|
|
@ -18,6 +18,7 @@ return array(
|
||||||
'OCA\\Files_Trashbin\\Expiration' => $baseDir . '/../lib/Expiration.php',
|
'OCA\\Files_Trashbin\\Expiration' => $baseDir . '/../lib/Expiration.php',
|
||||||
'OCA\\Files_Trashbin\\Helper' => $baseDir . '/../lib/Helper.php',
|
'OCA\\Files_Trashbin\\Helper' => $baseDir . '/../lib/Helper.php',
|
||||||
'OCA\\Files_Trashbin\\Hooks' => $baseDir . '/../lib/Hooks.php',
|
'OCA\\Files_Trashbin\\Hooks' => $baseDir . '/../lib/Hooks.php',
|
||||||
|
'OCA\\Files_Trashbin\\Migration\\Version1010Date20200630192639' => $baseDir . '/../lib/Migration/Version1010Date20200630192639.php',
|
||||||
'OCA\\Files_Trashbin\\Sabre\\AbstractTrash' => $baseDir . '/../lib/Sabre/AbstractTrash.php',
|
'OCA\\Files_Trashbin\\Sabre\\AbstractTrash' => $baseDir . '/../lib/Sabre/AbstractTrash.php',
|
||||||
'OCA\\Files_Trashbin\\Sabre\\AbstractTrashFile' => $baseDir . '/../lib/Sabre/AbstractTrashFile.php',
|
'OCA\\Files_Trashbin\\Sabre\\AbstractTrashFile' => $baseDir . '/../lib/Sabre/AbstractTrashFile.php',
|
||||||
'OCA\\Files_Trashbin\\Sabre\\AbstractTrashFolder' => $baseDir . '/../lib/Sabre/AbstractTrashFolder.php',
|
'OCA\\Files_Trashbin\\Sabre\\AbstractTrashFolder' => $baseDir . '/../lib/Sabre/AbstractTrashFolder.php',
|
||||||
|
|
|
@ -33,6 +33,7 @@ class ComposerStaticInitFiles_Trashbin
|
||||||
'OCA\\Files_Trashbin\\Expiration' => __DIR__ . '/..' . '/../lib/Expiration.php',
|
'OCA\\Files_Trashbin\\Expiration' => __DIR__ . '/..' . '/../lib/Expiration.php',
|
||||||
'OCA\\Files_Trashbin\\Helper' => __DIR__ . '/..' . '/../lib/Helper.php',
|
'OCA\\Files_Trashbin\\Helper' => __DIR__ . '/..' . '/../lib/Helper.php',
|
||||||
'OCA\\Files_Trashbin\\Hooks' => __DIR__ . '/..' . '/../lib/Hooks.php',
|
'OCA\\Files_Trashbin\\Hooks' => __DIR__ . '/..' . '/../lib/Hooks.php',
|
||||||
|
'OCA\\Files_Trashbin\\Migration\\Version1010Date20200630192639' => __DIR__ . '/..' . '/../lib/Migration/Version1010Date20200630192639.php',
|
||||||
'OCA\\Files_Trashbin\\Sabre\\AbstractTrash' => __DIR__ . '/..' . '/../lib/Sabre/AbstractTrash.php',
|
'OCA\\Files_Trashbin\\Sabre\\AbstractTrash' => __DIR__ . '/..' . '/../lib/Sabre/AbstractTrash.php',
|
||||||
'OCA\\Files_Trashbin\\Sabre\\AbstractTrashFile' => __DIR__ . '/..' . '/../lib/Sabre/AbstractTrashFile.php',
|
'OCA\\Files_Trashbin\\Sabre\\AbstractTrashFile' => __DIR__ . '/..' . '/../lib/Sabre/AbstractTrashFile.php',
|
||||||
'OCA\\Files_Trashbin\\Sabre\\AbstractTrashFolder' => __DIR__ . '/..' . '/../lib/Sabre/AbstractTrashFolder.php',
|
'OCA\\Files_Trashbin\\Sabre\\AbstractTrashFolder' => __DIR__ . '/..' . '/../lib/Sabre/AbstractTrashFolder.php',
|
||||||
|
|
|
@ -0,0 +1,87 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
/**
|
||||||
|
* @copyright Copyright (c) 2020 Joas Schilling <coding@schilljs.com>
|
||||||
|
*
|
||||||
|
* @author Joas Schilling <coding@schilljs.com>
|
||||||
|
*
|
||||||
|
* @license GNU AGPL version 3 or any later version
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as
|
||||||
|
* published by the Free Software Foundation, either version 3 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace OCA\Files_Trashbin\Migration;
|
||||||
|
|
||||||
|
use Closure;
|
||||||
|
use Doctrine\DBAL\Types\Types;
|
||||||
|
use OCP\DB\ISchemaWrapper;
|
||||||
|
use OCP\Migration\IOutput;
|
||||||
|
use OCP\Migration\SimpleMigrationStep;
|
||||||
|
|
||||||
|
class Version1010Date20200630192639 extends SimpleMigrationStep {
|
||||||
|
/**
|
||||||
|
* @param IOutput $output
|
||||||
|
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
|
||||||
|
* @param array $options
|
||||||
|
* @return null|ISchemaWrapper
|
||||||
|
*/
|
||||||
|
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) {
|
||||||
|
/** @var ISchemaWrapper $schema */
|
||||||
|
$schema = $schemaClosure();
|
||||||
|
|
||||||
|
if (!$schema->hasTable('files_trash')) {
|
||||||
|
$table = $schema->createTable('files_trash');
|
||||||
|
$table->addColumn('auto_id', Types::INTEGER, [
|
||||||
|
'autoincrement' => true,
|
||||||
|
'notnull' => true,
|
||||||
|
'length' => 4,
|
||||||
|
]);
|
||||||
|
$table->addColumn('id', Types::STRING, [
|
||||||
|
'notnull' => true,
|
||||||
|
'length' => 250,
|
||||||
|
'default' => '',
|
||||||
|
]);
|
||||||
|
$table->addColumn('user', Types::STRING, [
|
||||||
|
'notnull' => true,
|
||||||
|
'length' => 64,
|
||||||
|
'default' => '',
|
||||||
|
]);
|
||||||
|
$table->addColumn('timestamp', Types::STRING, [
|
||||||
|
'notnull' => true,
|
||||||
|
'length' => 12,
|
||||||
|
'default' => '',
|
||||||
|
]);
|
||||||
|
$table->addColumn('location', Types::STRING, [
|
||||||
|
'notnull' => true,
|
||||||
|
'length' => 512,
|
||||||
|
'default' => '',
|
||||||
|
]);
|
||||||
|
$table->addColumn('type', Types::STRING, [
|
||||||
|
'notnull' => false,
|
||||||
|
'length' => 4,
|
||||||
|
]);
|
||||||
|
$table->addColumn('mime', Types::STRING, [
|
||||||
|
'notnull' => false,
|
||||||
|
'length' => 255,
|
||||||
|
]);
|
||||||
|
$table->setPrimaryKey(['auto_id']);
|
||||||
|
$table->addIndex(['id'], 'id_index');
|
||||||
|
$table->addIndex(['timestamp'], 'timestamp_index');
|
||||||
|
$table->addIndex(['user'], 'user_index');
|
||||||
|
}
|
||||||
|
return $schema;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,147 +0,0 @@
|
||||||
<?xml version="1.0" encoding="ISO-8859-1" ?>
|
|
||||||
<database>
|
|
||||||
|
|
||||||
<name>*dbname*</name>
|
|
||||||
<create>true</create>
|
|
||||||
<overwrite>false</overwrite>
|
|
||||||
<charset>utf8</charset>
|
|
||||||
|
|
||||||
<table>
|
|
||||||
|
|
||||||
<name>*dbprefix*ldap_user_mapping</name>
|
|
||||||
|
|
||||||
<declaration>
|
|
||||||
|
|
||||||
<field>
|
|
||||||
<name>ldap_dn</name>
|
|
||||||
<type>text</type>
|
|
||||||
<notnull>true</notnull>
|
|
||||||
<length>255</length>
|
|
||||||
<default></default>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field>
|
|
||||||
<name>owncloud_name</name>
|
|
||||||
<type>text</type>
|
|
||||||
<notnull>true</notnull>
|
|
||||||
<length>255</length>
|
|
||||||
<default></default>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field>
|
|
||||||
<name>directory_uuid</name>
|
|
||||||
<type>text</type>
|
|
||||||
<notnull>true</notnull>
|
|
||||||
<length>255</length>
|
|
||||||
<default></default>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<index>
|
|
||||||
<name>ldap_dn_users</name>
|
|
||||||
<unique>true</unique>
|
|
||||||
<field>
|
|
||||||
<name>ldap_dn</name>
|
|
||||||
</field>
|
|
||||||
</index>
|
|
||||||
|
|
||||||
<index>
|
|
||||||
<name>owncloud_name_users</name>
|
|
||||||
<primary>true</primary>
|
|
||||||
<unique>true</unique>
|
|
||||||
<field>
|
|
||||||
<name>owncloud_name</name>
|
|
||||||
<sorting>ascending</sorting>
|
|
||||||
</field>
|
|
||||||
</index>
|
|
||||||
|
|
||||||
</declaration>
|
|
||||||
|
|
||||||
</table>
|
|
||||||
|
|
||||||
<table>
|
|
||||||
|
|
||||||
<name>*dbprefix*ldap_group_mapping</name>
|
|
||||||
|
|
||||||
<declaration>
|
|
||||||
|
|
||||||
<field>
|
|
||||||
<name>ldap_dn</name>
|
|
||||||
<type>text</type>
|
|
||||||
<notnull>true</notnull>
|
|
||||||
<length>255</length>
|
|
||||||
<default></default>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field>
|
|
||||||
<name>owncloud_name</name>
|
|
||||||
<type>text</type>
|
|
||||||
<notnull>true</notnull>
|
|
||||||
<length>255</length>
|
|
||||||
<default></default>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field>
|
|
||||||
<name>directory_uuid</name>
|
|
||||||
<type>text</type>
|
|
||||||
<notnull>true</notnull>
|
|
||||||
<length>255</length>
|
|
||||||
<default></default>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<index>
|
|
||||||
<name>ldap_dn_groups</name>
|
|
||||||
<unique>true</unique>
|
|
||||||
<primary>true</primary>
|
|
||||||
<field>
|
|
||||||
<name>ldap_dn</name>
|
|
||||||
</field>
|
|
||||||
</index>
|
|
||||||
|
|
||||||
<index>
|
|
||||||
<name>owncloud_name_groups</name>
|
|
||||||
<unique>true</unique>
|
|
||||||
<field>
|
|
||||||
<name>owncloud_name</name>
|
|
||||||
<sorting>ascending</sorting>
|
|
||||||
</field>
|
|
||||||
</index>
|
|
||||||
|
|
||||||
</declaration>
|
|
||||||
|
|
||||||
</table>
|
|
||||||
|
|
||||||
|
|
||||||
<table>
|
|
||||||
|
|
||||||
<name>*dbprefix*ldap_group_members</name>
|
|
||||||
|
|
||||||
<declaration>
|
|
||||||
|
|
||||||
<field>
|
|
||||||
<name>owncloudname</name>
|
|
||||||
<type>text</type>
|
|
||||||
<notnull>true</notnull>
|
|
||||||
<length>255</length>
|
|
||||||
<default></default>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<field>
|
|
||||||
<name>owncloudusers</name>
|
|
||||||
<type>clob</type>
|
|
||||||
<notnull>true</notnull>
|
|
||||||
</field>
|
|
||||||
|
|
||||||
<index>
|
|
||||||
<name>ldap_group_members_index</name>
|
|
||||||
<unique>true</unique>
|
|
||||||
<primary>true</primary>
|
|
||||||
<field>
|
|
||||||
<name>owncloudname</name>
|
|
||||||
</field>
|
|
||||||
</index>
|
|
||||||
|
|
||||||
</declaration>
|
|
||||||
|
|
||||||
</table>
|
|
||||||
|
|
||||||
</database>
|
|
|
@ -9,7 +9,7 @@
|
||||||
A user logs into Nextcloud with their LDAP or AD credentials, and is granted access based on an authentication request handled by the LDAP or AD server. Nextcloud does not store LDAP or AD passwords, rather these credentials are used to authenticate a user and then Nextcloud uses a session for the user ID. More information is available in the LDAP User and Group Backend documentation.
|
A user logs into Nextcloud with their LDAP or AD credentials, and is granted access based on an authentication request handled by the LDAP or AD server. Nextcloud does not store LDAP or AD passwords, rather these credentials are used to authenticate a user and then Nextcloud uses a session for the user ID. More information is available in the LDAP User and Group Backend documentation.
|
||||||
|
|
||||||
</description>
|
</description>
|
||||||
<version>1.10.0</version>
|
<version>1.10.1</version>
|
||||||
<licence>agpl</licence>
|
<licence>agpl</licence>
|
||||||
<author>Dominik Schmidt</author>
|
<author>Dominik Schmidt</author>
|
||||||
<author>Arthur Schiwon</author>
|
<author>Arthur Schiwon</author>
|
||||||
|
|
|
@ -52,6 +52,7 @@ return array(
|
||||||
'OCA\\User_LDAP\\Migration\\UUIDFixGroup' => $baseDir . '/../lib/Migration/UUIDFixGroup.php',
|
'OCA\\User_LDAP\\Migration\\UUIDFixGroup' => $baseDir . '/../lib/Migration/UUIDFixGroup.php',
|
||||||
'OCA\\User_LDAP\\Migration\\UUIDFixInsert' => $baseDir . '/../lib/Migration/UUIDFixInsert.php',
|
'OCA\\User_LDAP\\Migration\\UUIDFixInsert' => $baseDir . '/../lib/Migration/UUIDFixInsert.php',
|
||||||
'OCA\\User_LDAP\\Migration\\UUIDFixUser' => $baseDir . '/../lib/Migration/UUIDFixUser.php',
|
'OCA\\User_LDAP\\Migration\\UUIDFixUser' => $baseDir . '/../lib/Migration/UUIDFixUser.php',
|
||||||
|
'OCA\\User_LDAP\\Migration\\Version1010Date20200630192842' => $baseDir . '/../lib/Migration/Version1010Date20200630192842.php',
|
||||||
'OCA\\User_LDAP\\Notification\\Notifier' => $baseDir . '/../lib/Notification/Notifier.php',
|
'OCA\\User_LDAP\\Notification\\Notifier' => $baseDir . '/../lib/Notification/Notifier.php',
|
||||||
'OCA\\User_LDAP\\PagedResults\\IAdapter' => $baseDir . '/../lib/PagedResults/IAdapter.php',
|
'OCA\\User_LDAP\\PagedResults\\IAdapter' => $baseDir . '/../lib/PagedResults/IAdapter.php',
|
||||||
'OCA\\User_LDAP\\PagedResults\\Php54' => $baseDir . '/../lib/PagedResults/Php54.php',
|
'OCA\\User_LDAP\\PagedResults\\Php54' => $baseDir . '/../lib/PagedResults/Php54.php',
|
||||||
|
|
|
@ -67,6 +67,7 @@ class ComposerStaticInitUser_LDAP
|
||||||
'OCA\\User_LDAP\\Migration\\UUIDFixGroup' => __DIR__ . '/..' . '/../lib/Migration/UUIDFixGroup.php',
|
'OCA\\User_LDAP\\Migration\\UUIDFixGroup' => __DIR__ . '/..' . '/../lib/Migration/UUIDFixGroup.php',
|
||||||
'OCA\\User_LDAP\\Migration\\UUIDFixInsert' => __DIR__ . '/..' . '/../lib/Migration/UUIDFixInsert.php',
|
'OCA\\User_LDAP\\Migration\\UUIDFixInsert' => __DIR__ . '/..' . '/../lib/Migration/UUIDFixInsert.php',
|
||||||
'OCA\\User_LDAP\\Migration\\UUIDFixUser' => __DIR__ . '/..' . '/../lib/Migration/UUIDFixUser.php',
|
'OCA\\User_LDAP\\Migration\\UUIDFixUser' => __DIR__ . '/..' . '/../lib/Migration/UUIDFixUser.php',
|
||||||
|
'OCA\\User_LDAP\\Migration\\Version1010Date20200630192842' => __DIR__ . '/..' . '/../lib/Migration/Version1010Date20200630192842.php',
|
||||||
'OCA\\User_LDAP\\Notification\\Notifier' => __DIR__ . '/..' . '/../lib/Notification/Notifier.php',
|
'OCA\\User_LDAP\\Notification\\Notifier' => __DIR__ . '/..' . '/../lib/Notification/Notifier.php',
|
||||||
'OCA\\User_LDAP\\PagedResults\\IAdapter' => __DIR__ . '/..' . '/../lib/PagedResults/IAdapter.php',
|
'OCA\\User_LDAP\\PagedResults\\IAdapter' => __DIR__ . '/..' . '/../lib/PagedResults/IAdapter.php',
|
||||||
'OCA\\User_LDAP\\PagedResults\\Php54' => __DIR__ . '/..' . '/../lib/PagedResults/Php54.php',
|
'OCA\\User_LDAP\\PagedResults\\Php54' => __DIR__ . '/..' . '/../lib/PagedResults/Php54.php',
|
||||||
|
|
|
@ -0,0 +1,101 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
/**
|
||||||
|
* @copyright Copyright (c) 2020 Joas Schilling <coding@schilljs.com>
|
||||||
|
*
|
||||||
|
* @author Joas Schilling <coding@schilljs.com>
|
||||||
|
*
|
||||||
|
* @license GNU AGPL version 3 or any later version
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as
|
||||||
|
* published by the Free Software Foundation, either version 3 of the
|
||||||
|
* License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace OCA\User_LDAP\Migration;
|
||||||
|
|
||||||
|
use Closure;
|
||||||
|
use Doctrine\DBAL\Types\Types;
|
||||||
|
use OCP\DB\ISchemaWrapper;
|
||||||
|
use OCP\Migration\IOutput;
|
||||||
|
use OCP\Migration\SimpleMigrationStep;
|
||||||
|
|
||||||
|
class Version1010Date20200630192842 extends SimpleMigrationStep {
|
||||||
|
/**
|
||||||
|
* @param IOutput $output
|
||||||
|
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
|
||||||
|
* @param array $options
|
||||||
|
* @return null|ISchemaWrapper
|
||||||
|
*/
|
||||||
|
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) {
|
||||||
|
/** @var ISchemaWrapper $schema */
|
||||||
|
$schema = $schemaClosure();
|
||||||
|
|
||||||
|
if (!$schema->hasTable('ldap_user_mapping')) {
|
||||||
|
$table = $schema->createTable('ldap_user_mapping');
|
||||||
|
$table->addColumn('ldap_dn', Types::STRING, [
|
||||||
|
'notnull' => true,
|
||||||
|
'length' => 255,
|
||||||
|
'default' => '',
|
||||||
|
]);
|
||||||
|
$table->addColumn('owncloud_name', Types::STRING, [
|
||||||
|
'notnull' => true,
|
||||||
|
'length' => 255,
|
||||||
|
'default' => '',
|
||||||
|
]);
|
||||||
|
$table->addColumn('directory_uuid', Types::STRING, [
|
||||||
|
'notnull' => true,
|
||||||
|
'length' => 255,
|
||||||
|
'default' => '',
|
||||||
|
]);
|
||||||
|
$table->setPrimaryKey(['owncloud_name']);
|
||||||
|
$table->addUniqueIndex(['ldap_dn'], 'ldap_dn_users');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$schema->hasTable('ldap_group_mapping')) {
|
||||||
|
$table = $schema->createTable('ldap_group_mapping');
|
||||||
|
$table->addColumn('ldap_dn', Types::STRING, [
|
||||||
|
'notnull' => true,
|
||||||
|
'length' => 255,
|
||||||
|
'default' => '',
|
||||||
|
]);
|
||||||
|
$table->addColumn('owncloud_name', Types::STRING, [
|
||||||
|
'notnull' => true,
|
||||||
|
'length' => 255,
|
||||||
|
'default' => '',
|
||||||
|
]);
|
||||||
|
$table->addColumn('directory_uuid', Types::STRING, [
|
||||||
|
'notnull' => true,
|
||||||
|
'length' => 255,
|
||||||
|
'default' => '',
|
||||||
|
]);
|
||||||
|
$table->setPrimaryKey(['ldap_dn']);
|
||||||
|
$table->addUniqueIndex(['owncloud_name'], 'owncloud_name_groups');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$schema->hasTable('ldap_group_members')) {
|
||||||
|
$table = $schema->createTable('ldap_group_members');
|
||||||
|
$table->addColumn('owncloudname', Types::STRING, [
|
||||||
|
'notnull' => true,
|
||||||
|
'length' => 255,
|
||||||
|
'default' => '',
|
||||||
|
]);
|
||||||
|
$table->addColumn('owncloudusers', Types::TEXT, [
|
||||||
|
'notnull' => true,
|
||||||
|
]);
|
||||||
|
$table->setPrimaryKey(['owncloudname']);
|
||||||
|
}
|
||||||
|
return $schema;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue