Обновление клиента
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\TwoFactorNextcloudNotification\Migration;
|
||||
|
||||
use OCP\DB\ISchemaWrapper;
|
||||
use OCP\Migration\IOutput;
|
||||
use OCP\Migration\SimpleMigrationStep;
|
||||
|
||||
class Version0001Date20180411172140 extends SimpleMigrationStep {
|
||||
/**
|
||||
* @param IOutput $output
|
||||
* @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
|
||||
* @param array $options
|
||||
* @return null|ISchemaWrapper
|
||||
*/
|
||||
#[\Override]
|
||||
public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
|
||||
/**
|
||||
* Dropped by Version4000Date20240802134536
|
||||
* Recreated with oracle compatible names in Version4000Date20240802134537
|
||||
* if (!$schema->hasTable(Application::APP_ID . '_tokens')) {
|
||||
* $table = $schema->createTable(Application::APP_ID . '_tokens');
|
||||
*
|
||||
* $table->addColumn('id', Types::INTEGER, [
|
||||
* 'autoincrement' => true,
|
||||
* 'notnull' => true,
|
||||
* 'length' => 20,
|
||||
* ]);
|
||||
* $table->addColumn('user_id', Types::STRING, [
|
||||
* 'notnull' => true,
|
||||
* 'length' => 64,
|
||||
* ]);
|
||||
* $table->addColumn('token', Types::STRING, [
|
||||
* 'notnull' => true,
|
||||
* 'length' => 40,
|
||||
* ]);
|
||||
* $table->addColumn('timestamp', Types::INTEGER, [
|
||||
* 'notnull' => true,
|
||||
* 'length' => 20,
|
||||
* ]);
|
||||
* $table->addColumn('status', Types::INTEGER, [
|
||||
* 'notnull' => true,
|
||||
* 'length' => 2,
|
||||
* ]);
|
||||
*
|
||||
* $table->setPrimaryKey(['id'], Application::APP_ID . '_tokens_id_idx');
|
||||
* $table->addIndex(['token'], Application::APP_ID . '_tokens_token_idx');
|
||||
*
|
||||
* return $schema;
|
||||
* }
|
||||
*/
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\TwoFactorNextcloudNotification\Migration;
|
||||
|
||||
use Closure;
|
||||
use OCP\IConfig;
|
||||
use OCP\Migration\IOutput;
|
||||
use OCP\Migration\SimpleMigrationStep;
|
||||
|
||||
class Version3004Date20220331145316 extends SimpleMigrationStep {
|
||||
public function __construct(
|
||||
protected IConfig $config,
|
||||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param IOutput $output
|
||||
* @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
|
||||
* @param array $options
|
||||
*/
|
||||
#[\Override]
|
||||
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void {
|
||||
$keys = $this->config->getAppKeys('twofactor_nextcloud_notification');
|
||||
foreach ($keys as $key) {
|
||||
if (str_ends_with($key, '_enabled')) {
|
||||
$this->config->setUserValue(
|
||||
substr($key, 0, -8),
|
||||
'twofactor_nextcloud_notification',
|
||||
'enabled',
|
||||
'1'
|
||||
);
|
||||
|
||||
$this->config->deleteAppValue('twofactor_nextcloud_notification', $key);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\TwoFactorNextcloudNotification\Migration;
|
||||
|
||||
use Closure;
|
||||
use OCA\TwoFactorNextcloudNotification\AppInfo\Application;
|
||||
use OCP\DB\ISchemaWrapper;
|
||||
use OCP\Migration\IOutput;
|
||||
use OCP\Migration\SimpleMigrationStep;
|
||||
|
||||
class Version4000Date20240802134536 extends SimpleMigrationStep {
|
||||
/**
|
||||
* @param IOutput $output
|
||||
* @param Closure(): ISchemaWrapper $schemaClosure
|
||||
* @param array $options
|
||||
* @return null|ISchemaWrapper
|
||||
*/
|
||||
#[\Override]
|
||||
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
|
||||
/** @var ISchemaWrapper $schema */
|
||||
$schema = $schemaClosure();
|
||||
|
||||
if ($schema->hasTable(Application::APP_ID . '_tokens')) {
|
||||
$schema->dropTable(Application::APP_ID . '_tokens');
|
||||
return $schema;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace OCA\TwoFactorNextcloudNotification\Migration;
|
||||
|
||||
use Closure;
|
||||
use OCP\DB\ISchemaWrapper;
|
||||
use OCP\DB\Types;
|
||||
use OCP\Migration\IOutput;
|
||||
use OCP\Migration\SimpleMigrationStep;
|
||||
|
||||
class Version4000Date20240802134537 extends SimpleMigrationStep {
|
||||
/**
|
||||
* @param IOutput $output
|
||||
* @param Closure(): ISchemaWrapper $schemaClosure
|
||||
* @param array $options
|
||||
* @return null|ISchemaWrapper
|
||||
*/
|
||||
#[\Override]
|
||||
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
|
||||
/** @var ISchemaWrapper $schema */
|
||||
$schema = $schemaClosure();
|
||||
|
||||
if (!$schema->hasTable('twofactor_tnn_tokens')) {
|
||||
$table = $schema->createTable('twofactor_tnn_tokens');
|
||||
|
||||
$table->addColumn('id', Types::INTEGER, [
|
||||
'autoincrement' => true,
|
||||
'notnull' => true,
|
||||
'length' => 20,
|
||||
]);
|
||||
$table->addColumn('user_id', Types::STRING, [
|
||||
'notnull' => true,
|
||||
'length' => 64,
|
||||
]);
|
||||
$table->addColumn('token', Types::STRING, [
|
||||
'notnull' => true,
|
||||
'length' => 40,
|
||||
]);
|
||||
$table->addColumn('timestamp', Types::INTEGER, [
|
||||
'notnull' => true,
|
||||
'length' => 20,
|
||||
]);
|
||||
$table->addColumn('status', Types::INTEGER, [
|
||||
'notnull' => true,
|
||||
'length' => 2,
|
||||
]);
|
||||
|
||||
$table->setPrimaryKey(['id']);
|
||||
$table->addIndex(['token'], 'twofactor_tnn_token_idx');
|
||||
|
||||
return $schema;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user