Skip to content

Commit

Permalink
extend index for option (#43)
Browse files Browse the repository at this point in the history
Co-authored-by: ggmaleva <ggmaleva@yandex.ru>
  • Loading branch information
ggmaleva and ggmaleva authored Oct 20, 2022
1 parent 593b853 commit b01ecd1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/dev/vality/scrooge/dao/OptionDaoImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void saveAll(List<Option> options) {
.map(optionRecord -> getDslContext()
.insertInto(OPTION)
.set(optionRecord)
.onConflict(OPTION.ADAPTER_ID, OPTION.KEY, OPTION.TERMINAL_REF)
.onConflict(OPTION.ADAPTER_ID, OPTION.KEY, OPTION.TERMINAL_REF, OPTION.ACCOUNT_ID)
.doUpdate()
.set(getDslContext().newRecord(OPTION, optionRecord)))
.collect(Collectors.toList());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER TABLE scrooge.option DROP CONSTRAINT IF EXISTS unique_option_key;
ALTER TABLE scrooge.option
ADD CONSTRAINT unique_option_row UNIQUE (key, adapter_id, terminal_ref, account_id);

0 comments on commit b01ecd1

Please sign in to comment.