Skip to content

Commit

Permalink
Update v03.ex
Browse files Browse the repository at this point in the history
  • Loading branch information
kubosuke committed Nov 1, 2024
1 parent eaf5295 commit b5c77be
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/kanta/migrations/postgresql/v03.ex
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ defmodule Kanta.Migrations.Postgresql.V03 do

def up_kanta_messages(_opts) do
alter table(@kanta_messages) do
add(:application_source_id, references(@kanta_application_sources), null: true)
add_if_not_exists(:application_source_id, references(@kanta_application_sources),
null: true
)
end

drop unique_index(@kanta_messages, [:context_id, :domain_id, :msgid])
Expand Down Expand Up @@ -75,7 +77,7 @@ defmodule Kanta.Migrations.Postgresql.V03 do
create_if_not_exists unique_index(@kanta_messages, [:context_id, :domain_id, :msgid])

alter table(@kanta_messages) do
remove(:application_source_id)
remove_if_exists(:application_source_id)
end
end
end

0 comments on commit b5c77be

Please sign in to comment.