Skip to content

Commit

Permalink
Fix migrations
Browse files Browse the repository at this point in the history
Signed-off-by: tiksan <[email protected]>
  • Loading branch information
dssecret committed Jan 31, 2025
1 parent cf5514e commit fdc9c01
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion worker/config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ import Config
# Alternatively, you can use `mix phx.gen.release` to generate a `bin/server`
# script that automatically sets the env var above.
if System.get_env("PHX_SERVER") do
config :tornium, Tornium.Web.Endpoint, server: true
config :tornium, Tornium.Web.Endpoint,
http: [ip: {127, 0, 0, 1}, port: 4000],
check_origin: true
end

config :nostrum,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ defmodule Tornium.Repo.Migrations.AddFactionPosition do
add :change_announcement, :boolean, null: false
add :change_description, :boolean, null: false
end
create unique_index(:faction_position, [:pid])
create unique_index(:factionposition, [:pid])
end

def down do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ defmodule Tornium.Repo.Migrations.AddUserFactionPositionReference do
drop_if_exists constraint("user", "user_faction_position_id_fkey")

alter table("user") do
add_if_not_exists :faction_position_id, references(:faction_position, column: :pid, type: :binary_id)
add_if_not_exists :faction_position_id, references(:factionposition, column: :pid, type: :binary_id)
end
end

def down do
drop_if_exists constraint("user", "user_faction_position_id_fkey")

alter table("user") do
Ecto.Migration.remove_if_exists(:faction_position_id, references(:faction_position, column: :pid, type: :binary_id))
Ecto.Migration.remove_if_exists(:faction_position_id, references(:factionposition, column: :pid, type: :binary_id))
end
end
end

0 comments on commit fdc9c01

Please sign in to comment.