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>
This commit is contained in:
@@ -5,22 +5,22 @@ defmodule Mobilizon.Repo.Migrations.FixCommentsReferences do
|
||||
use Ecto.Migration
|
||||
|
||||
def up do
|
||||
drop constraint(:comments, "comments_in_reply_to_comment_id_fkey")
|
||||
drop constraint(:comments, "comments_origin_comment_id_fkey")
|
||||
drop(constraint(:comments, "comments_in_reply_to_comment_id_fkey"))
|
||||
drop(constraint(:comments, "comments_origin_comment_id_fkey"))
|
||||
|
||||
alter table(:comments) do
|
||||
modify :in_reply_to_comment_id, references(:comments, on_delete: :nothing)
|
||||
modify :origin_comment_id, references(:comments, on_delete: :nothing)
|
||||
modify(:in_reply_to_comment_id, references(:comments, on_delete: :nothing))
|
||||
modify(:origin_comment_id, references(:comments, on_delete: :nothing))
|
||||
end
|
||||
end
|
||||
|
||||
def down do
|
||||
drop constraint(:comments, "comments_in_reply_to_comment_id_fkey")
|
||||
drop constraint(:comments, "comments_origin_comment_id_fkey")
|
||||
drop(constraint(:comments, "comments_in_reply_to_comment_id_fkey"))
|
||||
drop(constraint(:comments, "comments_origin_comment_id_fkey"))
|
||||
|
||||
alter table(:comments) do
|
||||
modify :in_reply_to_comment_id, references(:categories, on_delete: :nothing)
|
||||
modify :origin_comment_id, references(:addresses, on_delete: :delete_all)
|
||||
modify(:in_reply_to_comment_id, references(:categories, on_delete: :nothing))
|
||||
modify(:origin_comment_id, references(:addresses, on_delete: :delete_all))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user