Skip to content

Commit

Permalink
fix: recreate entity index using btree
Browse files Browse the repository at this point in the history
  • Loading branch information
w3b6x9 committed Nov 30, 2024
1 parent 5deb4f3 commit d98c4dc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/realtime/tenants/migrations.ex
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ defmodule Realtime.Tenants.Migrations do
UuidAutoGeneration,
MessagesPartitioning,
MessagesUsingUuid,
FixSendFunction
FixSendFunction,
RecreateEntityIndexUsingBtree
}

@migrations [
Expand Down Expand Up @@ -122,7 +123,8 @@ defmodule Realtime.Tenants.Migrations do
{20_241_019_105_805, UuidAutoGeneration},
{20_241_030_150_047, MessagesPartitioning},
{20_241_108_114_728, MessagesUsingUuid},
{20_241_121_104_152, FixSendFunction}
{20_241_121_104_152, FixSendFunction},
{20_241_130_184_212, RecreateEntityIndexUsingBtree}
]

defstruct [:tenant_external_id, :settings]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
defmodule Realtime.Tenants.Migrations.RecreateEntityIndexUsingBtree do
@moduledoc false

use Ecto.Migration

def change do
execute(
"drop index if exists \"realtime\".\"ix_realtime_subscription_entity\""
)

execute(
"create index if not exists ix_realtime_subscription_entity on realtime.subscription using btree (entity)"
)
end
end

0 comments on commit d98c4dc

Please sign in to comment.