|
@@ -1,5 +1,7 @@
|
|
|
using System;
|
|
|
using System.Threading.Tasks;
|
|
|
+using Jellyfin.Database.Providers.PgSql;
|
|
|
+using Jellyfin.Server.Implementations.Migrations;
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
using Xunit;
|
|
|
|
|
@@ -7,11 +9,19 @@ namespace Jellyfin.Server.Implementations.Tests.EfMigrations;
|
|
|
|
|
|
public class EfMigrationTests
|
|
|
{
|
|
|
- // [Fact]
|
|
|
- // public void CheckForUnappliedMigrations()
|
|
|
- // {
|
|
|
- // var dbDesignContext = new DesignTimeJellyfinDbFactory();
|
|
|
- // var context = dbDesignContext.CreateDbContext([]);
|
|
|
- // Assert.False(context.Database.HasPendingModelChanges(), "There are unapplied changes to the EfCore model. Please create a Migration.");
|
|
|
- // }
|
|
|
+ [Fact]
|
|
|
+ public void CheckForUnappliedMigrations_PgSQL()
|
|
|
+ {
|
|
|
+ var dbDesignContext = new PgSqlDesignTimeJellyfinDbFactory();
|
|
|
+ var context = dbDesignContext.CreateDbContext([]);
|
|
|
+ Assert.False(context.Database.HasPendingModelChanges(), "There are unapplied changes to the EfCore model for PgSQL. Please create a Migration.");
|
|
|
+ }
|
|
|
+
|
|
|
+ [Fact]
|
|
|
+ public void CheckForUnappliedMigrations_SqLite()
|
|
|
+ {
|
|
|
+ var dbDesignContext = new SqliteDesignTimeJellyfinDbFactory();
|
|
|
+ var context = dbDesignContext.CreateDbContext([]);
|
|
|
+ Assert.False(context.Database.HasPendingModelChanges(), "There are unapplied changes to the EfCore model for PgSQL. Please create a Migration.");
|
|
|
+ }
|
|
|
}
|