Skip to content

Commit

Permalink
solved issue: #17
Browse files Browse the repository at this point in the history
  • Loading branch information
matteo-convertino committed Jan 23, 2024
1 parent 3f9624a commit 954bcaf
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
2 changes: 1 addition & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ This way, the migration from Google Authenticator to OTP Manager will be quick a
* [Official iOS App](https://apps.apple.com/us/app/nextcloud-otp-manager/id6471510170)
]]>
</description>
<version>0.3.3</version>
<version>0.3.4</version>
<licence>agpl</licence>
<author mail="[email protected]" homepage="https://www.convertino.cloud">Matteo Convertino</author>
<namespace>OtpManager</namespace>
Expand Down
40 changes: 40 additions & 0 deletions lib/Migration/Version000010Date20240123120000.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

namespace OCA\OtpManager\Migration;

use Closure;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\SimpleMigrationStep;
use OCP\Migration\IOutput;
use OCA\OtpManager\AppInfo\Application;

class Version000010Date20240123120000 extends SimpleMigrationStep
{
/**
* @param IOutput $output
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
* @param array $options
* @return null|ISchemaWrapper
*/
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options)
{
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();

$table = $schema->getTable(Application::ACCOUNTS_DB);

$secretCol = $table->getColumn("secret");
$nameCol = $table->getColumn("name");
$issuerCol = $table->getColumn("issuer");
$digitsCol = $table->getColumn("digits");
$periodCol = $table->getColumn("period");

$secretCol->setLength(512);
$nameCol->setLength(256);
$issuerCol->setLength(256);
$digitsCol->setNotnull(false);
$periodCol->setNotnull(false);

return $schema;
}
}

0 comments on commit 954bcaf

Please sign in to comment.