Skip to content

Map missing EXECUTION_GROUP, PREFERRED_NODE and PREFERRED_NODE_AUTO columns - #75

Open
bittercoder wants to merge 1 commit into
appany:mainfrom
bittercoder:feat/execution-group-column
Open

Map missing EXECUTION_GROUP, PREFERRED_NODE and PREFERRED_NODE_AUTO columns#75
bittercoder wants to merge 1 commit into
appany:mainfrom
bittercoder:feat/execution-group-column

Conversation

@bittercoder

Copy link
Copy Markdown

Adds the remaining optional Quartz.NET schema columns that this library does not yet map, for all four providers.

Fixes #73
Fixes #74

What's added

Table Column Introduced by
QRTZ_TRIGGERS EXECUTION_GROUP execution groups (#73)
QRTZ_FIRED_TRIGGERS EXECUTION_GROUP execution groups (#73)
QRTZ_TRIGGERS PREFERRED_NODE node affinity (#74)
QRTZ_TRIGGERS PREFERRED_NODE_AUTO node affinity (#74)

Two new properties on QuartzTrigger (ExecutionGroup, PreferredNode, PreferredNodeAuto) and one on QuartzFiredTrigger (ExecutionGroup), mapped in each provider's QuartzTriggerEntityTypeConfiguration / QuartzFiredTriggerEntityTypeConfiguration.

MISFIRE_ORIG_FIRE_TIME was already mapped in #70, so this closes out the three optional columns added across Quartz.NET 3.17–3.19.

Column definitions

Names, nullability and the PREFERRED_NODE_AUTO default are taken from the official Quartz.NET table scripts (database/tables/tables_*.sql) and schema_30_add_preferred_node.sql:

  • EXECUTION_GROUP — nullable, 200 chars
  • PREFERRED_NODE — nullable, 200 chars
  • PREFERRED_NODE_AUTONOT NULL DEFAULT 0

Store types follow each provider's existing convention in this repo rather than the raw Quartz DDL, matching how every other string column here is already mapped:

Provider EXECUTION_GROUP / PREFERRED_NODE PREFERRED_NODE_AUTO
SqlServer HasMaxLength(200).IsUnicode()nvarchar(200) bit
PostgreSQL text bool
MySql varchar(200) tinyint(1)
SQLite text bool

For PostgreSQL and SQLite that means text instead of VARCHAR(200) — consistent with CALENDAR_NAME, TRIGGER_NAME etc. in those configurations today, and functionally equivalent. Happy to switch to explicit varchar(200) if you'd prefer literal parity with the Quartz scripts.

Generated DDL (SQLite)

CREATE TABLE "QRTZ_TRIGGERS" (
    ...
    "MISFIRE_ORIG_FIRE_TIME" bigint NULL,
    "EXECUTION_GROUP" text NULL,
    "PREFERRED_NODE" text NULL,
    "PREFERRED_NODE_AUTO" bool NOT NULL DEFAULT 0,
    "CALENDAR_NAME" text NULL,
    ...
);

Tests

Extended QuartzTriggerModelMappingTests in all four test projects with three new facts each (12 total), asserting column name, store type / max length, nullability, and the PREFERRED_NODE_AUTO default value:

  • ShouldMapExecutionGroupColumnOnTriggers
  • ShouldMapExecutionGroupColumnOnFiredTriggers
  • ShouldMapPreferredNodeColumnsOnTriggers

These are model-only and need no database. Verified locally on net8.0 and net10.0 (net6.0/net7.0 runtimes aren't installed on my machine — left to CI). The SQLite integration test, which builds the schema and starts a real scheduler with PerformSchemaValidation = true, also passes.

Notes

  • PREFERRED_NODE_AUTO is mapped as a non-nullable bool with .HasDefaultValue(false) so the generated DDL carries NOT NULL DEFAULT 0. Since this library only ever generates schema and never writes rows, EF's usual "sentinel value" caveat for defaults on non-nullable CLR types doesn't apply here.
  • Existing databases pick these up as ordinary EF AddColumn migrations; all three columns are optional from Quartz's perspective, so nothing breaks for users who don't regenerate.

…AUTO columns

Adds the remaining optional columns introduced across Quartz.NET 3.17-3.19
for all four providers (MySql, PostgreSQL, SQLite, SqlServer):

- QRTZ_TRIGGERS.EXECUTION_GROUP
- QRTZ_FIRED_TRIGGERS.EXECUTION_GROUP
- QRTZ_TRIGGERS.PREFERRED_NODE
- QRTZ_TRIGGERS.PREFERRED_NODE_AUTO

Column names, nullability and the PREFERRED_NODE_AUTO default follow the
official Quartz.NET table scripts. Store types follow each provider's
existing convention in this repo.

Fixes appany#73
Fixes appany#74

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@bittercoder bittercoder changed the title feat(quartz): map EXECUTION_GROUP, PREFERRED_NODE and PREFERRED_NODE_AUTO columns Map missing EXECUTION_GROUP, PREFERRED_NODE and PREFERRED_NODE_AUTO columns Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PREFERRED_NODE / PREFERRED_NODE_AUTO columns are missing EXECUTION_GROUP is missing

1 participant