using System.CommandLine; using MycroForge.Core; using MycroForge.Core.Contract; namespace MycroForge.CLI.Commands; public partial class MycroForge { public partial class Db { public class Rollback : Command, ISubCommandOf { private readonly ProjectContext _context; public Rollback(ProjectContext context) : base("rollback", "Rollback the last migration") { _context = context; this.SetHandler(ExecuteAsync); } private async Task ExecuteAsync() { await _context.Bash([ "source .venv/bin/activate", "alembic downgrade -1" ]); } } } }