migrations/Version20241205160147.php line 1

Open in your IDE?
  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 Version20241205160147 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 tray ADD locked_by_id INT DEFAULT NULL');
            $this->addSql('ALTER TABLE tray ADD CONSTRAINT FK_C753C7977A88E00 FOREIGN KEY (locked_by_id) REFERENCES employee (id)');
            $this->addSql('CREATE UNIQUE INDEX UNIQ_C753C7977A88E00 ON tray (locked_by_id)');
        }
    
        public function down(Schema $schema): void
        {
            // this down() migration is auto-generated, please modify it to your needs
            $this->addSql('ALTER TABLE tray DROP FOREIGN KEY FK_C753C7977A88E00');
            $this->addSql('DROP INDEX UNIQ_C753C7977A88E00 ON tray');
            $this->addSql('ALTER TABLE tray DROP locked_by_id');
        }
    }