<?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 Version20220830060956 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 file (id INT AUTO_INCREMENT NOT NULL, order_ent_id INT DEFAULT NULL, product_id INT DEFAULT NULL, created_user_id INT DEFAULT NULL, changed_user_id INT DEFAULT NULL, version VARCHAR(255) NOT NULL, deleted TINYINT(1) DEFAULT NULL, name VARCHAR(255) NOT NULL, mime VARCHAR(128) NOT NULL, url VARCHAR(512) NOT NULL, url_del VARCHAR(512) DEFAULT NULL, size INT NOT NULL, signed TINYINT(1) NOT NULL, created DATETIME DEFAULT NULL, changed DATETIME DEFAULT NULL, ip VARCHAR(50) NOT NULL, INDEX IDX_8C9F3610712BCD5A (order_ent_id), UNIQUE INDEX UNIQ_8C9F36104584665A (product_id), INDEX IDX_8C9F3610E104C1D3 (created_user_id), INDEX IDX_8C9F3610D0B87009 (changed_user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE file ADD CONSTRAINT FK_8C9F3610712BCD5A FOREIGN KEY (order_ent_id) REFERENCES `order` (id)');
$this->addSql('ALTER TABLE file ADD CONSTRAINT FK_8C9F36104584665A FOREIGN KEY (product_id) REFERENCES product (id)');
$this->addSql('ALTER TABLE file ADD CONSTRAINT FK_8C9F3610E104C1D3 FOREIGN KEY (created_user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE file ADD CONSTRAINT FK_8C9F3610D0B87009 FOREIGN KEY (changed_user_id) REFERENCES user (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE file');
}
}