feat : Expedition dev back-end WIP
This commit is contained in:
@@ -1,64 +0,0 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
64
migrations/Version20260204101625.php
Normal file
64
migrations/Version20260204101625.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 Version20260204101625 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, shipment_type_id INT DEFAULT NULL, PRIMARY KEY (id))');
|
||||
$this->addSql('CREATE INDEX IDX_7049F4507BE036FC ON bovin_shipment (shipment_id)');
|
||||
$this->addSql('CREATE INDEX IDX_7049F4502EE48A36 ON bovin_shipment (shipment_type_id)');
|
||||
$this->addSql('CREATE TABLE customer (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, label VARCHAR(255) NOT NULL, code VARCHAR(255) NOT NULL, PRIMARY KEY (id))');
|
||||
$this->addSql('CREATE TABLE customer_address (customer_id INT NOT NULL, address_id INT NOT NULL, PRIMARY KEY (customer_id, address_id))');
|
||||
$this->addSql('CREATE INDEX IDX_1193CB3F9395C3F3 ON customer_address (customer_id)');
|
||||
$this->addSql('CREATE INDEX IDX_1193CB3FF5B7AF75 ON customer_address (address_id)');
|
||||
$this->addSql('CREATE TABLE shipment (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, licence_plate VARCHAR(255) NOT NULL, identification_number VARCHAR(20) DEFAULT NULL, current_step INT DEFAULT 0 NOT NULL, is_valid BOOLEAN NOT NULL, shipment_date TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, carrier_id INT DEFAULT NULL, vehicle_id INT DEFAULT NULL, truck_id INT DEFAULT NULL, customer_id INT DEFAULT NULL, PRIMARY KEY (id))');
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_2CB20DC347639A5 ON shipment (identification_number)');
|
||||
$this->addSql('CREATE INDEX IDX_2CB20DC21DFC797 ON shipment (carrier_id)');
|
||||
$this->addSql('CREATE INDEX IDX_2CB20DC545317D1 ON shipment (vehicle_id)');
|
||||
$this->addSql('CREATE INDEX IDX_2CB20DCC6957CCE ON shipment (truck_id)');
|
||||
$this->addSql('CREATE INDEX IDX_2CB20DC9395C3F3 ON shipment (customer_id)');
|
||||
$this->addSql('CREATE TABLE shipment_type (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, label VARCHAR(255) NOT NULL, code VARCHAR(255) NOT NULL, PRIMARY KEY (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_7049F4502EE48A36 FOREIGN KEY (shipment_type_id) REFERENCES shipment_type (id)');
|
||||
$this->addSql('ALTER TABLE customer_address ADD CONSTRAINT FK_1193CB3F9395C3F3 FOREIGN KEY (customer_id) REFERENCES customer (id) ON DELETE CASCADE');
|
||||
$this->addSql('ALTER TABLE customer_address ADD CONSTRAINT FK_1193CB3FF5B7AF75 FOREIGN KEY (address_id) REFERENCES address (id) ON DELETE CASCADE');
|
||||
$this->addSql('ALTER TABLE shipment ADD CONSTRAINT FK_2CB20DC21DFC797 FOREIGN KEY (carrier_id) REFERENCES carrier (id) NOT DEFERRABLE');
|
||||
$this->addSql('ALTER TABLE shipment ADD CONSTRAINT FK_2CB20DC545317D1 FOREIGN KEY (vehicle_id) REFERENCES vehicle (id)');
|
||||
$this->addSql('ALTER TABLE shipment ADD CONSTRAINT FK_2CB20DCC6957CCE FOREIGN KEY (truck_id) REFERENCES truck (id) NOT DEFERRABLE');
|
||||
$this->addSql('ALTER TABLE shipment ADD CONSTRAINT FK_2CB20DC9395C3F3 FOREIGN KEY (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_7049F4502EE48A36');
|
||||
$this->addSql('ALTER TABLE customer_address DROP CONSTRAINT FK_1193CB3F9395C3F3');
|
||||
$this->addSql('ALTER TABLE customer_address DROP CONSTRAINT FK_1193CB3FF5B7AF75');
|
||||
$this->addSql('ALTER TABLE shipment DROP CONSTRAINT FK_2CB20DC21DFC797');
|
||||
$this->addSql('ALTER TABLE shipment DROP CONSTRAINT FK_2CB20DC545317D1');
|
||||
$this->addSql('ALTER TABLE shipment DROP CONSTRAINT FK_2CB20DCC6957CCE');
|
||||
$this->addSql('ALTER TABLE shipment DROP CONSTRAINT FK_2CB20DC9395C3F3');
|
||||
$this->addSql('DROP TABLE bovin_shipment');
|
||||
$this->addSql('DROP TABLE customer');
|
||||
$this->addSql('DROP TABLE customer_address');
|
||||
$this->addSql('DROP TABLE shipment');
|
||||
$this->addSql('DROP TABLE shipment_type');
|
||||
}
|
||||
}
|
||||
35
migrations/Version20260204102423.php
Normal file
35
migrations/Version20260204102423.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?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 Version20260204102423 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('ALTER TABLE shipment DROP CONSTRAINT fk_2cb20dc545317d1');
|
||||
$this->addSql('DROP INDEX idx_2cb20dc545317d1');
|
||||
$this->addSql('ALTER TABLE shipment DROP vehicle_id');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
// this down() migration is auto-generated, please modify it to your needs
|
||||
$this->addSql('ALTER TABLE shipment ADD vehicle_id INT DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE shipment ADD CONSTRAINT fk_2cb20dc545317d1 FOREIGN KEY (vehicle_id) REFERENCES vehicle (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('CREATE INDEX idx_2cb20dc545317d1 ON shipment (vehicle_id)');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user