migrations/Delete/Version20241210130940_InventoryWithdrawalFileMap.php line 1
<?php
declare(strict_types=1);
namespace DoctrineMigrations\Delete;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20241210130940_InventoryWithdrawalFileMap extends AbstractMigration
{
public function getDescription(): string
{
return 'Add withdrawal to files relations';
}
public function up(Schema $schema): void
{
$this->addSql('CREATE TABLE inventory_x_withdrawal_file_map (
withdrawal_id INTEGER NOT NULL REFERENCES public.inventory_x_withdrawal (id),
file_id INTEGER NOT NULL REFERENCES public.file (id),
PRIMARY KEY (withdrawal_id, file_id)
)');
$this->addSql('CREATE INDEX withdrawal_file_map_withdrawal_id_idx ON inventory_x_withdrawal_file_map (withdrawal_id)');
$this->addSql('CREATE INDEX withdrawal_file_map_file_id_idx ON inventory_x_withdrawal_file_map (file_id)');
}
public function down(Schema $schema): void
{
$this->addSql('DROP TABLE IF EXISTS inventory_x_withdrawal_file_map');
}
}