2023-06-13 13:02:48 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Application\Migrations;
|
|
|
|
|
|
|
|
use Doctrine\DBAL\Schema\Schema;
|
2024-02-19 00:30:12 +00:00
|
|
|
use Wallabag\Doctrine\WallabagMigration;
|
2023-06-13 13:02:48 +00:00
|
|
|
|
|
|
|
/**
|
2023-06-13 13:10:14 +00:00
|
|
|
* Added a new setting to display or not thumbnails.
|
2023-06-13 13:02:48 +00:00
|
|
|
*/
|
|
|
|
final class Version20230613121354 extends WallabagMigration
|
|
|
|
{
|
|
|
|
public function up(Schema $schema): void
|
|
|
|
{
|
|
|
|
$configTable = $schema->getTable($this->getTable('config'));
|
|
|
|
|
|
|
|
$this->skipIf($configTable->hasColumn('display_thumbnails'), 'It seems that you already played this migration.');
|
|
|
|
|
|
|
|
$configTable->addColumn('display_thumbnails', 'integer', [
|
|
|
|
'default' => 1,
|
|
|
|
'notnull' => false,
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function down(Schema $schema): void
|
|
|
|
{
|
|
|
|
$configTable = $schema->getTable($this->getTable('config'));
|
|
|
|
$configTable->dropColumn('display_thumbnails');
|
|
|
|
}
|
|
|
|
}
|