<?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 Version20240409041607 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 machine_cost_matrix (id INT AUTO_INCREMENT NOT NULL, machine_id INT NOT NULL, start_qty INT NOT NULL, cost NUMERIC(10, 4) NOT NULL, INDEX IDX_5EA03106F6B75B26 (machine_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE machine_time_matrix (id INT AUTO_INCREMENT NOT NULL, machine_id INT NOT NULL, start_qty INT NOT NULL, time INT NOT NULL, rate NUMERIC(10, 4) NOT NULL, INDEX IDX_60385FF6B75B26 (machine_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE machine_cost_matrix ADD CONSTRAINT FK_5EA03106F6B75B26 FOREIGN KEY (machine_id) REFERENCES machine (id)');
$this->addSql('ALTER TABLE machine_time_matrix ADD CONSTRAINT FK_60385FF6B75B26 FOREIGN KEY (machine_id) REFERENCES machine (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE machine_cost_matrix DROP FOREIGN KEY FK_5EA03106F6B75B26');
$this->addSql('ALTER TABLE machine_time_matrix DROP FOREIGN KEY FK_60385FF6B75B26');
$this->addSql('DROP TABLE machine_cost_matrix');
$this->addSql('DROP TABLE machine_time_matrix');
}
}