2017-01-08 15:33:48 +00:00
|
|
|
<?php
|
|
|
|
|
2023-03-12 15:15:25 +00:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace DoctrineMigrations;
|
2017-01-08 15:33:48 +00:00
|
|
|
|
|
|
|
use Doctrine\DBAL\Schema\Schema;
|
2023-03-12 15:15:25 +00:00
|
|
|
use Doctrine\Migrations\AbstractMigration;
|
2017-01-08 15:33:48 +00:00
|
|
|
|
2023-03-12 15:15:25 +00:00
|
|
|
final class Version20170108152129 extends AbstractMigration
|
2017-01-08 15:33:48 +00:00
|
|
|
{
|
2023-03-12 15:15:25 +00:00
|
|
|
public function up(Schema $schema): void
|
2017-01-08 15:33:48 +00:00
|
|
|
{
|
|
|
|
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
|
|
|
|
|
|
|
$this->addSql('ALTER INDEX subscriptions.idx_22da64ddf675f31b RENAME TO author_idx');
|
|
|
|
$this->addSql('ALTER INDEX subscriptions.idx_22da64dd7808b1ad RENAME TO subscriber_idx');
|
|
|
|
}
|
|
|
|
|
2023-03-12 15:15:25 +00:00
|
|
|
public function down(Schema $schema): void
|
2017-01-08 15:33:48 +00:00
|
|
|
{
|
|
|
|
$this->abortIf($this->connection->getDatabasePlatform()->getName() != 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
|
|
|
|
|
|
|
|
$this->addSql('ALTER INDEX subscriptions.subscriber_idx RENAME TO idx_22da64dd7808b1ad');
|
|
|
|
$this->addSql('ALTER INDEX subscriptions.author_idx RENAME TO idx_22da64ddf675f31b');
|
|
|
|
}
|
|
|
|
}
|