Created
February 7, 2015 15:25
-
-
Save alanpeabody/c3365ac9528a44f73e9e to your computer and use it in GitHub Desktop.
drop_if_exists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defp execute_in_direction(repo, :forward, level, {:create_if_not_exists, %Index{}=index}) do | |
if !repo.adapter.ddl_exists?(repo, index, @opts) do | |
repo.adapter.execute_ddl(repo, {:create, index}, @opts) | |
end | |
end | |
defp execute_in_direction(repo, :backward, level, {:drop_if_exists, %Index{}=index}) do | |
if !repo.adapter.ddl_exists?(repo, index, @opts) do | |
repo.adapter.execute_ddl(repo, {:create, index}, @opts) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment