<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20221013101205 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE job_material DROP INDEX UNIQ_1BF9D0EEE308AC6F, ADD INDEX IDX_1BF9D0EEE308AC6F (material_id)');
$this->addSql('ALTER TABLE job_material ADD quantity INT DEFAULT 1 NOT NULL');
$this->addSql('ALTER TABLE service_material DROP INDEX UNIQ_85C82EA8ED5CA9E6, ADD INDEX IDX_85C82EA8ED5CA9E6 (service_id)');
$this->addSql('ALTER TABLE service_material DROP INDEX UNIQ_85C82EA8E308AC6F, ADD INDEX IDX_85C82EA8E308AC6F (material_id)');
$this->addSql('ALTER TABLE service_material CHANGE service_id service_id INT DEFAULT NULL, CHANGE material_id material_id INT DEFAULT NULL');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE job_material DROP INDEX IDX_1BF9D0EEE308AC6F, ADD UNIQUE INDEX UNIQ_1BF9D0EEE308AC6F (material_id)');
$this->addSql('ALTER TABLE job_material DROP quantity');
$this->addSql('ALTER TABLE service_material DROP INDEX IDX_85C82EA8ED5CA9E6, ADD UNIQUE INDEX UNIQ_85C82EA8ED5CA9E6 (service_id)');
$this->addSql('ALTER TABLE service_material DROP INDEX IDX_85C82EA8E308AC6F, ADD UNIQUE INDEX UNIQ_85C82EA8E308AC6F (material_id)');
$this->addSql('ALTER TABLE service_material CHANGE service_id service_id INT NOT NULL, CHANGE material_id material_id INT NOT NULL');
}
}