<?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 Version20230818140522 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 back_order (id INT AUTO_INCREMENT NOT NULL, article_id INT DEFAULT NULL, establishment_id INT DEFAULT NULL, user_id INT DEFAULT NULL, quantity DOUBLE PRECISION NOT NULL, deleted TINYINT(1) NOT NULL, INDEX IDX_6486483C7294869C (article_id), INDEX IDX_6486483C8565851 (establishment_id), INDEX IDX_6486483CA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE back_order ADD CONSTRAINT FK_6486483C7294869C FOREIGN KEY (article_id) REFERENCES articles (id)');
$this->addSql('ALTER TABLE back_order ADD CONSTRAINT FK_6486483C8565851 FOREIGN KEY (establishment_id) REFERENCES establishments (id)');
$this->addSql('ALTER TABLE back_order ADD CONSTRAINT FK_6486483CA76ED395 FOREIGN KEY (user_id) REFERENCES users (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE back_order DROP FOREIGN KEY FK_6486483C7294869C');
$this->addSql('ALTER TABLE back_order DROP FOREIGN KEY FK_6486483C8565851');
$this->addSql('ALTER TABLE back_order DROP FOREIGN KEY FK_6486483CA76ED395');
$this->addSql('DROP TABLE back_order');
}
}