mycroforge/MycroForge.CLI/Commands/MycroForge.Orm.Migrate.cs

26 lines
672 B
C#

using System.CommandLine;
using MycroForge.CLI.Commands.Interfaces;
namespace MycroForge.CLI.Commands;
public partial class MycroForge
{
public partial class Orm
{
public class Migrate : Command, ISubCommandOf<Orm>
{
public Migrate() : base("migrate", "Apply migrations to the database")
{
this.SetHandler(ExecuteAsync);
}
private async Task ExecuteAsync()
{
await Bash.ExecuteAsync([
"source .venv/bin/activate",
"alembic upgrade head"
]);
}
}
}
}