2022-11-06 21:18:13 +00:00
|
|
|
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace OCA\GPodderSync\Migration;
|
|
|
|
|
|
|
|
use Closure;
|
|
|
|
use Doctrine\DBAL\Types\Types;
|
|
|
|
use OCP\DB\ISchemaWrapper;
|
|
|
|
use OCP\Migration\IOutput;
|
|
|
|
|
|
|
|
class Version0006Date20221106215500 extends \OCP\Migration\SimpleMigrationStep {
|
|
|
|
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) {
|
|
|
|
/** @var ISchemaWrapper $schema */
|
|
|
|
$schema = $schemaClosure();
|
|
|
|
|
|
|
|
$table = $schema->getTable('gpodder_subscriptions');
|
2022-11-11 11:10:26 +00:00
|
|
|
|
|
|
|
// hotfix due to errors with too long key lengths (https://github.com/thrillfall/nextcloud-gpodder/issues/103)
|
|
|
|
$table->dropIndex('subscriptions_url_user');
|
|
|
|
$table->addUniqueIndex(['url', "user_id"], 'subscriptions_url_user', [
|
|
|
|
'lengths' => [ 500, 200 ]
|
|
|
|
]);
|
|
|
|
|
2022-11-06 21:18:13 +00:00
|
|
|
$table->changeColumn('url', ['length' => 1000]);
|
|
|
|
|
|
|
|
return $schema;
|
|
|
|
}
|
|
|
|
}
|