Add separate migration so that all systems have the same schema after hotfix

This commit is contained in:
JonOfUs 2022-11-11 12:11:35 +01:00 committed by Jonathan Flueren
parent 60b51e8c96
commit 9242def504
1 changed files with 23 additions and 0 deletions

View File

@ -0,0 +1,23 @@
<?php
declare(strict_types=1);
namespace OCA\GPodderSync\Migration;
use Closure;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
class Version0007Date202211111100 extends \OCP\Migration\SimpleMigrationStep {
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
$table = $schema->getTable('gpodder_subscriptions');
$table->dropIndex('subscriptions_url_user');
$table->addUniqueIndex(['url', "user_id"], 'subscriptions_url_user', [
'lengths' => [ 500, 200 ]
]);
return $schema;
}
}