feat : mise à jour du bon de réception WIP
This commit is contained in:
64
migrations/Version20260203152543.php
Normal file
64
migrations/Version20260203152543.php
Normal file
@@ -0,0 +1,64 @@
|
||||
<?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 Version20260203152543 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('CREATE TABLE bovin_shipment (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, nb_bovin_send INT NOT NULL, shipment_id INT DEFAULT NULL, bovine_type_id INT DEFAULT NULL, PRIMARY KEY (id))');
|
||||
$this->addSql('CREATE INDEX IDX_7049F4507BE036FC ON bovin_shipment (shipment_id)');
|
||||
$this->addSql('CREATE INDEX IDX_7049F4507899F32E ON bovin_shipment (bovine_type_id)');
|
||||
$this->addSql('CREATE TABLE bovine_type_shipment (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, type_label VARCHAR(255) NOT NULL, type_code VARCHAR(255) NOT NULL, PRIMARY KEY (id))');
|
||||
$this->addSql('CREATE TABLE customer (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, customer_label VARCHAR(255) NOT NULL, customer_code VARCHAR(255) NOT NULL, id_adress_id INT DEFAULT NULL, PRIMARY KEY (id))');
|
||||
$this->addSql('CREATE INDEX IDX_81398E094B3458B ON customer (id_adress_id)');
|
||||
$this->addSql('CREATE TABLE shipment (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, date_receipt TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, is_waiting BOOLEAN NOT NULL, licence_plate VARCHAR(255) NOT NULL, test VARCHAR(255) NOT NULL, id_carrier_id INT DEFAULT NULL, id_carrier_1_id INT DEFAULT NULL, id_truck_id INT DEFAULT NULL, licence_plate_1_id INT DEFAULT NULL, id_vehicle_id INT DEFAULT NULL, id_customer_id INT DEFAULT NULL, PRIMARY KEY (id))');
|
||||
$this->addSql('CREATE INDEX IDX_2CB20DC84554740 ON shipment (id_carrier_id)');
|
||||
$this->addSql('CREATE INDEX IDX_2CB20DC817F550F ON shipment (id_carrier_1_id)');
|
||||
$this->addSql('CREATE INDEX IDX_2CB20DC964E905B ON shipment (id_truck_id)');
|
||||
$this->addSql('CREATE INDEX IDX_2CB20DC3B17D73A ON shipment (licence_plate_1_id)');
|
||||
$this->addSql('CREATE INDEX IDX_2CB20DCF1D99706 ON shipment (id_vehicle_id)');
|
||||
$this->addSql('CREATE INDEX IDX_2CB20DC8B870E04 ON shipment (id_customer_id)');
|
||||
$this->addSql('ALTER TABLE bovin_shipment ADD CONSTRAINT FK_7049F4507BE036FC FOREIGN KEY (shipment_id) REFERENCES shipment (id)');
|
||||
$this->addSql('ALTER TABLE bovin_shipment ADD CONSTRAINT FK_7049F4507899F32E FOREIGN KEY (bovine_type_id) REFERENCES bovine_type_shipment (id)');
|
||||
$this->addSql('ALTER TABLE customer ADD CONSTRAINT FK_81398E094B3458B FOREIGN KEY (id_adress_id) REFERENCES address (id)');
|
||||
$this->addSql('ALTER TABLE shipment ADD CONSTRAINT FK_2CB20DC84554740 FOREIGN KEY (id_carrier_id) REFERENCES carrier (id)');
|
||||
$this->addSql('ALTER TABLE shipment ADD CONSTRAINT FK_2CB20DC817F550F FOREIGN KEY (id_carrier_1_id) REFERENCES vehicle (id)');
|
||||
$this->addSql('ALTER TABLE shipment ADD CONSTRAINT FK_2CB20DC964E905B FOREIGN KEY (id_truck_id) REFERENCES vehicle (id)');
|
||||
$this->addSql('ALTER TABLE shipment ADD CONSTRAINT FK_2CB20DC3B17D73A FOREIGN KEY (licence_plate_1_id) REFERENCES carrier (id)');
|
||||
$this->addSql('ALTER TABLE shipment ADD CONSTRAINT FK_2CB20DCF1D99706 FOREIGN KEY (id_vehicle_id) REFERENCES vehicle (id)');
|
||||
$this->addSql('ALTER TABLE shipment ADD CONSTRAINT FK_2CB20DC8B870E04 FOREIGN KEY (id_customer_id) REFERENCES customer (id)');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE bovin_shipment DROP CONSTRAINT FK_7049F4507BE036FC');
|
||||
$this->addSql('ALTER TABLE bovin_shipment DROP CONSTRAINT FK_7049F4507899F32E');
|
||||
$this->addSql('ALTER TABLE customer DROP CONSTRAINT FK_81398E094B3458B');
|
||||
$this->addSql('ALTER TABLE shipment DROP CONSTRAINT FK_2CB20DC84554740');
|
||||
$this->addSql('ALTER TABLE shipment DROP CONSTRAINT FK_2CB20DC817F550F');
|
||||
$this->addSql('ALTER TABLE shipment DROP CONSTRAINT FK_2CB20DC964E905B');
|
||||
$this->addSql('ALTER TABLE shipment DROP CONSTRAINT FK_2CB20DC3B17D73A');
|
||||
$this->addSql('ALTER TABLE shipment DROP CONSTRAINT FK_2CB20DCF1D99706');
|
||||
$this->addSql('ALTER TABLE shipment DROP CONSTRAINT FK_2CB20DC8B870E04');
|
||||
$this->addSql('DROP TABLE bovin_shipment');
|
||||
$this->addSql('DROP TABLE bovine_type_shipment');
|
||||
$this->addSql('DROP TABLE customer');
|
||||
$this->addSql('DROP TABLE shipment');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user