7dd7e8fc36
Signed-off-by: Thomas Citharel <tcit@tcit.fr> Fix credo warnings Signed-off-by: Thomas Citharel <tcit@tcit.fr> Show elixir version Signed-off-by: Thomas Citharel <tcit@tcit.fr> Also lint migrations Signed-off-by: Thomas Citharel <tcit@tcit.fr> Reset allow failure to false Signed-off-by: Thomas Citharel <tcit@tcit.fr>
24 lines
479 B
Elixir
24 lines
479 B
Elixir
defmodule Mobilizon.Repo.Migrations.AllowMultipleAccountsForUser do
|
|
use Ecto.Migration
|
|
|
|
def up do
|
|
alter table(:actors) do
|
|
add(:user_id, references(:users, on_delete: :delete_all), null: true)
|
|
end
|
|
|
|
alter table(:users) do
|
|
remove(:actor_id)
|
|
end
|
|
end
|
|
|
|
def down do
|
|
alter table(:users) do
|
|
add(:actor_id, references(:actors, on_delete: :delete_all), null: false)
|
|
end
|
|
|
|
alter table(:actors) do
|
|
remove(:user_id)
|
|
end
|
|
end
|
|
end
|