| Conditions | 2 |
| Paths | 2 |
| Total Lines | 31 |
| Code Lines | 22 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { |
||
| 14 | /** @var ISchemaWrapper $schema */ |
||
| 15 | $schema = $schemaClosure(); |
||
| 16 | |||
| 17 | if (!$schema->hasTable('webauthn')) { |
||
| 18 | $table = $schema->createTable('webauthn'); |
||
| 19 | $table->addColumn('id', 'integer', [ |
||
| 20 | 'autoincrement' => true, |
||
| 21 | 'notnull' => true, |
||
| 22 | 'length' => 64, |
||
| 23 | ]); |
||
| 24 | $table->addColumn('uid', 'string', [ |
||
| 25 | 'notnull' => true, |
||
| 26 | 'length' => 64, |
||
| 27 | ]); |
||
| 28 | $table->addColumn('name', 'string', [ |
||
| 29 | 'notnull' => true, |
||
| 30 | 'length' => 64, |
||
| 31 | ]); |
||
| 32 | $table->addColumn('public_key_credential_id', 'string', [ |
||
| 33 | 'notnull' => true, |
||
| 34 | 'length' => 255 |
||
| 35 | ]); |
||
| 36 | $table->addColumn('data', 'text', [ |
||
| 37 | 'notnull' => true, |
||
| 38 | ]); |
||
| 39 | $table->setPrimaryKey(['id']); |
||
| 40 | $table->addIndex(['uid'], 'webauthn_uid'); |
||
| 41 | $table->addIndex(['public_key_credential_id'], 'webauthn_publicKeyCredentialId'); |
||
| 42 | } |
||
| 43 | return $schema; |
||
| 44 | } |
||
| 46 |