feat : finalisation de l'étape 1 "Réception" (formulaire)
This commit is contained in:
30
migrations/Version20260127000400.php
Normal file
30
migrations/Version20260127000400.php
Normal file
@@ -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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user