diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/ClosingMotive.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/ClosingMotive.php index fc61aed9e..50cd3a88c 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/ClosingMotive.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/ClosingMotive.php @@ -45,7 +45,7 @@ class ClosingMotive #[Serializer\Context(['is-translatable' => true], groups: ['docgen:read'])] private array $name = []; - #[ORM\Column(type: \Doctrine\DBAL\Types\Types::FLOAT)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::FLOAT, options: ['default' => 0.0])] private float $ordering = 0.0; #[ORM\ManyToOne(targetEntity: ClosingMotive::class, inversedBy: 'children')] diff --git a/src/Bundle/ChillPersonBundle/Entity/Household/HouseholdCompositionType.php b/src/Bundle/ChillPersonBundle/Entity/Household/HouseholdCompositionType.php index 695105084..9d172f5be 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Household/HouseholdCompositionType.php +++ b/src/Bundle/ChillPersonBundle/Entity/Household/HouseholdCompositionType.php @@ -29,7 +29,7 @@ class HouseholdCompositionType private ?int $id = null; #[Serializer\Groups(['read', 'docgen:read'])] - #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, options: ['default' => '{}', 'jsonb' => true])] #[Serializer\Context(['is-translatable' => true], groups: ['docgen:read'])] private array $label = []; diff --git a/src/Bundle/ChillPersonBundle/Entity/Relationships/Relation.php b/src/Bundle/ChillPersonBundle/Entity/Relationships/Relation.php index 56d051608..2c4999616 100644 --- a/src/Bundle/ChillPersonBundle/Entity/Relationships/Relation.php +++ b/src/Bundle/ChillPersonBundle/Entity/Relationships/Relation.php @@ -27,7 +27,7 @@ class Relation private ?int $id = null; #[Serializer\Groups(['read'])] - #[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, nullable: true)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, options: ['default' => true])] private bool $isActive = true; #[Serializer\Groups(['read'])] diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20240918130649.php b/src/Bundle/ChillPersonBundle/migrations/Version20240918130649.php new file mode 100644 index 000000000..1583ea6d0 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/migrations/Version20240918130649.php @@ -0,0 +1,33 @@ +addSql('COMMENT ON COLUMN chill_person_household_composition.createdAt IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('COMMENT ON COLUMN chill_person_household_composition.updatedAt IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('COMMENT ON COLUMN chill_person_household_members.startDate IS \'(DC2Type:date_immutable)\''); + $this->addSql('COMMENT ON COLUMN chill_person_household_members.endDate IS \'(DC2Type:date_immutable)\''); + $this->addSql('COMMENT ON COLUMN chill_person_person.phonenumber IS \'(DC2Type:phone_number)\''); + $this->addSql('COMMENT ON COLUMN chill_person_person.mobilenumber IS \'(DC2Type:phone_number)\''); + $this->addSql('COMMENT ON COLUMN chill_person_phone.phonenumber IS \'(DC2Type:phone_number)\''); + $this->addSql('COMMENT ON COLUMN chill_person_resource.createdAt IS \'(DC2Type:datetime_immutable)\''); + $this->addSql('COMMENT ON COLUMN chill_person_resource.updatedAt IS \'(DC2Type:datetime_immutable)\''); + } + + public function down(Schema $schema): void + { + } +} diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20240918151852.php b/src/Bundle/ChillPersonBundle/migrations/Version20240918151852.php new file mode 100644 index 000000000..0de63bb1e --- /dev/null +++ b/src/Bundle/ChillPersonBundle/migrations/Version20240918151852.php @@ -0,0 +1,35 @@ +addSql('ALTER TABLE chill_person_accompanying_period_participation ALTER startdate DROP DEFAULT'); + $this->addSql('ALTER TABLE chill_person_accompanying_period_user_history ALTER startdate SET DEFAULT \'now()\''); + $this->addSql('ALTER TABLE chill_person_accompanying_period_work ALTER privatecomment_comments SET NOT NULL'); + $this->addSql('ALTER TABLE chill_person_accompanying_period_work_referrer ALTER id DROP DEFAULT'); + $this->addSql('ALTER TABLE chill_person_household_composition_type ALTER label SET DEFAULT \'{}\''); + $this->addSql('ALTER TABLE chill_person_household_composition_type ALTER label SET NOT NULL'); + $this->addSql('ALTER TABLE chill_person_phone ALTER phonenumber SET NOT NULL'); + $this->addSql('ALTER TABLE chill_person_relationships ALTER createdby_id DROP NOT NULL'); + $this->addSql('ALTER TABLE chill_person_relationships ALTER createdat DROP NOT NULL'); + $this->addSql('ALTER TABLE chill_person_resource ALTER createdby_id DROP NOT NULL'); + $this->addSql('ALTER TABLE chill_person_resource ALTER createdat DROP NOT NULL'); + } + + public function down(Schema $schema): void + { + } +}