<?php
declare(strict_types=1);
namespace ProductsBundleMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20241125100008 extends AbstractMigration
{
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE products_bundle__product_attachment ADD created_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', ADD updated_by_id BINARY(16) DEFAULT NULL COMMENT \'(DC2Type:uuid)\', ADD created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL, ADD updated_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL');
$this->addSql('ALTER TABLE products_bundle__product_attachment ADD CONSTRAINT FK_C878BAA3B03A8386 FOREIGN KEY (created_by_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE products_bundle__product_attachment ADD CONSTRAINT FK_C878BAA3896DBBDE FOREIGN KEY (updated_by_id) REFERENCES user (id)');
$this->addSql('CREATE INDEX IDX_C878BAA3B03A8386 ON products_bundle__product_attachment (created_by_id)');
$this->addSql('CREATE INDEX IDX_C878BAA3896DBBDE ON products_bundle__product_attachment (updated_by_id)');
$this->addSql('CREATE INDEX created_at ON products_bundle__product_attachment (created_at)');
$this->addSql('CREATE INDEX updated_at ON products_bundle__product_attachment (updated_at)');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE products_bundle__product_attachment DROP FOREIGN KEY FK_C878BAA3B03A8386');
$this->addSql('ALTER TABLE products_bundle__product_attachment DROP FOREIGN KEY FK_C878BAA3896DBBDE');
$this->addSql('DROP INDEX IDX_C878BAA3B03A8386 ON products_bundle__product_attachment');
$this->addSql('DROP INDEX IDX_C878BAA3896DBBDE ON products_bundle__product_attachment');
$this->addSql('DROP INDEX created_at ON products_bundle__product_attachment');
$this->addSql('DROP INDEX updated_at ON products_bundle__product_attachment');
$this->addSql('ALTER TABLE products_bundle__product_attachment DROP created_by_id, DROP updated_by_id, DROP created_at, DROP updated_at');
}
}