Skip to content

Non-concurrent index detection doesn't work with pipelines #33

@renanpvaz

Description

@renanpvaz

The following code will not be flagged when checked against excellent_migrations. This is because the AST parser expects a different structure: https://github.com/Artur-Sulej/excellent_migrations/blob/master/lib/ast_parser.ex#L40

defmodule ExcellentMigrations.CreateIndexPipeline do
  def up do
    :dumplings |> index([:dough]) |> create()
    :dumplings |> index([:dough]) |> create_if_not_exists()
  end

  def down do
    :dumplings |> index([:dough]) |> drop()
    :dumplings |> index([:dough]) |> drop_if_exists()
  end
end

Is there a reason why we can't just look at all calls of index and unique_index whether inside create or not?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions