feat : ajout de la partie reception des marchandises (étape 3) et modification du bon de réception
This commit is contained in:
32
migrations/Version20260128000200.php
Normal file
32
migrations/Version20260128000200.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20260128000200 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Add merchandise types and link receptions';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->addSql('CREATE TABLE merchandise_type (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, label VARCHAR(120) NOT NULL, code VARCHAR(50) NOT NULL, PRIMARY KEY(id))');
|
||||
$this->addSql('ALTER TABLE reception ADD merchandise_type_id INT DEFAULT NULL');
|
||||
$this->addSql('CREATE INDEX IDX_83DC02E3BCAAA7C0 ON reception (merchandise_type_id)');
|
||||
$this->addSql('ALTER TABLE reception ADD CONSTRAINT FK_83DC02E3BCAAA7C0 FOREIGN KEY (merchandise_type_id) REFERENCES merchandise_type (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE reception DROP CONSTRAINT FK_83DC02E3BCAAA7C0');
|
||||
$this->addSql('DROP INDEX IDX_83DC02E3BCAAA7C0');
|
||||
$this->addSql('ALTER TABLE reception DROP merchandise_type_id');
|
||||
$this->addSql('DROP TABLE merchandise_type');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user