Merge branch 'add-dependents' into 'master'

add household properties :  number of dependents and number of dependents with disabilities

See merge request Chill-Projet/chill-bundles!778
This commit is contained in:
2025-02-13 12:41:29 +00:00
35 changed files with 915 additions and 7 deletions

View File

@@ -0,0 +1,40 @@
<?php
declare(strict_types=1);
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\Migrations\Person;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20241127160628 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add administrative status';
}
public function up(Schema $schema): void
{
$this->addSql('CREATE SEQUENCE chill_person_administrative_status_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE TABLE chill_person_administrative_status (id INT NOT NULL, name JSON NOT NULL, active BOOLEAN NOT NULL, ordering DOUBLE PRECISION DEFAULT \'0.0\', PRIMARY KEY(id))');
$this->addSql('ALTER TABLE chill_person_person ADD administrativeStatus_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE chill_person_person ADD CONSTRAINT FK_BF210A146E64B00C FOREIGN KEY (administrativeStatus_id) REFERENCES chill_person_administrative_status (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('CREATE INDEX IDX_BF210A146E64B00C ON chill_person_person (administrativeStatus_id)');
}
public function down(Schema $schema): void
{
$this->addSql('DROP SEQUENCE chill_person_administrative_status_id_seq CASCADE');
$this->addSql('ALTER TABLE chill_person_person DROP CONSTRAINT FK_BF210A146E64B00C');
$this->addSql('DROP TABLE chill_person_administrative_status');
$this->addSql('ALTER TABLE chill_person_person DROP administrativeStatus_id');
}
}

View File

@@ -0,0 +1,35 @@
<?php
declare(strict_types=1);
/*
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Chill\Migrations\Person;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20241220102357 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add numberOfDependents and numberOfDependentsWithDisabilities';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE chill_person_household_composition ADD numberOfDependents INT DEFAULT NULL');
$this->addSql('ALTER TABLE chill_person_household_composition ADD numberOfDependentsWithDisabilities INT DEFAULT NULL');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE chill_person_household_composition DROP numberOfDependents');
$this->addSql('ALTER TABLE chill_person_household_composition DROP numberOfDependentsWithDisabilities');
}
}