Current section

Files

Jump to
arke_postgres lib mix tasks arke_postgres.init_db.ex
Raw

lib/mix/tasks/arke_postgres.init_db.ex

defmodule Mix.Tasks.ArkePostgres.InitDb do
alias Arke.QueryManager
alias Arke.Boundary.ArkeManager
use Mix.Task
@shortdoc "Init new arke postgres DB"
def run(_) do
Mix.Task.run("app.start")
ArkePostgres.create_project(%{arke_id: :arke_project, id: :arke_system})
create_base_project()
# QueryManager.create(:arke_system, :arke_project, [id: :arke_system, ])
# arke id: :arke_project, label: "Arke Project" do
# parameter(:label, :string, required: true)
# parameter(:description, :string, required: false)
# parameter(:persistence, :dict, required: true, values: nil, default_dict: %{})
# parameter(:type, :string, required: true, default_string: :postgres_schema)
# end
# Que
end
defp create_base_project() do
arke_project = ArkeManager.get(:arke_project, :arke_system)
QueryManager.create(:arke_system, arke_project,
[
id: :arke_system,
label: "Arke system",
description: "Base project of the application",
type: "postgres_schema"
]
)
end
end