27 lines
715 B
C#
27 lines
715 B
C#
using System.CommandLine;
|
|
using MicroForge.CLI.Commands.Interfaces;
|
|
|
|
namespace MicroForge.CLI.Commands;
|
|
|
|
public partial class MicroForge
|
|
{
|
|
public partial class Migrations
|
|
{
|
|
public class Apply : Command, ISubCommandOf<Migrations>
|
|
{
|
|
public Apply() : base("apply", "Apply migrations to the database")
|
|
{
|
|
AddAlias("a");
|
|
this.SetHandler(ExecuteAsync);
|
|
}
|
|
|
|
private async Task ExecuteAsync()
|
|
{
|
|
await Bash.ExecuteAsync([
|
|
"source .venv/bin/activate",
|
|
"alembic upgrade head"
|
|
]);
|
|
}
|
|
}
|
|
}
|
|
} |