<?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 Version20220605160532 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 calendar CHANGE begin_at begin_at DATE DEFAULT NULL, CHANGE end_at end_at DATE DEFAULT NULL');
$this->addSql('ALTER TABLE produse_inventar ADD idProdus INT NOT NULL, DROP id_produs');
$this->addSql('ALTER TABLE produse_inventar ADD CONSTRAINT FK_1A600B60ED3C9ECB FOREIGN KEY (idProdus) REFERENCES products (id)');
$this->addSql('CREATE INDEX IDX_1A600B60ED3C9ECB ON produse_inventar (idProdus)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE calendar CHANGE begin_at begin_at DATETIME DEFAULT NULL, CHANGE end_at end_at DATETIME DEFAULT NULL');
$this->addSql('ALTER TABLE produse_inventar DROP FOREIGN KEY FK_1A600B60ED3C9ECB');
$this->addSql('DROP INDEX IDX_1A600B60ED3C9ECB ON produse_inventar');
$this->addSql('ALTER TABLE produse_inventar ADD id_produs INT DEFAULT NULL, DROP idProdus');
}
}