Merge branch 'clean_migrations' into 'master'

Clean migrations

See merge request Chill-Projet/chill-bundles!741
This commit is contained in:
Julien Fastré 2024-11-29 11:18:11 +00:00
commit a4cd15d2f5
33 changed files with 540 additions and 33 deletions

View File

@ -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.

View File

@ -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;

View File

@ -0,0 +1,41 @@
<?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\Activity;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20240918142723 extends AbstractMigration
{
public function getDescription(): string
{
return 'Fix not null and default values for activityreason, activityreasoncategory, comments on activity';
}
public function up(Schema $schema): void
{
$this->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');
}
}

View File

@ -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

View File

@ -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

View File

@ -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)]

View File

@ -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)]

View File

@ -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 = [];
/**

View File

@ -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';
/**

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\Event;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20241104135957 extends AbstractMigration
{
public function getDescription(): string
{
return 'Define default values for entity properties';
}
public function up(Schema $schema): void
{
$this->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\'');
}
}

View File

@ -0,0 +1,97 @@
<?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\Job;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20240918132916 extends AbstractMigration
{
public function getDescription(): string
{
return 'Rename indexes to reflect changes in column or table names within job bundle';
}
public function up(Schema $schema): void
{
$this->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');
}
}

View File

@ -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;
/**

View File

@ -39,7 +39,7 @@ class Country
* @var array<string, string>
*/
#[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 = [];

View File

@ -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(

View File

@ -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

View File

@ -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'])]

View File

@ -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'])]

View File

@ -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 = [];
/**

View File

@ -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 = [];
/**

View File

@ -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)]

View File

@ -0,0 +1,37 @@
<?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\Main;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20240918150339 extends AbstractMigration
{
public function getDescription(): string
{
return 'Set not null and defaults on columns. Drop customs column on address';
}
public function up(Schema $schema): void
{
$this->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 {}
}

View File

@ -0,0 +1,63 @@
<?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\Main;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20241101100750 extends AbstractMigration
{
public function getDescription(): string
{
return 'Rename indexes all capital';
}
public function up(Schema $schema): void
{
$this->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');
}
}

View File

@ -0,0 +1,54 @@
<?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\Main;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20241104085341 extends AbstractMigration
{
public function getDescription(): string
{
return 'Define NULL on entity properties';
}
public function up(Schema $schema): void
{
$this->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');
}
}

View File

@ -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')]

View File

@ -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 = [];

View File

@ -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'])]

View File

@ -0,0 +1,38 @@
<?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 Version20240918130649 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add comments on columns';
}
public function up(Schema $schema): void
{
$this->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 {}
}

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 Version20240918151852 extends AbstractMigration
{
public function getDescription(): string
{
return 'Set not null and defaults on columns';
}
public function up(Schema $schema): void
{
$this->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 {}
}

View File

@ -0,0 +1,39 @@
<?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 Version20241104142216 extends AbstractMigration
{
public function getDescription(): string
{
return 'Clean migration diverse';
}
public function up(Schema $schema): void
{
$this->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)');
}
}

View File

@ -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

View File

@ -0,0 +1,36 @@
<?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\Task;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20241101093514 extends AbstractMigration
{
public function getDescription(): string
{
return 'Set a default for task current_states';
}
public function up(Schema $schema): void
{
$this->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');
}
}

View File

@ -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 = '';

View File

@ -0,0 +1,31 @@
<?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\ThirdParty;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20240918152229 extends AbstractMigration
{
public function getDescription(): string
{
return 'Drop foreign key profession_id and set not null on firstname';
}
public function up(Schema $schema): void
{
$this->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 {}
}