From 8542a176ed98f2ba991117ed1b75dbc341782a98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Garamv=C3=B6lgyi?= Date: Fri, 18 Aug 2023 09:47:05 +0200 Subject: [PATCH] fix: drop l1 message hash unique index (#823) Co-authored-by: Thegaram --- common/version/version.go | 2 +- .../migrations/00008_drop_unique_message_hash.sql | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 database/migrate/migrations/00008_drop_unique_message_hash.sql diff --git a/common/version/version.go b/common/version/version.go index 2dcd985d8..f987b8a17 100644 --- a/common/version/version.go +++ b/common/version/version.go @@ -6,7 +6,7 @@ import ( "strings" ) -var tag = "v4.1.70" +var tag = "v4.1.71" var commit = func() string { if info, ok := debug.ReadBuildInfo(); ok { diff --git a/database/migrate/migrations/00008_drop_unique_message_hash.sql b/database/migrate/migrations/00008_drop_unique_message_hash.sql new file mode 100644 index 000000000..75546f30b --- /dev/null +++ b/database/migrate/migrations/00008_drop_unique_message_hash.sql @@ -0,0 +1,15 @@ +-- +goose Up +-- +goose StatementBegin +drop index l1_message_hash_uindex; + +create index l1_message_hash_index +on l1_message (msg_hash) where deleted_at IS NULL; +-- +goose StatementEnd + +-- +goose Down +-- +goose StatementBegin +drop index l1_message_hash_index; + +create unique index l1_message_hash_uindex +on l1_message (msg_hash) where deleted_at IS NULL; +-- +goose StatementEnd