diff options
author | Joas Schilling <coding@schilljs.com> | 2017-08-14 09:52:07 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2017-08-14 09:52:41 +0200 |
commit | 601f7951220fcbf896b8f50b772890f8adeb6267 (patch) | |
tree | ff6dbea2d3737e5c313d2ed57eb0be764af5e324 /core/Migrations/Version13000Date20170814074715.php | |
parent | 073216e8278983abef6ac51d6e0a900f95af0024 (diff) | |
download | nextcloud-server-601f7951220fcbf896b8f50b772890f8adeb6267.tar.gz nextcloud-server-601f7951220fcbf896b8f50b772890f8adeb6267.zip |
Make sure the accounts table exists
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'core/Migrations/Version13000Date20170814074715.php')
-rw-r--r-- | core/Migrations/Version13000Date20170814074715.php | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/core/Migrations/Version13000Date20170814074715.php b/core/Migrations/Version13000Date20170814074715.php new file mode 100644 index 00000000000..764ab8ab84e --- /dev/null +++ b/core/Migrations/Version13000Date20170814074715.php @@ -0,0 +1,59 @@ +<?php +namespace OC\Core\Migrations; + +use Doctrine\DBAL\Schema\Schema; +use OCP\Migration\SimpleMigrationStep; +use OCP\Migration\IOutput; + +/** + * Auto-generated migration step: Please modify to your needs! + */ +class Version13000Date20170814074715 extends SimpleMigrationStep { + + /** + * @param IOutput $output + * @param \Closure $schemaClosure The `\Closure` returns a `Schema` + * @param array $options + * @since 13.0.0 + */ + public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options) { + } + + /** + * @param IOutput $output + * @param \Closure $schemaClosure The `\Closure` returns a `Schema` + * @param array $options + * @return null|Schema + * @since 13.0.0 + */ + public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) { + /** @var Schema $schema */ + $schema = $schemaClosure(); + + + if (!$schema->hasTable('accounts')) { + $table = $schema->createTable('accounts'); + $table->addColumn('uid', 'string', [ + 'notnull' => true, + 'length' => 64, + 'default' => '', + ]); + $table->addColumn('data', 'text', [ + 'notnull' => true, + 'default' => '', + ]); + $table->setPrimaryKey(['uid']); + } + + return $schema; + } + + /** + * @param IOutput $output + * @param \Closure $schemaClosure The `\Closure` returns a `Schema` + * @param array $options + * @since 13.0.0 + */ + public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options) { + } +} |