From ae010d8a7ffb52c7251796585e8abb1f02f902f1 Mon Sep 17 00:00:00 2001 From: Danielwhyte Date: Mon, 18 Feb 2019 12:24:58 +0000 Subject: [PATCH] adds execute_ddl create index function clause, #44 --- lib/alog/connection.ex | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/alog/connection.ex b/lib/alog/connection.ex index 9f848fb..c2a8216 100644 --- a/lib/alog/connection.ex +++ b/lib/alog/connection.ex @@ -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