AppAny.Quartz.EntityFrameworkCore.Migrations
AppAny.Quartz.EntityFrameworkCore.Migrations copied to clipboard
The default schema name for Sql Server doesn't match Quartz.NET
When using this library to create the tables for Quartz.NET the library uses the schema "quartz" by default. But Quartz.NET itself uses "dbo". The migrations only work when setting the schema manually, because Quartz.NET doesn't find the tables and . See https://github.com/quartznet/quartznet/blob/main/database/tables/tables_sqlServer.sql
The following error occurs:
2024-05-17 17:29:22.9494|ERROR|Microsoft.Extensions.Hosting.Internal.Host|Hosting failed to start|Quartz.SchedulerException: Database schema validation failed. Make sure you have created the database tables that Quartz requires using the database schema scripts. You can disable this check by setting quartz.jobStore.performSchemaValidation to false
---> Quartz.JobPersistenceException: Unable to query against table QRTZ_JOB_DETAILS: Invalid object name 'QRTZ_JOB_DETAILS'.
@merlinschumacher Could you please provide a PR for this fix?
This is also an issue for PostgreSQL. It can be solved with the following configuration:
q.UsePersistentStore(c =>
{
c.UsePostgres(po =>
{
po.UseDriverDelegate<PostgreSQLDelegate>();
po.ConnectionStringName = "Database";
po.TablePrefix = "quartz.qrtz_";
});
c.UseNewtonsoftJsonSerializer();
});
But that's not really pretty