diff --git a/docs/versionhistory.rst b/docs/versionhistory.rst index aa78f7ad..d579d41c 100644 --- a/docs/versionhistory.rst +++ b/docs/versionhistory.rst @@ -29,6 +29,7 @@ APScheduler, see the :doc:`migration section `. reached and then a job was completed, thus making job processing possible again (PR by MohammadAmin Vahedinia) - Fixed the shutdown procedure of the Redis event broker +- Fixed ``SQLAlchemyDataStore`` not respecting custom schema name when creating enums **4.0.0a4** diff --git a/src/apscheduler/datastores/sqlalchemy.py b/src/apscheduler/datastores/sqlalchemy.py index fbbebf43..282cf4bc 100644 --- a/src/apscheduler/datastores/sqlalchemy.py +++ b/src/apscheduler/datastores/sqlalchemy.py @@ -296,7 +296,7 @@ def get_table_definitions(self) -> MetaData: Column("args", LargeBinary), Column("kwargs", LargeBinary), Column("paused", Boolean, nullable=False, server_default=literal(False)), - Column("coalesce", Enum(CoalescePolicy), nullable=False), + Column("coalesce", Enum(CoalescePolicy, metadata=metadata), nullable=False), Column("misfire_grace_time", interval_type), Column("max_jitter", interval_type), *next_fire_time_tzoffset_columns, @@ -324,7 +324,7 @@ def get_table_definitions(self) -> MetaData: "job_results", metadata, Column("job_id", Uuid, primary_key=True), - Column("outcome", Enum(JobOutcome), nullable=False), + Column("outcome", Enum(JobOutcome, metadata=metadata), nullable=False), Column("started_at", timestamp_type, index=True), Column("finished_at", timestamp_type, nullable=False, index=True), Column("expires_at", timestamp_type, nullable=False, index=True),