백기선 2015-04-01
Merge branch 'fix/duplicated-message-id' into 'next'
from pull-request 1563

* refs/heads/fix/duplicated-message-id:
  Add missing unique constraint for original_email

Reviewed-by: 백기선 
@642cc824210746b6a08d96a5b28b27fb63493dc6
 
conf/evolutions/default/99.sql (added)
+++ conf/evolutions/default/99.sql
@@ -0,0 +1,9 @@
+# --- !Ups
+
+delete from original_email a where a.id > any (select b.id from original_email b where a.message_id = b.message_id);
+
+alter table original_email add constraint uq_original_email_2 unique (message_id);
+
+# --- !Downs
+
+alter table original_email drop constraint if exists uq_original_email_2;
Add a comment
List