1
0

Version14000Date20180518120534.php 892 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OC\Core\Migrations;
  8. use OCP\DB\ISchemaWrapper;
  9. use OCP\Migration\IOutput;
  10. use OCP\Migration\SimpleMigrationStep;
  11. class Version14000Date20180518120534 extends SimpleMigrationStep {
  12. public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
  13. /** @var ISchemaWrapper $schema */
  14. $schema = $schemaClosure();
  15. $table = $schema->getTable('authtoken');
  16. $table->addColumn('private_key', 'text', [
  17. 'notnull' => false,
  18. ]);
  19. $table->addColumn('public_key', 'text', [
  20. 'notnull' => false,
  21. ]);
  22. $table->addColumn('version', 'smallint', [
  23. 'notnull' => true,
  24. 'default' => 1,
  25. 'unsigned' => true,
  26. ]);
  27. $table->addIndex(['uid'], 'authtoken_uid_index');
  28. return $schema;
  29. }
  30. }