<?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 Version20220511160733 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 mecanique (id INT AUTO_INCREMENT NOT NULL, operation_id INT DEFAULT NULL, products_id INT DEFAULT NULL, reward VARCHAR(255) DEFAULT NULL, amount VARCHAR(255) DEFAULT NULL, type VARCHAR(255) DEFAULT NULL, INDEX IDX_F0573DA344AC3583 (operation_id), INDEX IDX_F0573DA36C8A81A9 (products_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE mecanique ADD CONSTRAINT FK_F0573DA344AC3583 FOREIGN KEY (operation_id) REFERENCES operation (id)');
$this->addSql('ALTER TABLE mecanique ADD CONSTRAINT FK_F0573DA36C8A81A9 FOREIGN KEY (products_id) REFERENCES product (id)');
$this->addSql('ALTER TABLE operation ADD shops_file VARCHAR(255) DEFAULT NULL, ADD url VARCHAR(255) DEFAULT NULL, ADD cible LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', ADD justificatifs LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:array)\', ADD product_mutliple TINYINT(1) DEFAULT NULL, ADD serial_number TINYINT(1) DEFAULT NULL, ADD text_serial_number VARCHAR(255) DEFAULT NULL, ADD legal_notice VARCHAR(255) DEFAULT NULL, DROP max_purchases, CHANGE name name VARCHAR(255) DEFAULT NULL, CHANGE created_at created_at DATETIME DEFAULT NULL, CHANGE updated_at updated_at DATETIME DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE mecanique');
$this->addSql('ALTER TABLE operation ADD max_purchases INT DEFAULT NULL, DROP shops_file, DROP url, DROP cible, DROP justificatifs, DROP product_mutliple, DROP serial_number, DROP text_serial_number, DROP legal_notice, CHANGE name name VARCHAR(255) NOT NULL, CHANGE created_at created_at DATETIME NOT NULL, CHANGE updated_at updated_at DATETIME NOT NULL');
}
}