This repository has been archived by the owner on Sep 12, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes a bug that users can agree to issues several times.
* Issue Users can agree to issues many times if the user clicks agree button very fast. Because there is no primary key on issue_voter table and logics checking voters duplicaiton. * Solution The primary key is added to issue_voter table. And to prevent vote duplication, protect codes are added. Altough issue_comment_voter table has a primary key, there are possibilities that primary key violation exception occur. So protect codes are added to issue_comment_voter table as issue_voter table. Private-issue: 2060
- Loading branch information
1 parent
0a863e5
commit 6a6e6f7
Showing
4 changed files
with
40 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# --- !Ups | ||
|
||
create table issue_voter_temp ( | ||
issue_id bigint not null, | ||
user_id bigint not null | ||
); | ||
|
||
insert into issue_voter_temp select * from issue_voter group by issue_id, user_id; | ||
drop table issue_voter; | ||
alter table issue_voter_temp rename to issue_voter; | ||
|
||
alter table issue_voter add constraint pk_issue_voter primary key (issue_id, user_id); | ||
alter table issue_voter add constraint fk_issue_voter_issue_1 foreign key (issue_id) references issue (id) on delete restrict on update restrict; | ||
alter table issue_voter add constraint fk_issue_voter_n4user_2 foreign key (user_id) references n4user (id) on delete restrict on update restrict; | ||
|
||
# --- !Downs | ||
|
||
alter table issue_voter drop constraint if exists pk_issue_voter; |