<?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 Version20221229121201 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 warehouse_admission_attachment (id INT AUTO_INCREMENT NOT NULL, warehouse_admission_id INT NOT NULL, created_by_id INT DEFAULT NULL, file_name VARCHAR(255) NOT NULL, file_path VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL, INDEX IDX_BF9079355547906 (warehouse_admission_id), INDEX IDX_BF90793B03A8386 (created_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE warehouse_admission_attachment ADD CONSTRAINT FK_BF9079355547906 FOREIGN KEY (warehouse_admission_id) REFERENCES warehouse_admission (id)');
$this->addSql('ALTER TABLE warehouse_admission_attachment ADD CONSTRAINT FK_BF90793B03A8386 FOREIGN KEY (created_by_id) REFERENCES `user` (id)');
$this->addSql('ALTER TABLE diet_translation ADD internal_name VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE ingredient_translation ADD internal_name VARCHAR(255) DEFAULT NULL');
$this->addSql('ALTER TABLE warehouse ADD type VARCHAR(32) DEFAULT NULL');
$this->addSql('ALTER TABLE warehouse_admission ADD note LONGTEXT DEFAULT NULL');
$this->addSql('ALTER TABLE warehouse_release ADD note LONGTEXT DEFAULT NULL, ADD type VARCHAR(32) DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE warehouse_admission_attachment');
$this->addSql('ALTER TABLE diet_translation DROP internal_name');
$this->addSql('ALTER TABLE ingredient_translation DROP internal_name');
$this->addSql('ALTER TABLE warehouse DROP type');
$this->addSql('ALTER TABLE warehouse_admission DROP note');
$this->addSql('ALTER TABLE warehouse_release DROP note, DROP type');
}
}