EfMigrationTests.cs 1003 B

123456789101112131415161718192021222324252627
  1. using System;
  2. using System.Threading.Tasks;
  3. using Jellyfin.Database.Providers.PgSql;
  4. using Jellyfin.Server.Implementations.Migrations;
  5. using Microsoft.EntityFrameworkCore;
  6. using Xunit;
  7. namespace Jellyfin.Server.Implementations.Tests.EfMigrations;
  8. public class EfMigrationTests
  9. {
  10. [Fact]
  11. public void CheckForUnappliedMigrations_PgSQL()
  12. {
  13. var dbDesignContext = new PgSqlDesignTimeJellyfinDbFactory();
  14. var context = dbDesignContext.CreateDbContext([]);
  15. Assert.False(context.Database.HasPendingModelChanges(), "There are unapplied changes to the EFCore model for PgSQL. Please create a Migration.");
  16. }
  17. [Fact]
  18. public void CheckForUnappliedMigrations_SqLite()
  19. {
  20. var dbDesignContext = new SqliteDesignTimeJellyfinDbFactory();
  21. var context = dbDesignContext.CreateDbContext([]);
  22. Assert.False(context.Database.HasPendingModelChanges(), "There are unapplied changes to the EFCore model for SQLite. Please create a Migration.");
  23. }
  24. }