diff options
Diffstat (limited to 'lib/Migration/Version100Date20190217131943.php')
-rw-r--r-- | lib/Migration/Version100Date20190217131943.php | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/lib/Migration/Version100Date20190217131943.php b/lib/Migration/Version100Date20190217131943.php new file mode 100644 index 0000000..731c375 --- /dev/null +++ b/lib/Migration/Version100Date20190217131943.php @@ -0,0 +1,49 @@ +<?php + +declare(strict_types=1); + +namespace OCA\Privacy\Migration; + +use Closure; +use OCP\DB\ISchemaWrapper; +use OCP\Migration\SimpleMigrationStep; +use OCP\Migration\IOutput; + +/** + * Auto-generated migration step: Please modify to your needs! + */ +class Version100Date20190217131943 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(); + + /* + * Schema generated from database.xml but required changes for + * https://github.com/nextcloud/mail/issues/784 already applied. + */ + + if (!$schema->hasTable('privacy_admins')) { + $table = $schema->createTable('privacy_admins'); + $table->addColumn('id', 'integer', [ + 'autoincrement' => true, + 'notnull' => true, + 'length' => 4, + ]); + $table->addColumn('displayname', 'string', [ + 'notnull' => true, + 'length' => 64, + 'default' => '', + ]); + $table->setPrimaryKey(['id']); + } + + return $schema; + } +} |