| Numéro du ticket | Titre du ticket | |------------------|-----------------| | #278 | Plan du site | ## Description de la PR [#278] Plan du site ## Modification du .env ## Check list - [ ] Pas de régression - [x] TU/TI/TF rédigée - [x] TU/TI/TF OK - [ ] CHANGELOG modifié Co-authored-by: Matteo <matteo@yuno.malio.fr> Reviewed-on: #33 Co-authored-by: tristan <tristan@yuno.malio.fr> Co-committed-by: tristan <tristan@yuno.malio.fr>
This commit was merged in pull request #33.
This commit is contained in:
30
migrations/Version20260225123000.php
Normal file
30
migrations/Version20260225123000.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 Version20260225123000 extends AbstractMigration
|
||||
{
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Create bovine table and relation to building_case.';
|
||||
}
|
||||
|
||||
public function up(Schema $schema): void
|
||||
{
|
||||
$this->addSql('CREATE TABLE bovine (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, building_case_id INT DEFAULT NULL, national_number VARCHAR(50) NOT NULL, received_weight INT DEFAULT NULL, PRIMARY KEY(id))');
|
||||
$this->addSql('CREATE INDEX IDX_EA9E2A42F8D859DF ON bovine (building_case_id)');
|
||||
$this->addSql('CREATE UNIQUE INDEX uniq_bovine_national_number ON bovine (national_number)');
|
||||
$this->addSql('ALTER TABLE bovine ADD CONSTRAINT FK_EA9E2A42F8D859DF FOREIGN KEY (building_case_id) REFERENCES building_case (id) NOT DEFERRABLE');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE bovine DROP CONSTRAINT FK_EA9E2A42F8D859DF');
|
||||
$this->addSql('DROP TABLE bovine');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user