All checks were successful
CI - Build Tonehaus Docker image / tonehaus-ci-build (push) Successful in 2m0s
43 lines
1.0 KiB
PHP
43 lines
1.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace DoctrineMigrations;
|
|
|
|
use Doctrine\DBAL\Schema\Schema;
|
|
use Doctrine\Migrations\AbstractMigration;
|
|
|
|
/**
|
|
* Auto-generated Migration: Please modify to your needs!
|
|
*/
|
|
final class Version20251127191813 extends AbstractMigration
|
|
{
|
|
public function getDescription(): string
|
|
{
|
|
return '';
|
|
}
|
|
|
|
public function up(Schema $schema): void
|
|
{
|
|
if ($this->isSqlite()) {
|
|
return;
|
|
}
|
|
$this->addSql('ALTER TABLE albums ALTER source DROP DEFAULT');
|
|
$this->addSql('ALTER INDEX uniq_album_local_id RENAME TO UNIQ_F4E2474F5D5A2101');
|
|
}
|
|
|
|
public function down(Schema $schema): void
|
|
{
|
|
if ($this->isSqlite()) {
|
|
return;
|
|
}
|
|
$this->addSql('ALTER TABLE albums ALTER source SET DEFAULT \'spotify\'');
|
|
$this->addSql('ALTER INDEX uniq_f4e2474f5d5a2101 RENAME TO uniq_album_local_id');
|
|
}
|
|
|
|
private function isSqlite(): bool
|
|
{
|
|
return $this->connection->getDatabasePlatform()->getName() === 'sqlite';
|
|
}
|
|
}
|