<?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 Version20250417064418 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 product_stock_transaction (id INT AUTO_INCREMENT NOT NULL, product_detail_id INT NOT NULL, old_quantity INT NOT NULL, change_quantity INT NOT NULL, new_quantity INT NOT NULL, source VARCHAR(100) NOT NULL, note VARCHAR(255) DEFAULT NULL, created_at DATETIME(6) NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_197C91B6B670B536 (product_detail_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE product_stock_transaction ADD CONSTRAINT FK_197C91B6B670B536 FOREIGN KEY (product_detail_id) REFERENCES product_detail (id) ON DELETE CASCADE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE product_stock_transaction');
}
}