blob: 72a4a8c3b6c9d938c6f8c3be04df1027ded25096 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
namespace Jellyfin.Server.Implementations.Migrations
{
/// <summary>
/// The design time factory for <see cref="JellyfinDb"/>.
/// This is only used for the creation of migrations and not during runtime.
/// </summary>
internal class DesignTimeJellyfinDbFactory : IDesignTimeDbContextFactory<JellyfinDb>
{
public JellyfinDb CreateDbContext(string[] args)
{
var optionsBuilder = new DbContextOptionsBuilder<JellyfinDb>();
optionsBuilder.UseSqlite("Data Source=jellyfin.db");
return new JellyfinDb(optionsBuilder.Options);
}
}
}
|