diff --git a/app/model/entity/User.php b/app/model/entity/User.php index 67e1d3045..11c303a52 100644 --- a/app/model/entity/User.php +++ b/app/model/entity/User.php @@ -96,7 +96,7 @@ public function getName() protected $titlesAfterName; /** - * @ORM\Column(type="string") + * @ORM\Column(type="string", unique=true) */ protected $email; diff --git a/migrations/Version20250220202930.php b/migrations/Version20250220202930.php new file mode 100644 index 000000000..2659aa67e --- /dev/null +++ b/migrations/Version20250220202930.php @@ -0,0 +1,31 @@ +addSql('CREATE UNIQUE INDEX UNIQ_8D93D649E7927C74 ON user (email)'); + } + + public function down(Schema $schema): void + { + // this down() migration is auto-generated, please modify it to your needs + $this->addSql('DROP INDEX UNIQ_8D93D649E7927C74 ON user'); + } +}