Finalisation réception marchandise, ajout de composant UI et ajout de fixtures (!7)
| Numéro du ticket | Titre du ticket | |------------------|-----------------| | | | ## Description de la PR ## Modification du .env ## Check list - [x] Pas de régression - [ ] TU/TI/TF rédigée - [x] TU/TI/TF OK - [x] CHANGELOG modifié Reviewed-on: https://gitea.malio.fr/MALIO-DEV/Ferme/pulls/7 Co-authored-by: tristan <tristan@yuno.malio.fr> Co-committed-by: tristan <tristan@yuno.malio.fr>
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20260127000100 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Add reception types and link receptions to them';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->addSql('CREATE TABLE reception_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 reception_type_id INT DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE reception ADD CONSTRAINT FK_83DC02E37BD5B5D FOREIGN KEY (reception_type_id) REFERENCES reception_type (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('CREATE INDEX IDX_83DC02E37BD5B5D ON reception (reception_type_id)');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE reception DROP CONSTRAINT FK_83DC02E37BD5B5D');
|
||||
$this->addSql('DROP INDEX IDX_83DC02E37BD5B5D');
|
||||
$this->addSql('ALTER TABLE reception DROP reception_type_id');
|
||||
$this->addSql('DROP TABLE reception_type');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20260127000200 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Link receptions to a responsible user';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE reception ADD user_id INT DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE reception ADD CONSTRAINT FK_83DC02E3A76ED395 FOREIGN KEY (user_id) REFERENCES "user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('CREATE INDEX IDX_83DC02E3A76ED395 ON reception (user_id)');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE reception DROP CONSTRAINT FK_83DC02E3A76ED395');
|
||||
$this->addSql('DROP INDEX IDX_83DC02E3A76ED395');
|
||||
$this->addSql('ALTER TABLE reception DROP user_id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20260127000300 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Add suppliers and addresses, link receptions to suppliers';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->addSql('CREATE TABLE address (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, label VARCHAR(120) NOT NULL, street VARCHAR(180) NOT NULL, postal_code VARCHAR(20) NOT NULL, city VARCHAR(120) NOT NULL, country_code VARCHAR(2) NOT NULL, PRIMARY KEY(id))');
|
||||
$this->addSql('CREATE TABLE supplier (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, name VARCHAR(180) NOT NULL, PRIMARY KEY(id))');
|
||||
$this->addSql('CREATE TABLE supplier_address (supplier_id INT NOT NULL, address_id INT NOT NULL, PRIMARY KEY(supplier_id, address_id))');
|
||||
$this->addSql('CREATE INDEX IDX_3DCE3C74F2C1D6A8 ON supplier_address (supplier_id)');
|
||||
$this->addSql('CREATE INDEX IDX_3DCE3C746F9B8A0 ON supplier_address (address_id)');
|
||||
$this->addSql('ALTER TABLE supplier_address ADD CONSTRAINT FK_3DCE3C74F2C1D6A8 FOREIGN KEY (supplier_id) REFERENCES supplier (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('ALTER TABLE supplier_address ADD CONSTRAINT FK_3DCE3C746F9B8A0 FOREIGN KEY (address_id) REFERENCES address (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('ALTER TABLE reception ADD supplier_id INT DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE reception ADD CONSTRAINT FK_83DC02E32ADD6E01 FOREIGN KEY (supplier_id) REFERENCES supplier (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('CREATE INDEX IDX_83DC02E32ADD6E01 ON reception (supplier_id)');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE reception DROP CONSTRAINT FK_83DC02E32ADD6E01');
|
||||
$this->addSql('DROP INDEX IDX_83DC02E32ADD6E01');
|
||||
$this->addSql('ALTER TABLE reception DROP supplier_id');
|
||||
$this->addSql('ALTER TABLE supplier_address DROP CONSTRAINT FK_3DCE3C74F2C1D6A8');
|
||||
$this->addSql('ALTER TABLE supplier_address DROP CONSTRAINT FK_3DCE3C746F9B8A0');
|
||||
$this->addSql('DROP TABLE supplier_address');
|
||||
$this->addSql('DROP TABLE supplier');
|
||||
$this->addSql('DROP TABLE address');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20260127000400 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Add address_id on reception';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE reception ADD address_id INT DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE reception ADD CONSTRAINT FK_83DC02E3F5B7AF75 FOREIGN KEY (address_id) REFERENCES address (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('CREATE INDEX IDX_83DC02E3F5B7AF75 ON reception (address_id)');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE reception DROP CONSTRAINT FK_83DC02E3F5B7AF75');
|
||||
$this->addSql('DROP INDEX IDX_83DC02E3F5B7AF75');
|
||||
$this->addSql('ALTER TABLE reception DROP address_id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20260127000500 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Add trucks and link receptions to trucks';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->addSql('CREATE TABLE truck (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, name VARCHAR(180) NOT NULL, PRIMARY KEY(id))');
|
||||
$this->addSql('ALTER TABLE reception ADD truck_id INT DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE reception ADD CONSTRAINT FK_83DC02E3F7D15B1A FOREIGN KEY (truck_id) REFERENCES truck (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('CREATE INDEX IDX_83DC02E3F7D15B1A ON reception (truck_id)');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE reception DROP CONSTRAINT FK_83DC02E3F7D15B1A');
|
||||
$this->addSql('DROP INDEX IDX_83DC02E3F7D15B1A');
|
||||
$this->addSql('ALTER TABLE reception DROP truck_id');
|
||||
$this->addSql('DROP TABLE truck');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20260127000600 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Add carriers, drivers, vehicles and link receptions to carriers/drivers';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->addSql('CREATE TABLE carrier (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, name VARCHAR(180) NOT NULL, code VARCHAR(30) DEFAULT NULL, PRIMARY KEY(id))');
|
||||
$this->addSql('CREATE TABLE driver (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, carrier_id INT NOT NULL, name VARCHAR(180) NOT NULL, PRIMARY KEY(id))');
|
||||
$this->addSql('CREATE INDEX IDX_14B3BC5F4C3C5E0A ON driver (carrier_id)');
|
||||
$this->addSql('ALTER TABLE driver ADD CONSTRAINT FK_14B3BC5F4C3C5E0A FOREIGN KEY (carrier_id) REFERENCES carrier (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('CREATE TABLE vehicle (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, carrier_id INT NOT NULL, truck_id INT NOT NULL, plate VARCHAR(20) NOT NULL, PRIMARY KEY(id))');
|
||||
$this->addSql('CREATE INDEX IDX_1B80E4864C3C5E0A ON vehicle (carrier_id)');
|
||||
$this->addSql('CREATE INDEX IDX_1B80E4868BEBB4B ON vehicle (truck_id)');
|
||||
$this->addSql('ALTER TABLE vehicle ADD CONSTRAINT FK_1B80E4864C3C5E0A FOREIGN KEY (carrier_id) REFERENCES carrier (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('ALTER TABLE vehicle ADD CONSTRAINT FK_1B80E4868BEBB4B FOREIGN KEY (truck_id) REFERENCES truck (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('ALTER TABLE reception ADD carrier_id INT DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE reception ADD driver_id INT DEFAULT NULL');
|
||||
$this->addSql('CREATE INDEX IDX_83DC02E34C3C5E0A ON reception (carrier_id)');
|
||||
$this->addSql('CREATE INDEX IDX_83DC02E3F24C741B ON reception (driver_id)');
|
||||
$this->addSql('ALTER TABLE reception ADD CONSTRAINT FK_83DC02E34C3C5E0A FOREIGN KEY (carrier_id) REFERENCES carrier (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('ALTER TABLE reception ADD CONSTRAINT FK_83DC02E3F24C741B FOREIGN KEY (driver_id) REFERENCES driver (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE reception DROP CONSTRAINT FK_83DC02E34C3C5E0A');
|
||||
$this->addSql('ALTER TABLE reception DROP CONSTRAINT FK_83DC02E3F24C741B');
|
||||
$this->addSql('DROP INDEX IDX_83DC02E34C3C5E0A');
|
||||
$this->addSql('DROP INDEX IDX_83DC02E3F24C741B');
|
||||
$this->addSql('ALTER TABLE reception DROP carrier_id');
|
||||
$this->addSql('ALTER TABLE reception DROP driver_id');
|
||||
$this->addSql('ALTER TABLE vehicle DROP CONSTRAINT FK_1B80E4864C3C5E0A');
|
||||
$this->addSql('ALTER TABLE vehicle DROP CONSTRAINT FK_1B80E4868BEBB4B');
|
||||
$this->addSql('DROP TABLE vehicle');
|
||||
$this->addSql('ALTER TABLE driver DROP CONSTRAINT FK_14B3BC5F4C3C5E0A');
|
||||
$this->addSql('DROP TABLE driver');
|
||||
$this->addSql('DROP TABLE carrier');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20260127000700 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Allow null carrier code';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE carrier ALTER code DROP NOT NULL');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE carrier ALTER code SET NOT NULL');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20260128000100 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Add identification number to receptions';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE reception ADD identification_number VARCHAR(20) DEFAULT NULL');
|
||||
$this->addSql("UPDATE reception SET identification_number = 'N-BR-' || LPAD(id::text, 4, '0') WHERE identification_number IS NULL");
|
||||
$this->addSql('CREATE UNIQUE INDEX UNIQ_reception_identification_number ON reception (identification_number)');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('DROP INDEX UNIQ_reception_identification_number');
|
||||
$this->addSql('ALTER TABLE reception DROP identification_number');
|
||||
}
|
||||
}
|
||||
@@ -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');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20260128000300 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Add buildings, pellet types, and reception allocations';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->addSql('CREATE TABLE building (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, label VARCHAR(120) NOT NULL, code VARCHAR(50) NOT NULL, PRIMARY KEY(id))');
|
||||
$this->addSql('CREATE TABLE pellet_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('CREATE TABLE reception_building (reception_id INT NOT NULL, building_id INT NOT NULL, PRIMARY KEY(reception_id, building_id))');
|
||||
$this->addSql('CREATE INDEX IDX_46E7F9F23E4A2E34 ON reception_building (reception_id)');
|
||||
$this->addSql('CREATE INDEX IDX_46E7F9F24D2A7E12 ON reception_building (building_id)');
|
||||
$this->addSql('ALTER TABLE reception_building ADD CONSTRAINT FK_46E7F9F23E4A2E34 FOREIGN KEY (reception_id) REFERENCES reception (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('ALTER TABLE reception_building ADD CONSTRAINT FK_46E7F9F24D2A7E12 FOREIGN KEY (building_id) REFERENCES building (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('CREATE TABLE reception_pellet_building (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, reception_id INT NOT NULL, pellet_type_id INT NOT NULL, building_id INT NOT NULL, PRIMARY KEY(id))');
|
||||
$this->addSql('CREATE UNIQUE INDEX uniq_reception_pellet_building ON reception_pellet_building (reception_id, pellet_type_id, building_id)');
|
||||
$this->addSql('CREATE INDEX IDX_5DF3AA933E4A2E34 ON reception_pellet_building (reception_id)');
|
||||
$this->addSql('CREATE INDEX IDX_5DF3AA93955258D ON reception_pellet_building (pellet_type_id)');
|
||||
$this->addSql('CREATE INDEX IDX_5DF3AA934D2A7E12 ON reception_pellet_building (building_id)');
|
||||
$this->addSql('ALTER TABLE reception_pellet_building ADD CONSTRAINT FK_5DF3AA933E4A2E34 FOREIGN KEY (reception_id) REFERENCES reception (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('ALTER TABLE reception_pellet_building ADD CONSTRAINT FK_5DF3AA93955258D FOREIGN KEY (pellet_type_id) REFERENCES pellet_type (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('ALTER TABLE reception_pellet_building ADD CONSTRAINT FK_5DF3AA934D2A7E12 FOREIGN KEY (building_id) REFERENCES building (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE reception_pellet_building DROP CONSTRAINT FK_5DF3AA933E4A2E34');
|
||||
$this->addSql('ALTER TABLE reception_pellet_building DROP CONSTRAINT FK_5DF3AA93955258D');
|
||||
$this->addSql('ALTER TABLE reception_pellet_building DROP CONSTRAINT FK_5DF3AA934D2A7E12');
|
||||
$this->addSql('DROP TABLE reception_pellet_building');
|
||||
$this->addSql('ALTER TABLE reception_building DROP CONSTRAINT FK_46E7F9F23E4A2E34');
|
||||
$this->addSql('ALTER TABLE reception_building DROP CONSTRAINT FK_46E7F9F24D2A7E12');
|
||||
$this->addSql('DROP TABLE reception_building');
|
||||
$this->addSql('DROP TABLE pellet_type');
|
||||
$this->addSql('DROP TABLE building');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20260128000400 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Add merchandise detail to reception';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE reception ADD merchandise_detail VARCHAR(255) DEFAULT NULL');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE reception DROP merchandise_detail');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace DoctrineMigrations;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
final class Version20260130000100 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Add address street2 and supplier contact fields';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE address ADD street2 VARCHAR(180) DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE supplier ADD email VARCHAR(180) DEFAULT NULL');
|
||||
$this->addSql('ALTER TABLE supplier ADD phone VARCHAR(40) DEFAULT NULL');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE address DROP street2');
|
||||
$this->addSql('ALTER TABLE supplier DROP email');
|
||||
$this->addSql('ALTER TABLE supplier DROP phone');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user