Skip to content

Commit

Permalink
Fix adherent cascade
Browse files Browse the repository at this point in the history
  • Loading branch information
Remg committed Jan 31, 2025
1 parent bcb05d1 commit bbbb661
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

final class Version20250131092016 extends AbstractMigration
final class Version20250131104505 extends AbstractMigration
{
public function up(Schema $schema): void
{
Expand Down Expand Up @@ -64,7 +64,9 @@ public function up(Schema $schema): void
$this->addSql('ALTER TABLE
general_convention
ADD
CONSTRAINT FK_F66947EFE1CFE6F5 FOREIGN KEY (reporter_id) REFERENCES adherents (id)');
CONSTRAINT FK_F66947EFE1CFE6F5 FOREIGN KEY (reporter_id) REFERENCES adherents (id) ON DELETE
SET
NULL');
$this->addSql('ALTER TABLE
general_convention
ADD
Expand Down
1 change: 1 addition & 0 deletions src/Admin/GeneralConventionAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ protected function configureFormFields(FormMapper $form): void
])
->add('reporter', ModelAutocompleteType::class, [
'label' => 'Auteur de la remontée',
'required' => true,
'minimum_input_length' => 1,
'items_per_page' => 20,
'property' => [
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/GeneralConvention/GeneralConvention.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class GeneralConvention
public ?OrganizerEnum $organizer = null;

#[Assert\NotBlank]
#[ORM\JoinColumn]
#[ORM\JoinColumn(nullable: true, onDelete: 'SET NULL')]
#[ORM\ManyToOne(targetEntity: Adherent::class)]
public ?Adherent $reporter = null;

Expand Down

0 comments on commit bbbb661

Please sign in to comment.