<?php
declare(strict_types=1);
namespace PPSDKDoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20220406112246_WebPushEndpointIndex extends AbstractMigration
{
public function getDescription(): string
{
return 'Index endpoint_hash added to web_push_endpoint';
}
public function up(Schema $schema): void
{
$this->addSql('CREATE INDEX endpoint_hash ON web_push_endpoint (hash, user_id, web_id)');
$this->addSql('ALTER TABLE notifications ADD web_push_endpoints_to_deliver_count INT DEFAULT 0 NOT NULL, ADD web_push_sent_to_endpoint_ids LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:simple_array)\'');
}
public function down(Schema $schema): void
{
$this->addSql('DROP INDEX endpoint_hash ON web_push_endpoint');
$this->addSql('ALTER TABLE notifications DROP web_push_endpoints_to_deliver_count, DROP web_push_sent_to_endpoint_ids');
}
}