fix: initialize sqlite provider for migration

This commit is contained in:
2026-04-29 21:59:26 +08:00
parent d59deb78ae
commit b72a4fd6b5
2 changed files with 3 additions and 1 deletions
@@ -11,7 +11,7 @@
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.4" />
<PackageReference Include="Microsoft.Data.Sqlite.Core" Version="8.0.4" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="8.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
@@ -37,6 +37,8 @@ public sealed class SqliteToPostgresMigrationService
string sqliteDbPath,
CancellationToken cancellationToken = default)
{
SQLitePCL.Batteries_V2.Init();
if (string.IsNullOrWhiteSpace(sqliteDbPath))
{
throw new ArgumentException("SQLite database path is required.", nameof(sqliteDbPath));