diff options
author | Robin Appelman <robin@icewind.nl> | 2022-02-02 16:12:57 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2022-02-23 18:02:33 +0100 |
commit | cfb7923e08ba1902fa5a5f72205cfcbb767b54ad (patch) | |
tree | 1641f6d5c32d3e4c822bac90ceab2d6f326797b6 /core/Migrations | |
parent | 692da9236bde4a0d6d78cf8ee44bd574fec5b623 (diff) | |
download | nextcloud-server-cfb7923e08ba1902fa5a5f72205cfcbb767b54ad.tar.gz nextcloud-server-cfb7923e08ba1902fa5a5f72205cfcbb767b54ad.zip |
store mountprovider for each mount in the mounts table
this enabled more fine grained filesystem setup
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'core/Migrations')
-rw-r--r-- | core/Migrations/Version240000Date20220202150027.php | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/core/Migrations/Version240000Date20220202150027.php b/core/Migrations/Version240000Date20220202150027.php new file mode 100644 index 00000000000..b13afa67d1e --- /dev/null +++ b/core/Migrations/Version240000Date20220202150027.php @@ -0,0 +1,37 @@ +<?php + +declare(strict_types=1); + +namespace OC\Core\Migrations; + +use Closure; +use OCP\DB\ISchemaWrapper; +use OCP\DB\Types; +use OCP\Migration\IOutput; +use OCP\Migration\SimpleMigrationStep; + +/** + * Auto-generated migration step: Please modify to your needs! + */ +class Version240000Date20220202150027 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): ?ISchemaWrapper { + /** @var ISchemaWrapper $schema */ + $schema = $schemaClosure(); + + $table = $schema->getTable('mounts'); + if (!$table->hasColumn('mount_provider_class')) { + $table->addColumn('mount_provider_class', Types::STRING, [ + 'notnull' => false, + 'length' => 128, + ]); + return $schema; + } + return null; + } +} |