From 85d3f7595a0d71f4dd246f934c6012918692e168 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Andres?= Date: Fri, 24 Jan 2025 12:24:29 +0100 Subject: [PATCH] Specify that SQL Server and Azure SQL databases cannot use `initialize-schema` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://github.com/quartznet/quartznet/blob/b9574e915496487e9f031174a61efc2ba572433d/database/tables/tables_sqlServer.sql shows that the SQL Server script requires replacing `enter_db_name_here` manually, so we need to make a copy of the script in our project for it to work. If this modification is not satisfactory, feel free to edit it; my goal is simply to inform the next person using SQL Server that there is no easy way of using this property. Signed-off-by: Timothée Andres --- .../src/docs/antora/modules/reference/pages/io/quartz.adoc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/io/quartz.adoc b/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/io/quartz.adoc index 1ba8c9d8e2b9..fbf340bd43bf 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/io/quartz.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/io/quartz.adoc @@ -35,6 +35,9 @@ WARNING: By default, the database is detected and initialized by using the stand These scripts drop existing tables, deleting all triggers on every restart. It is also possible to provide a custom script by setting the configprop:spring.quartz.jdbc.schema[] property. +WARNING: SQL Server and Azure SQL databases may not use this mechanism because the script requires the specification of the database name directly. +Make a copy of the script and edit it, before using configprop:spring.quartz.jdbc.schema[] to direct Spring to use it. + To have Quartz use a javadoc:javax.sql.DataSource[] other than the application's main javadoc:javax.sql.DataSource[], declare a javadoc:javax.sql.DataSource[] bean, annotating its javadoc:org.springframework.context.annotation.Bean[format=annotation] method with javadoc:org.springframework.boot.autoconfigure.quartz.QuartzDataSource[format=annotation]. Doing so ensures that the Quartz-specific javadoc:javax.sql.DataSource[] is used by both the javadoc:org.springframework.scheduling.quartz.SchedulerFactoryBean[] and for schema initialization. Similarly, to have Quartz use a javadoc:org.springframework.transaction.TransactionManager[] other than the application's main javadoc:org.springframework.transaction.TransactionManager[] declare a javadoc:org.springframework.transaction.TransactionManager[] bean, annotating its javadoc:org.springframework.context.annotation.Bean[format=annotation] method with javadoc:org.springframework.boot.autoconfigure.quartz.QuartzTransactionManager[format=annotation].