mobilizon/priv/repo/migrations/20180709154152_allow_multiple_accounts_for_user.exs
Thomas Citharel 7dd7e8fc36
Fix mix format and format migrations too
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>
2019-02-22 14:53:09 +01:00

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