using System.CommandLine; using MycroForge.Core; using MycroForge.Core.Contract; namespace MycroForge.CLI.Commands; public partial class MycroForge { public partial class Db { public class Migrate : Command, ISubCommandOf { private readonly ProjectContext _context; public Migrate(ProjectContext context) : base("migrate", "Apply migrations to the database") { _context = context; this.SetHandler(ExecuteAsync); } private async Task ExecuteAsync() { await _context.Bash([ "source .venv/bin/activate", "alembic upgrade head" ]); } } } }