diff --git a/src/Bundle/ChillActivityBundle/Entity/ActivityReason.php b/src/Bundle/ChillActivityBundle/Entity/ActivityReason.php index bf36ead6c..f6bdac24e 100644 --- a/src/Bundle/ChillActivityBundle/Entity/ActivityReason.php +++ b/src/Bundle/ChillActivityBundle/Entity/ActivityReason.php @@ -32,8 +32,8 @@ class ActivityReason #[ORM\GeneratedValue(strategy: 'AUTO')] private ?int $id = null; - #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)] - private array $name; + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, options: ['default' => '{}', 'jsonb' => true])] + private array $name = []; /** * Get active. diff --git a/src/Bundle/ChillActivityBundle/Entity/ActivityReasonCategory.php b/src/Bundle/ChillActivityBundle/Entity/ActivityReasonCategory.php index b31bb8731..c344fc539 100644 --- a/src/Bundle/ChillActivityBundle/Entity/ActivityReasonCategory.php +++ b/src/Bundle/ChillActivityBundle/Entity/ActivityReasonCategory.php @@ -31,11 +31,9 @@ class ActivityReasonCategory implements \Stringable #[ORM\GeneratedValue(strategy: 'AUTO')] private ?int $id = null; - /** - * @var string - */ - #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)] - private $name; + + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, options: ['default' => '{}', 'jsonb' => true])] + private array $name = []; /** * Array of ActivityReason. @@ -127,11 +125,9 @@ class ActivityReasonCategory implements \Stringable /** * Set name. * - * @param array $name - * * @return ActivityReasonCategory */ - public function setName($name) + public function setName(array $name) { $this->name = $name; diff --git a/src/Bundle/ChillActivityBundle/migrations/Version20240918142723.php b/src/Bundle/ChillActivityBundle/migrations/Version20240918142723.php new file mode 100644 index 000000000..8f0973853 --- /dev/null +++ b/src/Bundle/ChillActivityBundle/migrations/Version20240918142723.php @@ -0,0 +1,41 @@ +addSql('ALTER TABLE activity ALTER privatecomment_comments SET NOT NULL'); + $this->addSql('ALTER TABLE activityreason ALTER name SET DEFAULT \'{}\''); + $this->addSql('ALTER TABLE activityreason ALTER name SET NOT NULL'); + $this->addSql('ALTER INDEX idx_654a2fcd12469de2 RENAME TO IDX_AF82522312469DE2'); + $this->addSql('ALTER TABLE activityreasoncategory ALTER name SET DEFAULT \'{}\''); + $this->addSql('ALTER TABLE activityreasoncategory ALTER name SET NOT NULL'); + } + + public function down(Schema $schema): void + { + $this->addSql('ALTER TABLE activityreason ALTER name DROP DEFAULT'); + $this->addSql('ALTER TABLE activityreason ALTER name DROP NOT NULL'); + $this->addSql('ALTER TABLE activityreasoncategory ALTER name DROP DEFAULT'); + $this->addSql('ALTER TABLE activityreasoncategory ALTER name DROP NOT NULL'); + } +} diff --git a/src/Bundle/ChillBudgetBundle/Entity/ChargeKind.php b/src/Bundle/ChillBudgetBundle/Entity/ChargeKind.php index dd63399e9..d5a58c68c 100644 --- a/src/Bundle/ChillBudgetBundle/Entity/ChargeKind.php +++ b/src/Bundle/ChillBudgetBundle/Entity/ChargeKind.php @@ -37,13 +37,13 @@ class ChargeKind #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, options: ['default' => ''], nullable: false)] private string $kind = ''; - #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, length: 255, options: ['default' => '[]'])] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, length: 255, options: ['default' => '{}', 'jsonb' => true])] private array $name = []; #[ORM\Column(type: \Doctrine\DBAL\Types\Types::FLOAT, options: ['default' => '0.00'])] private float $ordering = 0.00; - #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, length: 255, options: ['default' => '[]'])] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, length: 255, options: ['default' => '{}', 'jsonb' => true])] private array $tags = []; public function getId(): ?int diff --git a/src/Bundle/ChillBudgetBundle/Entity/ResourceKind.php b/src/Bundle/ChillBudgetBundle/Entity/ResourceKind.php index ec867a480..603b7d6a4 100644 --- a/src/Bundle/ChillBudgetBundle/Entity/ResourceKind.php +++ b/src/Bundle/ChillBudgetBundle/Entity/ResourceKind.php @@ -39,13 +39,13 @@ class ResourceKind #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255, nullable: false, options: ['default' => ''])] private string $kind = ''; - #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, length: 255, options: ['default' => '[]'])] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, length: 255, options: ['default' => '{}', 'jsonb' => true])] private array $name = []; #[ORM\Column(type: \Doctrine\DBAL\Types\Types::FLOAT, options: ['default' => '0.00'])] private float $ordering = 0.00; - #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, length: 255, options: ['default' => '[]'])] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, length: 255, options: ['default' => '{}', 'jsonb' => true])] private array $tags = []; public function getId(): ?int diff --git a/src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php index 06ff658c7..04cdd2308 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php +++ b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomField.php @@ -48,7 +48,7 @@ class CustomField #[ORM\Column(type: \Doctrine\DBAL\Types\Types::FLOAT)] private ?float $ordering = null; - #[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, options: ['default' => false])] private false $required = false; #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255)] diff --git a/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldLongChoice/Option.php b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldLongChoice/Option.php index c8bdc6031..bd98cec68 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldLongChoice/Option.php +++ b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldLongChoice/Option.php @@ -33,7 +33,7 @@ class Option #[ORM\GeneratedValue(strategy: 'AUTO')] private ?int $id = null; - #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 50, name: 'internal_key')] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 50, name: 'internal_key', options: ['default' => ''])] private string $internalKey = ''; #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 15)] diff --git a/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsGroup.php b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsGroup.php index 723b47612..b50596eab 100644 --- a/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsGroup.php +++ b/src/Bundle/ChillCustomFieldsBundle/Entity/CustomFieldsGroup.php @@ -49,7 +49,7 @@ class CustomFieldsGroup #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)] private array|string $name; - #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, nullable: true, options: ['default' => '{}', 'jsonb' => true])] private array $options = []; /** diff --git a/src/Bundle/ChillEventBundle/Entity/Event.php b/src/Bundle/ChillEventBundle/Entity/Event.php index 2c2105b55..c065ed94f 100644 --- a/src/Bundle/ChillEventBundle/Entity/Event.php +++ b/src/Bundle/ChillEventBundle/Entity/Event.php @@ -85,7 +85,7 @@ class Event implements HasCenterInterface, HasScopeInterface, TrackCreationInter #[ORM\JoinTable('chill_event_event_documents')] private Collection $documents; - #[ORM\Column(type: \Doctrine\DBAL\Types\Types::DECIMAL, precision: 10, scale: 4, nullable: true, options: ['default' => null])] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::DECIMAL, precision: 10, scale: 4, nullable: true, options: ['default' => '0.0'])] private string $organizationCost = '0.0'; /** diff --git a/src/Bundle/ChillEventBundle/migrations/Version20241104135957.php b/src/Bundle/ChillEventBundle/migrations/Version20241104135957.php new file mode 100644 index 000000000..291e6cadc --- /dev/null +++ b/src/Bundle/ChillEventBundle/migrations/Version20241104135957.php @@ -0,0 +1,35 @@ +addSql('ALTER TABLE chill_event_event ALTER organizationcost DROP DEFAULT'); + $this->addSql('ALTER TABLE chill_person_accompanying_period_user_history ALTER startdate SET DEFAULT \'now()\''); + $this->addSql('ALTER TABLE chill_event_event ALTER organizationcost SET DEFAULT \'0.0\''); + } + + public function down(Schema $schema): void + { + $this->addSql('ALTER TABLE chill_event_event ALTER organizationCost SET DEFAULT \'0.0\''); + } +} diff --git a/src/Bundle/ChillJobBundle/src/migrations/Version20240918132916.php b/src/Bundle/ChillJobBundle/src/migrations/Version20240918132916.php new file mode 100644 index 000000000..68cd49d3d --- /dev/null +++ b/src/Bundle/ChillJobBundle/src/migrations/Version20240918132916.php @@ -0,0 +1,97 @@ +addSql('ALTER INDEX chill_job.uniq_10864f31217bbb47 RENAME TO UNIQ_38D83C54217BBB47'); + $this->addSql('ALTER INDEX chill_job.idx_10864f312654b57d RENAME TO IDX_38D83C542654B57D'); + $this->addSql('ALTER INDEX chill_job.idx_10864f3154866550 RENAME TO IDX_38D83C5454866550'); + $this->addSql('ALTER INDEX chill_job.idx_10864f318825e118 RENAME TO IDX_38D83C548825E118'); + $this->addSql('ALTER INDEX chill_job.idx_10864f31a396afac RENAME TO IDX_38D83C54A396AFAC'); + $this->addSql('ALTER INDEX chill_job.idx_10864f3187541764 RENAME TO IDX_38D83C5487541764'); + $this->addSql('ALTER INDEX chill_job.idx_10864f315cfc2299 RENAME TO IDX_38D83C545CFC2299'); + $this->addSql('ALTER INDEX chill_job.idx_10864f3134fdf11d RENAME TO IDX_38D83C5434FDF11D'); + $this->addSql('ALTER INDEX chill_job.idx_10864f315742c99d RENAME TO IDX_38D83C545742C99D'); + $this->addSql('ALTER INDEX chill_job.idx_10864f31166494d4 RENAME TO IDX_38D83C54166494D4'); + $this->addSql('ALTER INDEX chill_job.idx_10864f3172820d66 RENAME TO IDX_38D83C5472820D66'); + $this->addSql('ALTER INDEX chill_job.idx_10864f31afa5e636 RENAME TO IDX_38D83C54AFA5E636'); + $this->addSql('ALTER INDEX chill_job.idx_10864f3161e05c22 RENAME TO IDX_38D83C5461E05C22'); + $this->addSql('ALTER INDEX chill_job.idx_10864f316f744bb0 RENAME TO IDX_38D83C546F744BB0'); + $this->addSql('ALTER INDEX chill_job.idx_10864f31ac39b1b RENAME TO IDX_38D83C54AC39B1B'); + $this->addSql('ALTER INDEX chill_job.idx_10864f3172a75b6d RENAME TO IDX_38D83C5472A75B6D'); + $this->addSql('ALTER INDEX chill_job.idx_10864f31d486e642 RENAME TO IDX_38D83C54D486E642'); + $this->addSql('ALTER INDEX chill_job.idx_3f24f812217bbb47 RENAME TO IDX_ED350AE5217BBB47'); + $this->addSql('ALTER INDEX chill_job.idx_102a1262ae1799d8 RENAME TO IDX_5BE81B7AAE1799D8'); + $this->addSql('ALTER INDEX chill_job.idx_20be09e2ae1799d8 RENAME TO IDX_E66356C7AE1799D8'); + $this->addSql('ALTER INDEX chill_job.idx_172eac0a217bbb47 RENAME TO IDX_EB9F6A40217BBB47'); + $this->addSql('ALTER INDEX chill_job.idx_fbb3cbb4217bbb47 RENAME TO IDX_D3EDB8D1217BBB47'); + $this->addSql('ALTER INDEX chill_job.idx_fbb3cbb4a4aeafea RENAME TO IDX_D3EDB8D1A4AEAFEA'); + $this->addSql('ALTER INDEX chill_job.idx_fbb3cbb435e47e35 RENAME TO IDX_D3EDB8D135E47E35'); + $this->addSql('ALTER INDEX chill_job.idx_fbb3cbb4b5e04267 RENAME TO IDX_D3EDB8D1B5E04267'); + $this->addSql('ALTER INDEX chill_job.idx_12e4ffbf217bbb47 RENAME TO IDX_BE1A1859217BBB47'); + $this->addSql('ALTER INDEX chill_job.idx_3280b96db87bf7b5 RENAME TO IDX_A90849FBB87BF7B5'); + $this->addSql('ALTER INDEX chill_job.idx_3280b96d7cde30dd RENAME TO IDX_A90849FB7CDE30DD'); + $this->addSql('ALTER INDEX chill_job.idx_e0501be0b87bf7b5 RENAME TO IDX_C623D20B87BF7B5'); + $this->addSql('ALTER INDEX chill_job.idx_e0501be07cde30dd RENAME TO IDX_C623D207CDE30DD'); + $this->addSql('ALTER INDEX chill_job.uniq_d9e9cabc77153098 RENAME TO UNIQ_6F7420EA77153098'); + $this->addSql('ALTER INDEX chill_job.idx_d9e9cabced16fa20 RENAME TO IDX_6F7420EAED16FA20'); + $this->addSql('ALTER INDEX chill_job.uniq_3274952577153098 RENAME TO UNIQ_E3F2021F77153098'); + } + + public function down(Schema $schema): void + { + $this->addSql('ALTER INDEX chill_job.idx_a90849fb7cde30dd RENAME TO idx_3280b96d7cde30dd'); + $this->addSql('ALTER INDEX chill_job.idx_a90849fbb87bf7b5 RENAME TO idx_3280b96db87bf7b5'); + $this->addSql('ALTER INDEX chill_job.idx_d3edb8d1a4aeafea RENAME TO idx_fbb3cbb4a4aeafea'); + $this->addSql('ALTER INDEX chill_job.idx_d3edb8d1b5e04267 RENAME TO idx_fbb3cbb4b5e04267'); + $this->addSql('ALTER INDEX chill_job.idx_d3edb8d1217bbb47 RENAME TO idx_fbb3cbb4217bbb47'); + $this->addSql('ALTER INDEX chill_job.idx_d3edb8d135e47e35 RENAME TO idx_fbb3cbb435e47e35'); + $this->addSql('ALTER INDEX chill_job.idx_6f7420eaed16fa20 RENAME TO idx_d9e9cabced16fa20'); + $this->addSql('ALTER INDEX chill_job.uniq_6f7420ea77153098 RENAME TO uniq_d9e9cabc77153098'); + $this->addSql('ALTER INDEX chill_job.idx_be1a1859217bbb47 RENAME TO idx_12e4ffbf217bbb47'); + $this->addSql('ALTER INDEX chill_job.idx_c623d20b87bf7b5 RENAME TO idx_e0501be0b87bf7b5'); + $this->addSql('ALTER INDEX chill_job.idx_c623d207cde30dd RENAME TO idx_e0501be07cde30dd'); + $this->addSql('ALTER INDEX chill_job.uniq_e3f2021f77153098 RENAME TO uniq_3274952577153098'); + $this->addSql('ALTER INDEX chill_job.idx_eb9f6a40217bbb47 RENAME TO idx_172eac0a217bbb47'); + $this->addSql('ALTER INDEX chill_job.idx_e66356c7ae1799d8 RENAME TO idx_20be09e2ae1799d8'); + $this->addSql('ALTER INDEX chill_job.idx_5be81b7aae1799d8 RENAME TO idx_102a1262ae1799d8'); + $this->addSql('ALTER INDEX chill_job.idx_ed350ae5217bbb47 RENAME TO idx_3f24f812217bbb47'); + $this->addSql('ALTER INDEX chill_job.idx_38d83c5472820d66 RENAME TO idx_10864f3172820d66'); + $this->addSql('ALTER INDEX chill_job.idx_38d83c5434fdf11d RENAME TO idx_10864f3134fdf11d'); + $this->addSql('ALTER INDEX chill_job.idx_38d83c5454866550 RENAME TO idx_10864f3154866550'); + $this->addSql('ALTER INDEX chill_job.idx_38d83c5472a75b6d RENAME TO idx_10864f3172a75b6d'); + $this->addSql('ALTER INDEX chill_job.idx_38d83c542654b57d RENAME TO idx_10864f312654b57d'); + $this->addSql('ALTER INDEX chill_job.idx_38d83c54ac39b1b RENAME TO idx_10864f31ac39b1b'); + $this->addSql('ALTER INDEX chill_job.idx_38d83c54a396afac RENAME TO idx_10864f31a396afac'); + $this->addSql('ALTER INDEX chill_job.uniq_38d83c54217bbb47 RENAME TO uniq_10864f31217bbb47'); + $this->addSql('ALTER INDEX chill_job.idx_38d83c545cfc2299 RENAME TO idx_10864f315cfc2299'); + $this->addSql('ALTER INDEX chill_job.idx_38d83c5487541764 RENAME TO idx_10864f3187541764'); + $this->addSql('ALTER INDEX chill_job.idx_38d83c5461e05c22 RENAME TO idx_10864f3161e05c22'); + $this->addSql('ALTER INDEX chill_job.idx_38d83c545742c99d RENAME TO idx_10864f315742c99d'); + $this->addSql('ALTER INDEX chill_job.idx_38d83c54166494d4 RENAME TO idx_10864f31166494d4'); + $this->addSql('ALTER INDEX chill_job.idx_38d83c546f744bb0 RENAME TO idx_10864f316f744bb0'); + $this->addSql('ALTER INDEX chill_job.idx_38d83c548825e118 RENAME TO idx_10864f318825e118'); + $this->addSql('ALTER INDEX chill_job.idx_38d83c54d486e642 RENAME TO idx_10864f31d486e642'); + $this->addSql('ALTER INDEX chill_job.idx_38d83c54afa5e636 RENAME TO idx_10864f31afa5e636'); + } +} diff --git a/src/Bundle/ChillMainBundle/Entity/Center.php b/src/Bundle/ChillMainBundle/Entity/Center.php index 0d0858a6e..1ac7f5977 100644 --- a/src/Bundle/ChillMainBundle/Entity/Center.php +++ b/src/Bundle/ChillMainBundle/Entity/Center.php @@ -36,7 +36,7 @@ class Center implements HasCenterInterface, \Stringable #[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255)] private string $name = ''; - #[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, options: ['default' => true])] private bool $isActive = true; /** diff --git a/src/Bundle/ChillMainBundle/Entity/Country.php b/src/Bundle/ChillMainBundle/Entity/Country.php index 533caeaec..c5433d46c 100644 --- a/src/Bundle/ChillMainBundle/Entity/Country.php +++ b/src/Bundle/ChillMainBundle/Entity/Country.php @@ -39,7 +39,7 @@ class Country * @var array */ #[Groups(['read', 'docgen:read'])] - #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, options: ['default' => '[]', 'jsonb' => true])] #[Context(['is-translatable' => true], groups: ['docgen:read'])] private array $name = []; diff --git a/src/Bundle/ChillMainBundle/Entity/CronJobExecution.php b/src/Bundle/ChillMainBundle/Entity/CronJobExecution.php index f2f1194c8..dd3c5da58 100644 --- a/src/Bundle/ChillMainBundle/Entity/CronJobExecution.php +++ b/src/Bundle/ChillMainBundle/Entity/CronJobExecution.php @@ -30,7 +30,7 @@ class CronJobExecution #[ORM\Column(type: \Doctrine\DBAL\Types\Types::INTEGER, nullable: true, options: ['default' => null])] private ?int $lastStatus = null; - #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, options: ['default' => "'{}'::jsonb", 'jsonb' => true])] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, options: ['default' => '{}', 'jsonb' => true])] private array $lastExecutionData = []; public function __construct( diff --git a/src/Bundle/ChillMainBundle/Entity/DashboardConfigItem.php b/src/Bundle/ChillMainBundle/Entity/DashboardConfigItem.php index 6fdd34cfc..d94e93742 100644 --- a/src/Bundle/ChillMainBundle/Entity/DashboardConfigItem.php +++ b/src/Bundle/ChillMainBundle/Entity/DashboardConfigItem.php @@ -39,7 +39,7 @@ class DashboardConfigItem private ?User $user = null; #[Serializer\Groups(['dashboardConfigItem:read'])] - #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, options: ['default' => '[]', 'jsonb' => true])] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, options: ['default' => '{}', 'jsonb' => true])] private array $metadata = []; public function getId(): ?int diff --git a/src/Bundle/ChillMainBundle/Entity/Location.php b/src/Bundle/ChillMainBundle/Entity/Location.php index 228fd089f..5705e6a1a 100644 --- a/src/Bundle/ChillMainBundle/Entity/Location.php +++ b/src/Bundle/ChillMainBundle/Entity/Location.php @@ -26,7 +26,7 @@ use Symfony\Component\Serializer\Annotation\DiscriminatorMap; class Location implements TrackCreationInterface, TrackUpdateInterface { #[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 $active = true; #[Serializer\Groups(['read', 'write', 'docgen:read'])] diff --git a/src/Bundle/ChillMainBundle/Entity/LocationType.php b/src/Bundle/ChillMainBundle/Entity/LocationType.php index df212646a..16bca82e9 100644 --- a/src/Bundle/ChillMainBundle/Entity/LocationType.php +++ b/src/Bundle/ChillMainBundle/Entity/LocationType.php @@ -34,7 +34,7 @@ class LocationType final public const STATUS_REQUIRED = 'required'; #[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 $active = true; #[Serializer\Groups(['read'])] @@ -54,7 +54,7 @@ class LocationType private ?string $defaultFor = null; #[Serializer\Groups(['read'])] - #[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN, options: ['default' => true])] private bool $editableByUsers = true; #[Serializer\Groups(['read', 'docgen:read'])] diff --git a/src/Bundle/ChillMainBundle/Entity/Notification.php b/src/Bundle/ChillMainBundle/Entity/Notification.php index d85a144b0..9f08e0487 100644 --- a/src/Bundle/ChillMainBundle/Entity/Notification.php +++ b/src/Bundle/ChillMainBundle/Entity/Notification.php @@ -41,7 +41,7 @@ class Notification implements TrackUpdateInterface * * @var array|string[] */ - #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, options: ['default' => '[]', 'jsonb' => true])] private array $addressesEmails = []; /** diff --git a/src/Bundle/ChillMainBundle/Entity/PermissionsGroup.php b/src/Bundle/ChillMainBundle/Entity/PermissionsGroup.php index 4902fca95..723513c8b 100644 --- a/src/Bundle/ChillMainBundle/Entity/PermissionsGroup.php +++ b/src/Bundle/ChillMainBundle/Entity/PermissionsGroup.php @@ -24,7 +24,7 @@ class PermissionsGroup /** * @var string[] */ - #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, options: ['default' => '[]', 'jsonb' => true])] private array $flags = []; /** diff --git a/src/Bundle/ChillMainBundle/Entity/User.php b/src/Bundle/ChillMainBundle/Entity/User.php index 448efbdd1..8a31779f9 100644 --- a/src/Bundle/ChillMainBundle/Entity/User.php +++ b/src/Bundle/ChillMainBundle/Entity/User.php @@ -45,7 +45,7 @@ class User implements UserInterface, \Stringable, PasswordAuthenticatedUserInter /** * Array where SAML attributes's data are stored. */ - #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, nullable: false)] + #[ORM\Column(type: \Doctrine\DBAL\Types\Types::JSON, nullable: false, options: ['default' => '[]', 'jsonb' => true])] private array $attributes = []; #[ORM\ManyToOne(targetEntity: Civility::class)] diff --git a/src/Bundle/ChillMainBundle/migrations/Version20240918150339.php b/src/Bundle/ChillMainBundle/migrations/Version20240918150339.php new file mode 100644 index 000000000..cd0e17fd1 --- /dev/null +++ b/src/Bundle/ChillMainBundle/migrations/Version20240918150339.php @@ -0,0 +1,37 @@ +addSql('ALTER TABLE chill_main_address DROP customs'); + $this->addSql('ALTER TABLE chill_main_dashboard_config_item ALTER metadata SET NOT NULL'); + $this->addSql('ALTER TABLE chill_main_location ALTER active SET NOT NULL'); + $this->addSql('ALTER TABLE chill_main_location_type ALTER active SET NOT NULL'); + $this->addSql('ALTER TABLE chill_main_location_type ALTER editablebyusers SET NOT NULL'); + $this->addSql('ALTER TABLE country ALTER name SET NOT NULL'); + $this->addSql('ALTER TABLE permission_groups ALTER name SET DEFAULT \'\''); + $this->addSql('ALTER TABLE users ALTER attributes SET DEFAULT \'[]\''); + } + + public function down(Schema $schema): void {} +} diff --git a/src/Bundle/ChillMainBundle/migrations/Version20241101100750.php b/src/Bundle/ChillMainBundle/migrations/Version20241101100750.php new file mode 100644 index 000000000..9c1e99ad8 --- /dev/null +++ b/src/Bundle/ChillMainBundle/migrations/Version20241101100750.php @@ -0,0 +1,63 @@ +addSql('ALTER INDEX idx_154a075fef1a9d84 RENAME TO IDX_589D51B4EF1A9D84'); + $this->addSql('ALTER INDEX idx_154a075fa76ed395 RENAME TO IDX_589D51B4A76ED395'); + $this->addSql('ALTER INDEX idx_a9f001fa7e6af9d4 RENAME TO IDX_D63001607E6AF9D4'); + $this->addSql('ALTER INDEX idx_a9f001faa76ed395 RENAME TO IDX_D6300160A76ED395'); + $this->addSql('ALTER INDEX idx_64a4a621504cb38d RENAME TO IDX_E260A868504CB38D'); + $this->addSql('ALTER INDEX idx_92351ece727aca70 RENAME TO IDX_72D110E8727ACA70'); + $this->addSql('ALTER INDEX idx_person_center RENAME TO IDX_BF210A145932F377'); + $this->addSql('ALTER INDEX idx_3370d4403818da5 RENAME TO IDX_BF210A143818DA5'); + $this->addSql('ALTER INDEX idx_3370d4401c9da55 RENAME TO IDX_BF210A141C9DA55'); + $this->addSql('ALTER INDEX idx_9bc1fd50f5b7af75 RENAME TO IDX_B9CEBEACF5B7AF75'); + $this->addSql('ALTER INDEX idx_9bc1fd50dca38092 RENAME TO IDX_B9CEBEACDCA38092'); + $this->addSql('ALTER INDEX idx_9bc1fd508dfc48dc RENAME TO IDX_B9CEBEAC8DFC48DC'); + $this->addSql('ALTER INDEX idx_9bc1fd50217bbb47 RENAME TO IDX_B9CEBEAC217BBB47'); + $this->addSql('ALTER INDEX idx_40fb5d6dfec418b RENAME TO IDX_7A6FDBEFEC418B'); + $this->addSql('ALTER INDEX idx_286dc95df53b66 RENAME TO IDX_7A48DF7F5DF53B66'); + $this->addSql('ALTER INDEX idx_a14d8f3d447bbb3b RENAME TO IDX_A14D8F3D96DF1F10'); + } + + public function down(Schema $schema): void + { + $this->addSql('ALTER INDEX idx_72d110e8727aca70 RENAME TO idx_92351ece727aca70'); + $this->addSql('ALTER INDEX idx_589d51b4a76ed395 RENAME TO idx_154a075fa76ed395'); + $this->addSql('ALTER INDEX idx_589d51b4ef1a9d84 RENAME TO idx_154a075fef1a9d84'); + $this->addSql('ALTER INDEX idx_bf210a143818da5 RENAME TO idx_3370d4403818da5'); + $this->addSql('ALTER INDEX idx_bf210a141c9da55 RENAME TO idx_3370d4401c9da55'); + $this->addSql('ALTER INDEX idx_bf210a145932f377 RENAME TO idx_person_center'); + $this->addSql('ALTER INDEX idx_e260a868504cb38d RENAME TO idx_64a4a621504cb38d'); + $this->addSql('ALTER INDEX idx_d63001607e6af9d4 RENAME TO idx_a9f001fa7e6af9d4'); + $this->addSql('ALTER INDEX idx_d6300160a76ed395 RENAME TO idx_a9f001faa76ed395'); + $this->addSql('ALTER INDEX idx_7a48df7f5df53b66 RENAME TO idx_286dc95df53b66'); + $this->addSql('ALTER INDEX idx_a14d8f3d96df1f10 RENAME TO idx_a14d8f3d447bbb3b'); + $this->addSql('ALTER INDEX idx_b9cebeacdca38092 RENAME TO idx_9bc1fd50dca38092'); + $this->addSql('ALTER INDEX idx_b9cebeacf5b7af75 RENAME TO idx_9bc1fd50f5b7af75'); + $this->addSql('ALTER INDEX idx_b9cebeac8dfc48dc RENAME TO idx_9bc1fd508dfc48dc'); + $this->addSql('ALTER INDEX idx_b9cebeac217bbb47 RENAME TO idx_9bc1fd50217bbb47'); + $this->addSql('ALTER INDEX idx_7a6fdbefec418b RENAME TO idx_40fb5d6dfec418b'); + } +} diff --git a/src/Bundle/ChillMainBundle/migrations/Version20241104085341.php b/src/Bundle/ChillMainBundle/migrations/Version20241104085341.php new file mode 100644 index 000000000..d1b44bda8 --- /dev/null +++ b/src/Bundle/ChillMainBundle/migrations/Version20241104085341.php @@ -0,0 +1,54 @@ +addSql('ALTER TABLE chill_main_dashboard_config_item ALTER metadata SET NOT NULL'); + $this->addSql('ALTER TABLE chill_main_location_type ALTER editablebyusers SET NOT NULL'); + $this->addSql('ALTER TABLE chill_person_accompanying_period_work ALTER privatecomment_comments 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'); + $this->addSql('ALTER TABLE country ALTER name SET NOT NULL'); + $this->addSql('ALTER TABLE customfield ALTER required SET NOT NULL'); + $this->addSql('ALTER TABLE chill_3party.third_party ALTER firstname SET NOT NULL'); + } + + public function down(Schema $schema): void + { + $this->addSql('ALTER TABLE chill_person_accompanying_period_work ALTER privateComment_comments DROP NOT NULL'); + $this->addSql('ALTER TABLE chill_person_phone ALTER phonenumber DROP NOT NULL'); + $this->addSql('ALTER TABLE chill_main_location_type ALTER editableByUsers DROP NOT NULL'); + $this->addSql('ALTER TABLE chill_main_dashboard_config_item ALTER metadata DROP NOT NULL'); + $this->addSql('ALTER TABLE chill_3party.third_party ALTER firstname DROP NOT NULL'); + $this->addSql('ALTER TABLE country ALTER name DROP NOT NULL'); + $this->addSql('ALTER TABLE chill_person_household_composition_type ALTER label DROP NOT NULL'); + $this->addSql('ALTER TABLE customfieldsgroup ALTER options DROP NOT NULL'); + $this->addSql('ALTER TABLE chill_person_resource ALTER createdAt SET NOT NULL'); + $this->addSql('ALTER TABLE chill_person_resource ALTER createdBy_id SET NOT NULL'); + $this->addSql('ALTER TABLE customfield ALTER required DROP NOT NULL'); + $this->addSql('ALTER TABLE chill_person_relations ALTER isActive SET NOT NULL'); + } +} 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..3c427999d --- /dev/null +++ b/src/Bundle/ChillPersonBundle/migrations/Version20240918130649.php @@ -0,0 +1,38 @@ +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..27827a86d --- /dev/null +++ b/src/Bundle/ChillPersonBundle/migrations/Version20240918151852.php @@ -0,0 +1,40 @@ +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 {} +} diff --git a/src/Bundle/ChillPersonBundle/migrations/Version20241104142216.php b/src/Bundle/ChillPersonBundle/migrations/Version20241104142216.php new file mode 100644 index 000000000..5ad28eba7 --- /dev/null +++ b/src/Bundle/ChillPersonBundle/migrations/Version20241104142216.php @@ -0,0 +1,39 @@ +addSql('ALTER TABLE chill_person_marital_status ALTER id TYPE VARCHAR(7)'); + $this->addSql('ALTER TABLE chill_person_person DROP cfdata_old'); + $this->addSql('ALTER TABLE chill_person_person ALTER maritalstatus_id TYPE VARCHAR(7)'); + } + + public function down(Schema $schema): void + { + $this->addSql('ALTER TABLE chill_person_person ADD cfdata_old TEXT DEFAULT NULL'); + $this->addSql('ALTER TABLE chill_person_person ALTER cFData DROP NOT NULL'); + $this->addSql('ALTER TABLE chill_person_person ALTER maritalStatus_id TYPE VARCHAR(10)'); + $this->addSql('COMMENT ON COLUMN chill_person_person.cfdata_old IS \'(DC2Type:array)\''); + $this->addSql('ALTER TABLE chill_person_marital_status ALTER id TYPE VARCHAR(10)'); + } +} diff --git a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml index 6c71eba95..fb084e2a6 100644 --- a/src/Bundle/ChillPersonBundle/translations/messages.fr.yml +++ b/src/Bundle/ChillPersonBundle/translations/messages.fr.yml @@ -153,7 +153,7 @@ Reset: 'Remise à zéro' 'Person Menu': 'Menu usager' 'The person data are not valid': 'Les données de votre formulaire sont invalides.' 'The person has been created': 'Le dossier a été créé' -'Person search results': 'Recherche de usagers' +'Person search results': 'Recherche d''usagers' Person search results by phonenumber: Recherche d'usager par numéro de téléphone 'Search within persons': 'Recherche parmi les usagers' Open person file: Ouvrir le dossier de l'usager diff --git a/src/Bundle/ChillTaskBundle/migrations/Version20241101093514.php b/src/Bundle/ChillTaskBundle/migrations/Version20241101093514.php new file mode 100644 index 000000000..4640d7e5e --- /dev/null +++ b/src/Bundle/ChillTaskBundle/migrations/Version20241101093514.php @@ -0,0 +1,36 @@ +addSql('ALTER TABLE chill_task.recurring_task ALTER current_states SET DEFAULT \'[]\''); + $this->addSql('ALTER TABLE chill_task.single_task ALTER current_states SET DEFAULT \'[]\''); + + } + + public function down(Schema $schema): void + { + $this->addSql('ALTER TABLE chill_task.single_task ALTER current_states DROP DEFAULT'); + $this->addSql('ALTER TABLE chill_task.recurring_task ALTER current_states DROP DEFAULT'); + } +} diff --git a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php index a905b3ffb..eb35aea4d 100644 --- a/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php +++ b/src/Bundle/ChillThirdPartyBundle/Entity/ThirdParty.php @@ -200,7 +200,7 @@ class ThirdParty implements TrackCreationInterface, TrackUpdateInterface, \Strin * [fr] Qualité. */ #[Groups(['read', 'write', 'docgen:read', 'docgen:read:3party:parent'])] - #[ORM\Column(name: 'profession', type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false)] + #[ORM\Column(name: 'profession', type: \Doctrine\DBAL\Types\Types::TEXT, nullable: false, options: ['default' => ''])] #[Context(normalizationContext: ['groups' => 'docgen:read'], groups: ['docgen:read:3party:parent'])] private string $profession = ''; diff --git a/src/Bundle/ChillThirdPartyBundle/migrations/Version20240918152229.php b/src/Bundle/ChillThirdPartyBundle/migrations/Version20240918152229.php new file mode 100644 index 000000000..bc42f3012 --- /dev/null +++ b/src/Bundle/ChillThirdPartyBundle/migrations/Version20240918152229.php @@ -0,0 +1,31 @@ +addSql('ALTER TABLE chill_3party.third_party DROP profession_id'); + $this->addSql('ALTER TABLE chill_3party.third_party ALTER firstname SET NOT NULL'); + } + + public function down(Schema $schema): void {} +}