migrations/Version20230207153613.php line 1
<?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 Version20230207153613 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE audio_content (id INT NOT NULL, resource_id INT DEFAULT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE UNIQUE INDEX UNIQ_C172397589329D25 ON audio_content (resource_id)');
$this->addSql('ALTER TABLE audio_content ADD CONSTRAINT FK_C172397589329D25 FOREIGN KEY (resource_id) REFERENCES resource (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE audio_content ADD CONSTRAINT FK_C1723975BF396750 FOREIGN KEY (id) REFERENCES primitive (id) ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE audio_content DROP CONSTRAINT FK_C172397589329D25');
$this->addSql('ALTER TABLE audio_content DROP CONSTRAINT FK_C1723975BF396750');
$this->addSql('DROP TABLE audio_content');
}
}