migrations/Delete/Version20250215174513_InvoicingProformaBoxMap.php line 1

  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations\Delete;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20250215174513_InvoicingProformaBoxMap extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return 'Add proforma to boxes association';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         $this->addSql('CREATE TABLE invoicing_proforma_box_map (
  18.             proforma_id         INTEGER NOT NULL REFERENCES public.invoicing_proforma (id),
  19.             box_id              INTEGER NOT NULL REFERENCES public.expediting_z_box (id),
  20.             PRIMARY KEY (proforma_id, box_id)
  21.         )');
  22.         $this->addSql('CREATE INDEX invoicing_proforma_box_map_proforma_id_idx ON invoicing_proforma_box_map (box_id)');
  23.         $this->addSql('CREATE INDEX invoicing_proforma_box_map_box_id_idx ON invoicing_proforma_box_map (box_id)');
  24.     }
  25.     public function down(Schema $schema): void
  26.     {
  27.         $this->addSql('DROP TABLE IF EXISTS invoicing_proforma_box_map');
  28.     }
  29. }