File tree 3 files changed +34
-3
lines changed
3 files changed +34
-3
lines changed Original file line number Diff line number Diff line change 1
- 2.1.2
1
+ 2.1.3
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 Version20250305181012 extends AbstractMigration
14
+ {
15
+ public function getDescription (): string
16
+ {
17
+ return '' ;
18
+ }
19
+
20
+ public function up (Schema $ schema ): void
21
+ {
22
+ $ this ->addSql ('DROP INDEX uniq_73f2f77baa9e377a ' );
23
+ }
24
+
25
+ public function down (Schema $ schema ): void
26
+ {
27
+ // this down() migration is auto-generated, please modify it to your needs
28
+ $ this ->addSql ('CREATE SCHEMA public ' );
29
+ $ this ->addSql ('CREATE UNIQUE INDEX uniq_73f2f77baa9e377a ON "budget" (date) ' );
30
+ }
31
+ }
Original file line number Diff line number Diff line change 19
19
#[ORM \Entity(repositoryClass: BudgetRepository::class)]
20
20
#[ORM \Table(name: '`budget` ' )]
21
21
#[ORM \HasLifecycleCallbacks]
22
- #[UniqueEntity(fields: ['date ' ], message: 'This budget already exists . ' )]
22
+ #[UniqueEntity(fields: ['date ' , ' user ' ], message: 'Ce budget existe déjà pour cet utilisateur . ' )]
23
23
class Budget
24
24
{
25
25
#[ORM \Id]
@@ -57,7 +57,7 @@ class Budget
57
57
)]
58
58
#[Assert \NotBlank]
59
59
#[Assert \Date]
60
- #[ORM \Column(type: Types::DATE_MUTABLE , unique: true )]
60
+ #[ORM \Column(type: Types::DATE_MUTABLE )]
61
61
private \DateTimeInterface $ date ;
62
62
63
63
/**
You can’t perform that action at this time.
0 commit comments