mirror of
				https://gitlab.com/Chill-Projet/chill-bundles.git
				synced 2025-10-31 09:18:24 +00:00 
			
		
		
		
	Remove not null constraint in db on updatedat property for notification
This commit is contained in:
		| @@ -17,6 +17,7 @@ use Chill\PersonBundle\Entity\Person; | ||||
| use Doctrine\ORM\EntityManagerInterface; | ||||
| use Doctrine\Persistence\ManagerRegistry; | ||||
| use Psr\Log\LoggerInterface; | ||||
| use Symfony\Bridge\Doctrine\Attribute\MapEntity; | ||||
| use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; | ||||
| use Symfony\Component\Form\Extension\Core\Type\SubmitType; | ||||
| use Symfony\Component\Form\Form; | ||||
| @@ -39,7 +40,7 @@ abstract class AbstractElementController extends AbstractController | ||||
|      *  name="chill_family_members_family_members_delete" | ||||
|      * ). | ||||
|      */ | ||||
|     protected function _delete(AbstractElement $element, Request $request, mixed $template, mixed $flashMessage): Response | ||||
|     protected function _delete(#[MapEntity(id: 'id')] AbstractElement $element, Request $request, mixed $template, mixed $flashMessage): Response | ||||
|     { | ||||
|         $this->denyAccessUnlessGranted(BudgetElementVoter::DELETE, $element, 'You are not ' | ||||
|             .'allowed to delete this item'); | ||||
| @@ -179,7 +180,7 @@ abstract class AbstractElementController extends AbstractController | ||||
|      *  name="chill_family_members_family_members_view" | ||||
|      * ). | ||||
|      */ | ||||
|     protected function _view(AbstractElement $element, mixed $template) | ||||
|     protected function _view(#[MapEntity(id: 'id')] AbstractElement $element, mixed $template): Response | ||||
|     { | ||||
|         $this->denyAccessUnlessGranted(BudgetElementVoter::SEE, $element); | ||||
|  | ||||
|   | ||||
| @@ -0,0 +1,30 @@ | ||||
| <?php | ||||
|  | ||||
| declare(strict_types=1); | ||||
|  | ||||
| namespace Chill\Migrations\Main; | ||||
|  | ||||
| use Doctrine\DBAL\Schema\Schema; | ||||
| use Doctrine\Migrations\AbstractMigration; | ||||
|  | ||||
| final class Version20250528124812 extends AbstractMigration | ||||
| { | ||||
|     public function getDescription(): string | ||||
|     { | ||||
|         return 'Drop NOT NULL constraint for create and update properties on notification entity'; | ||||
|     } | ||||
|  | ||||
|     public function up(Schema $schema): void | ||||
|     { | ||||
|         $this->addSql(<<<'SQL' | ||||
|             ALTER TABLE chill_main_notification ALTER updatedat DROP NOT NULL | ||||
|         SQL); | ||||
|     } | ||||
|  | ||||
|     public function down(Schema $schema): void | ||||
|     { | ||||
|         $this->addSql(<<<'SQL' | ||||
|             ALTER TABLE chill_main_notification ALTER updatedAt SET NOT NULL | ||||
|         SQL); | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user