35 lines
1.1 KiB
PHP
35 lines
1.1 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 Version20260602224032 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('ALTER TABLE subject ADD created_by_id INT DEFAULT NULL');
|
|
$this->addSql('ALTER TABLE subject ADD CONSTRAINT FK_FBCE3E7AB03A8386 FOREIGN KEY (created_by_id) REFERENCES "user" (id) NOT DEFERRABLE');
|
|
$this->addSql('CREATE INDEX IDX_FBCE3E7AB03A8386 ON subject (created_by_id)');
|
|
}
|
|
|
|
public function down(Schema $schema): void
|
|
{
|
|
// this down() migration is auto-generated, please modify it to your needs
|
|
$this->addSql('ALTER TABLE subject DROP CONSTRAINT FK_FBCE3E7AB03A8386');
|
|
$this->addSql('DROP INDEX IDX_FBCE3E7AB03A8386');
|
|
$this->addSql('ALTER TABLE subject DROP created_by_id');
|
|
}
|
|
}
|