diff options
| author | gion <oancaionutandrei@gmail.com> | 2020-05-26 10:23:09 +0200 |
|---|---|---|
| committer | gion <oancaionutandrei@gmail.com> | 2020-05-26 10:23:09 +0200 |
| commit | e4838b0faa2dafec9382abe8e00bd18be624a030 (patch) | |
| tree | e6c685ff5a8031e44007de7f113453ac6d296d07 /Jellyfin.Server.Implementations/Migrations/DesignTimeJellyfinDbFactory.cs | |
| parent | 8c04049a595df054f491712ed317274566f2d71b (diff) | |
| parent | 976ae36bea0768f0e363bf0c5091b0853cc81c4d (diff) | |
Merge remote-tracking branch 'upstream/master' into syncplay
Diffstat (limited to 'Jellyfin.Server.Implementations/Migrations/DesignTimeJellyfinDbFactory.cs')
| -rw-r--r-- | Jellyfin.Server.Implementations/Migrations/DesignTimeJellyfinDbFactory.cs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Jellyfin.Server.Implementations/Migrations/DesignTimeJellyfinDbFactory.cs b/Jellyfin.Server.Implementations/Migrations/DesignTimeJellyfinDbFactory.cs new file mode 100644 index 000000000..72a4a8c3b --- /dev/null +++ b/Jellyfin.Server.Implementations/Migrations/DesignTimeJellyfinDbFactory.cs @@ -0,0 +1,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); + } + } +} |
