Current section

Files

Jump to
eventstore lib mix tasks event_store.drop.ex
Raw

lib/mix/tasks/event_store.drop.ex

defmodule Mix.Tasks.EventStore.Drop do
@moduledoc """
Drop the database for the EventStore.
## Examples
mix event_store.drop
"""
use Mix.Task
alias EventStore.Config
@shortdoc "Drop the database for the EventStore"
@doc false
def run(_args) do
config = Config.parsed()
if skip_safety_warnings?() or
Mix.shell().yes?("Are you sure you want to drop the EventStore database?") do
EventStore.Tasks.Drop.exec(config, is_mix: true)
end
end
defp skip_safety_warnings? do
Mix.Project.config()[:start_permanent] != true
end
end