File tree Expand file tree Collapse file tree 3 files changed +55
-1
lines changed Expand file tree Collapse file tree 3 files changed +55
-1
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace DoctrineMigrations ;
6+
7+ use Doctrine \DBAL \Schema \Schema ;
8+ use Doctrine \Migrations \AbstractMigration ;
9+
10+ /**
11+ * Auto-generated Migration: Please modify to your needs!
12+ */
13+ final class Version20250907161952 extends AbstractMigration
14+ {
15+ public function getDescription (): string
16+ {
17+ return 'Add submission source to submission info. ' ;
18+ }
19+
20+ public function up (Schema $ schema ): void
21+ {
22+ // this up() migration is auto-generated, please modify it to your needs
23+ $ this ->addSql ('ALTER TABLE submission ADD source VARCHAR(255) NOT NULL DEFAULT \'unknown \' COMMENT \'Where did we receive this submission from? \'' );
24+ }
25+
26+ public function down (Schema $ schema ): void
27+ {
28+ // this down() migration is auto-generated, please modify it to your needs
29+ $ this ->addSql ('ALTER TABLE submission DROP source ' );
30+ }
31+
32+ public function isTransactional (): bool
33+ {
34+ return false ;
35+ }
36+ }
Original file line number Diff line number Diff line change @@ -102,6 +102,12 @@ class Submission extends BaseApiEntity implements
102102 #[Serializer \Groups([ARC ::GROUP_NONSTRICT ])]
103103 private ?string $ importError = null ;
104104
105+ #[ORM \Column(options: [
106+ 'comment ' => 'Where did we receive this submission from? ' ,
107+ ])]
108+ #[Serializer \Exclude]
109+ private SubmissionSource $ source = SubmissionSource::UNKNOWN ;
110+
105111 #[ORM \ManyToOne(inversedBy: 'submissions ' )]
106112 #[ORM \JoinColumn(name: 'cid ' , referencedColumnName: 'cid ' , onDelete: 'CASCADE ' )]
107113 #[Serializer \Exclude]
@@ -573,4 +579,15 @@ public function getFileForApi(): array
573579 {
574580 return array_filter ([$ this ->fileForApi ]);
575581 }
582+
583+ public function setSource (SubmissionSource $ source ): Submission
584+ {
585+ $ this ->source = $ source ;
586+ return $ this ;
587+ }
588+
589+ public function getSource (): SubmissionSource
590+ {
591+ return $ this ->source ;
592+ }
576593}
Original file line number Diff line number Diff line change @@ -700,7 +700,8 @@ public function submitSolution(
700700 ->setOriginalSubmission ($ originalSubmission )
701701 ->setEntryPoint ($ entryPoint )
702702 ->setExternalid ($ externalId )
703- ->setImportError ($ importError );
703+ ->setImportError ($ importError )
704+ ->setSource ($ source );
704705
705706 // Add expected results from source. We only do this for jury submissions
706707 // to prevent accidental auto-verification of team submissions.
You can’t perform that action at this time.
0 commit comments