Skip to content

Commit

Permalink
Fix duplicate DB when login (backend) (#215)
Browse files Browse the repository at this point in the history
* Fix duplicate login errors.

Signed-off-by: Han Kyuhyun <[email protected]>
Co-authored-by: Jongmin Lee <[email protected]>
Co-authored-by: June Saehwan <[email protected]>
Co-authored-by: ByunJeongHeum <[email protected]>

* Remove unnecessary duplicate code.

Signed-off-by: Han Kyuhyun <[email protected]>

* Add the UNIQUE constraint.

Signed-off-by: Han Kyuhyun <[email protected]>
Co-authored-by: Jongmin Lee <[email protected]>
Co-authored-by: June Saehwan <[email protected]>
Co-authored-by: ByunJeongHeum <[email protected]>

* Fix the member table schema

---------

Signed-off-by: Han Kyuhyun <[email protected]>
Co-authored-by: Jongmin Lee <[email protected]>
Co-authored-by: June Saehwan <[email protected]>
Co-authored-by: ByunJeongHeum <[email protected]>
Co-authored-by: Taewan Kim <[email protected]>
  • Loading branch information
5 people authored Sep 15, 2023
1 parent b818268 commit d5c29a5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/lpvs/entity/LPVSMember.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
@Getter @NoArgsConstructor
@DynamicUpdate
@Entity
@Table(name = "member")
@Table(name = "member", schema = "lpvs", indexes = {@Index(name = "unq_member", columnList = "email, provider", unique = true)})
public class LPVSMember {

@Id
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/database_dump.sql
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ CREATE TABLE `member` (
`name` varchar(255) NOT NULL,
`nickname` varchar(255) DEFAULT NULL,
`provider` varchar(10) NOT NULL,
`organization` varchar(255) DEFAULT NULL
`organization` varchar(255) DEFAULT NULL,
UNIQUE KEY `unq_member` (`email`,`provider`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

Expand Down

0 comments on commit d5c29a5

Please sign in to comment.