You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Version14000Date20180516101403.php 925B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
  4. * SPDX-License-Identifier: AGPL-3.0-or-later
  5. */
  6. namespace OC\Core\Migrations;
  7. use OCP\DB\ISchemaWrapper;
  8. use OCP\Migration\IOutput;
  9. use OCP\Migration\SimpleMigrationStep;
  10. class Version14000Date20180516101403 extends SimpleMigrationStep {
  11. /**
  12. * @param IOutput $output
  13. * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
  14. * @param array $options
  15. * @return null|ISchemaWrapper
  16. */
  17. public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
  18. /** @var ISchemaWrapper $schema */
  19. $schema = $schemaClosure();
  20. $table = $schema->getTable('authtoken');
  21. if (!$table->hasColumn('expires')) {
  22. $table->addColumn('expires', 'integer', [
  23. 'notnull' => false,
  24. 'length' => 4,
  25. 'default' => null,
  26. 'unsigned' => true,
  27. ]);
  28. return $schema;
  29. }
  30. return null;
  31. }
  32. }