f263a11fe8
| 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: https://gitea.malio.fr/MALIO-DEV/Ferme/pulls/33 Co-authored-by: tristan <tristan@yuno.malio.fr> Co-committed-by: tristan <tristan@yuno.malio.fr>
31 lines
1.1 KiB
PHP
31 lines
1.1 KiB
PHP
<?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');
|
|
}
|
|
}
|