| 1 | using Microsoft.EntityFrameworkCore; |
| 2 | using Microsoft.EntityFrameworkCore.Design; |
| 3 | using OutWit.Database.EntityFramework.Extensions; |
| 4 | |
| 5 | namespace AgentForge.Data; |
| 6 | |
| 7 | /// <summary>Design-time DbContext for EF migrations without starting the web host or plugin loader.</summary> |
| 8 | public sealed class ForgeDesignTimeDbContextFactory : IDesignTimeDbContextFactory<ForgeDbContext> |
| 9 | { |
| 10 | public ForgeDbContext CreateDbContext(string[] args) |
| 11 | { |
| 12 | var options = new DbContextOptionsBuilder<ForgeDbContext>() |
| 13 | .UseWitDb("Data Source=forge-design-time.db") |
| 14 | .Options; |
| 15 | return new ForgeDbContext(options); |
| 16 | } |
| 17 | } |
| 18 | |
View only · write via MCP/CIDE