diff --git a/migrations/Version20240718105318.php b/migrations/Version20240718105318.php new file mode 100644 index 0000000..0d4fa68 --- /dev/null +++ b/migrations/Version20240718105318.php @@ -0,0 +1,31 @@ +connection->executeQuery('UPDATE assignment SET status=? WHERE deleted_at is NOT NULL', [Assignment::STATUS_DELETED]); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + + } +} diff --git a/src/Controller/Administrative/Assignment/DeleteController.php b/src/Controller/Administrative/Assignment/DeleteController.php index c53af97..d2f7744 100644 --- a/src/Controller/Administrative/Assignment/DeleteController.php +++ b/src/Controller/Administrative/Assignment/DeleteController.php @@ -26,6 +26,8 @@ class DeleteController extends AbstractController { if (true === $request->isMethod('POST')) { $assignment->setDeleted(); + $assignment->setStatus(Assignment::STATUS_DELETED); + $this->entityManager->flush(); $this->logger->info('Delete assignment', [ diff --git a/src/Entity/Assignment.php b/src/Entity/Assignment.php index 86f181c..0ca50e1 100644 --- a/src/Entity/Assignment.php +++ b/src/Entity/Assignment.php @@ -28,6 +28,7 @@ class Assignment implements BlameableEntityInterface, TimestampableEntityInterfa public const STATUS_PARTLY_STAFFED = 'partly_staffed'; public const STATUS_STAFFING = 'staffing'; public const STATUS_UNSTAFFED = 'unstaffed'; + public const STATUS_DELETED = 'deleted'; #[ORM\Id] #[ORM\GeneratedValue]