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 265dd972b..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, nullable: true)] + #[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/ChillMainBundle/migrations/Version20241104135957.php b/src/Bundle/ChillMainBundle/migrations/Version20241104135957.php new file mode 100644 index 000000000..af081b147 --- /dev/null +++ b/src/Bundle/ChillMainBundle/migrations/Version20241104135957.php @@ -0,0 +1,28 @@ +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\''); + } +}