feat/efcore-migration #3

Merged
mikakuns merged 12 commits from feat/efcore-migration into main 2026-04-16 07:39:00 +00:00
Showing only changes of commit 7d0ca45a60 - Show all commits

View File

@@ -1,5 +1,6 @@
using ClaudeDo.Data;
using ClaudeDo.Installer.Core;
using Microsoft.EntityFrameworkCore;
namespace ClaudeDo.Installer.Steps;
@@ -14,8 +15,11 @@ public sealed class InitDatabaseStep : IInstallStep
var expandedPath = Paths.Expand(ctx.DbPath);
progress.Report($"Initializing database at {expandedPath}");
var factory = new SqliteConnectionFactory(expandedPath);
SchemaInitializer.Apply(factory);
var options = new DbContextOptionsBuilder<ClaudeDoDbContext>()
.UseSqlite($"Data Source={expandedPath}")
.Options;
using var context = new ClaudeDoDbContext(options);
context.Database.Migrate();
progress.Report("Schema applied successfully");
return Task.FromResult(StepResult.Ok());