Skip to content

Commit

Permalink
improvement: implement ash lifecycle tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
zachdaniel committed Sep 4, 2023
1 parent 0df8568 commit 5182a1c
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions lib/data_layer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,28 @@ defmodule AshPostgres.DataLayer do
AshPostgres.Transformers.PreventMultidimensionalArrayAggregates
]

def migrate(args) do
# TODO: take args that we care about
Mix.Task.run("ash_postgres.migrate", args)
end

def codegen(args) do
# TODO: take args that we care about
Mix.Task.run("ash_postgres.generate_migrations", args)
end

def setup(args) do
# TODO: take args that we care about
Mix.Task.run("ash_postgres.create", args)
Mix.Task.run("ash_postgres.migrate", args)
Mix.Task.run("ash_postgres.migrate", ["--tenant" | args])
end

def tear_down(args) do
# TODO: take args that we care about
Mix.Task.run("ash_postgres.drop", args)
end

@doc false
def tenant_template(value) do
value = List.wrap(value)
Expand Down

0 comments on commit 5182a1c

Please sign in to comment.