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.

Version19000Date20200211083441.php 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. declare(strict_types=1);
  3. namespace OC\Core\Migrations;
  4. use Closure;
  5. use OCP\DB\ISchemaWrapper;
  6. use OCP\Migration\IOutput;
  7. use OCP\Migration\SimpleMigrationStep;
  8. class Version19000Date20200211083441 extends SimpleMigrationStep {
  9. public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) {
  10. /** @var ISchemaWrapper $schema */
  11. $schema = $schemaClosure();
  12. if (!$schema->hasTable('webauthn')) {
  13. $table = $schema->createTable('webauthn');
  14. $table->addColumn('id', 'integer', [
  15. 'autoincrement' => true,
  16. 'notnull' => true,
  17. 'length' => 64,
  18. ]);
  19. $table->addColumn('uid', 'string', [
  20. 'notnull' => true,
  21. 'length' => 64,
  22. ]);
  23. $table->addColumn('name', 'string', [
  24. 'notnull' => true,
  25. 'length' => 64,
  26. ]);
  27. $table->addColumn('public_key_credential_id', 'string', [
  28. 'notnull' => true,
  29. 'length' => 255
  30. ]);
  31. $table->addColumn('data', 'text', [
  32. 'notnull' => true,
  33. ]);
  34. $table->setPrimaryKey(['id']);
  35. $table->addIndex(['uid'], 'webauthn_uid');
  36. $table->addIndex(['public_key_credential_id'], 'webauthn_publicKeyCredentialId');
  37. }
  38. return $schema;
  39. }
  40. }