migrations/Inventory/Version20220901145910_InventoryWithdrawalItem.php line 1
<?php
declare(strict_types=1);
namespace DoctrineMigrations\Inventory;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20220901145910_InventoryWithdrawalItem extends AbstractMigration
{
public function getDescription(): string
{
return 'Add inventory withdrawal item table';
}
public function up(Schema $schema): void
{
$this->addSql("CREATE TABLE inventory_withdrawal_item (
id SERIAL PRIMARY KEY,
withdrawal_id INTEGER NOT NULL REFERENCES public.inventory_withdrawal (id),
inventory_item_id INTEGER NOT NULL REFERENCES public.inventory_item (id),
requested_quantity INTEGER NOT NULL,
approved_quantity INTEGER,
remitted_quantity INTEGER
)");
$this->addSql("CREATE INDEX inventory_withdrawal_item_withdrawal_id_idx ON inventory_withdrawal_item (withdrawal_id)");
$this->addSql("CREATE INDEX inventory_withdrawal_item_inventory_item_id_idx ON inventory_withdrawal_item (inventory_item_id)");
}
public function down(Schema $schema): void
{
$this->addSql("DROP TABLE IF EXISTS inventory_withdrawal_item");
}
}