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.
Merge branch 'issue-2060' of dlab/hive
from pull-request 1464 * refs/heads/issue-2060: adds indexes to issue_voter and issue_comment_voter table. fixes a bug that users can agree to issues several times. Reviewed-by: 백기선 <keesun.baik@navercorp.com>
- Loading branch information
Showing
5 changed files
with
55 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; |
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,15 @@ | ||
# --- !Ups | ||
|
||
create index ix_issue_voter_issue_id_1 on issue_voter (issue_id); | ||
create index ix_issue_voter_user_id_2 on issue_voter (user_id); | ||
|
||
create index ix_issue_comment_voter_issue_id_1 on issue_comment_voter (issue_comment_id); | ||
create index ix_issue_comment_voter_user_id_2 on issue_comment_voter (user_id); | ||
|
||
# --- !Downs | ||
|
||
drop index if exists ix_issue_voter_issue_id_1; | ||
drop index if exists ix_issue_voter_user_id_2; | ||
|
||
drop index if exists ix_issue_comment_voter_issue_id_1; | ||
drop index if exists ix_issue_comment_voter_user_id_2; |