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:
Thomas Citharel
2019-02-22 14:18:52 +01:00
parent 5024dfbbef
commit 7dd7e8fc36
52 changed files with 370 additions and 324 deletions

View File

@@ -3,17 +3,22 @@ defmodule Mobilizon.Repo.Migrations.AddPrimaryKeyToMember do
def up do
execute("ALTER TABLE members DROP CONSTRAINT IF EXISTS members_pkey")
drop_if_exists index(:members, ["members_account_id_index"])
create unique_index(:members, [:actor_id, :parent_id], name: :members_actor_parent_unique_index)
drop_if_exists(index(:members, ["members_account_id_index"]))
create(
unique_index(:members, [:actor_id, :parent_id], name: :members_actor_parent_unique_index)
)
alter table(:members) do
add :id, :serial, primary_key: true
add(:id, :serial, primary_key: true)
end
end
def down do
drop index(:members, [:actor_id, :parent_id], name: :members_actor_parent_unique_index)
drop(index(:members, [:actor_id, :parent_id], name: :members_actor_parent_unique_index))
alter table(:members) do
remove :id
remove(:id)
end
end
end