Skip to content

Commit

Permalink
adds execute_ddl create index function clause, #44
Browse files Browse the repository at this point in the history
  • Loading branch information
Danwhy committed Feb 18, 2019
1 parent 8be05cb commit ae010d8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/alog/connection.ex
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,9 @@ defmodule Alog.Connection do
end
end

def execute_ddl({:create, %Ecto.Migration.Index{}} = command) do
end

def execute_ddl({:create_if_not_exists, %Ecto.Migration.Index{}} = command) do
def execute_ddl({c, %Ecto.Migration.Index{unique: true}})
when c in [:create, :create_if_not_exists] do
raise ArgumentError, "you cannot create a unique index"
end

defdelegate execute_ddl(command), to: Ecto.Adapter.Postgres.Connection
Expand Down

0 comments on commit ae010d8

Please sign in to comment.