mycroforge/MicroForge.CLI/Commands/MicroForge.Migrations.Apply.cs
2024-04-21 23:56:27 +02:00

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"
]);
}
}
}
}