⚡️ This library handles schema migrations for Quartz.NET using EntityFrameworkCore migrations toolkit with one line of configuration ⚡️
$> dotnet add package AppAny.Quartz.EntityFrameworkCore.Migrations.PostgreSQL
🚧 Feel free to create as issue for driver support 🚧
✅ Configure DbContext
public class DatabaseContext : DbContext
{
// ...
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
// Adds Quartz.NET PostgreSQL schema to EntityFrameworkCore
modelBuilder.AddQuartz(builder => builder
.UsePostgres()
.UseSchema("quartz")
.UseNoPrefix());
}
}
✅ Configure Quartz.NET
storeOptions.UsePostgres(postgresOptions =>
{
postgresOptions.UseDriverDelegate<PostgreSQLDelegate>();
postgresOptions.ConnectionString = ...;
postgresOptions.TablePrefix = ...;
});
✅ Add EntityFrameworkCore migration with Quartz.NET schema dotnet ef migrations add AddQuartz
and:
🚩 Add in-process migration using databaseContext.Database.MigrateAsync()
🚩 Add out-of-process migration using dotnet ef database update
🚩 Extract SQL for your migration tool dotnet ef migrations script PreviousMigration AddQuartz