39 lines
1.3 KiB
PHP
39 lines
1.3 KiB
PHP
|
|
<?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 Version20260119163529 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('ALTER TABLE devis_line ADD product_id INT DEFAULT NULL');
|
||
|
|
$this->addSql('ALTER TABLE devis_line DROP title');
|
||
|
|
$this->addSql('ALTER TABLE devis_line ADD CONSTRAINT FK_9EC6D5294584665A FOREIGN KEY (product_id) REFERENCES product (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||
|
|
$this->addSql('CREATE INDEX IDX_9EC6D5294584665A ON devis_line (product_id)');
|
||
|
|
}
|
||
|
|
|
||
|
|
public function down(Schema $schema): void
|
||
|
|
{
|
||
|
|
// this down() migration is auto-generated, please modify it to your needs
|
||
|
|
$this->addSql('CREATE SCHEMA public');
|
||
|
|
$this->addSql('ALTER TABLE devis_line DROP CONSTRAINT FK_9EC6D5294584665A');
|
||
|
|
$this->addSql('DROP INDEX IDX_9EC6D5294584665A');
|
||
|
|
$this->addSql('ALTER TABLE devis_line ADD title VARCHAR(255) NOT NULL');
|
||
|
|
$this->addSql('ALTER TABLE devis_line DROP product_id');
|
||
|
|
}
|
||
|
|
}
|