<?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 Version20240809120735 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$this->addSql("ALTER TABLE `dp_products` DROP FOREIGN KEY `dp_products_ibfk_6`");
$this->addSql("ALTER TABLE `dp_products` DROP COLUMN `customer_id`");
$this->addSql("ALTER TABLE `dp_products` ADD COLUMN `customer` ENUM('assy') NULL");
$this->addSql("ALTER TABLE `dp_products` MODIFY `packaging` ENUM('magazine') NOT NULL DEFAULT 'magazine'");
$this->addSql("ALTER TABLE `dp_product_variants` MODIFY `packaging` ENUM('green_plastic','cardboard') DEFAULT NULL");
}
public function down(Schema $schema): void
{
$this->addSql("ALTER TABLE `dp_products` ADD CONSTRAINT `dp_products_ibfk_6` FOREIGN KEY (`customer_id`) REFERENCES `dp_customers`(`id`)");
$this->addSql("ALTER TABLE `dp_products` ADD COLUMN `customer_id` INT NULL");
$this->addSql("ALTER TABLE `dp_products` DROP COLUMN `customer`");
$this->addSql("ALTER TABLE `dp_products` MODIFY `packaging` VARCHAR(255) DEFAULT NULL");
$this->addSql("ALTER TABLE `dp_product_variants` MODIFY `packaging` VARCHAR(255) DEFAULT NULL");
}
}