Files
Ferme/migrations/Version20260318104205.php
2026-03-18 14:47:03 +01:00

42 lines
1.6 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 Version20260318104205 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 customer ADD created_by INT DEFAULT NULL');
$this->addSql('ALTER TABLE customer ADD CONSTRAINT FK_81398E09DE12AB56 FOREIGN KEY (created_by) REFERENCES public."user" (id) NOT DEFERRABLE');
$this->addSql('CREATE INDEX IDX_81398E09DE12AB56 ON customer (created_by)');
$this->addSql('ALTER TABLE supplier ADD created_by INT DEFAULT NULL');
$this->addSql('ALTER TABLE supplier ADD CONSTRAINT FK_9B2A6C7EDE12AB56 FOREIGN KEY (created_by) REFERENCES public."user" (id) NOT DEFERRABLE');
$this->addSql('CREATE INDEX IDX_9B2A6C7EDE12AB56 ON supplier (created_by)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE customer DROP CONSTRAINT FK_81398E09DE12AB56');
$this->addSql('DROP INDEX IDX_81398E09DE12AB56');
$this->addSql('ALTER TABLE customer DROP created_by');
$this->addSql('ALTER TABLE supplier DROP CONSTRAINT FK_9B2A6C7EDE12AB56');
$this->addSql('DROP INDEX IDX_9B2A6C7EDE12AB56');
$this->addSql('ALTER TABLE supplier DROP created_by');
}
}