From 578d0436e07b5fc7076e2eb22f2e3176abaf4f0a Mon Sep 17 00:00:00 2001 From: penekhun Date: Fri, 17 Nov 2023 21:20:16 +0900 Subject: [PATCH 1/2] Document comments in SQL for database initialization See gh-38385 --- .../src/docs/asciidoc/howto/data-initialization.adoc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/data-initialization.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/data-initialization.adoc index 21518005ac90..c992170807dc 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/data-initialization.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/data-initialization.adoc @@ -62,6 +62,8 @@ While we do not recommend using multiple data source initialization technologies This will defer data source initialization until after any `EntityManagerFactory` beans have been created and initialized. `schema.sql` can then be used to make additions to any schema creation performed by Hibernate and `data.sql` can be used to populate it. +NOTE: When including comments in your SQL file, it is advisable to use `--` for single-line comments and `/++*++` and `++*++/` for block comments. Be cautious when using other comment formats, as they may lead to the omission of certain SQL statements during parsing. + If you are using a <>, like Flyway or Liquibase, you should use them alone to create and initialize the schema. Using the basic `schema.sql` and `data.sql` scripts alongside Flyway or Liquibase is not recommended and support will be removed in a future release. From 0171ed205cba038e0b8462228df3448cbc81c518 Mon Sep 17 00:00:00 2001 From: Moritz Halbritter Date: Wed, 22 Nov 2023 11:14:13 +0100 Subject: [PATCH 2/2] Polish "Document comments in SQL for database initialization" See gh-38385 --- .../src/docs/asciidoc/howto/data-initialization.adoc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/data-initialization.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/data-initialization.adoc index c992170807dc..fcb20a4e5b79 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/data-initialization.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/data-initialization.adoc @@ -62,7 +62,8 @@ While we do not recommend using multiple data source initialization technologies This will defer data source initialization until after any `EntityManagerFactory` beans have been created and initialized. `schema.sql` can then be used to make additions to any schema creation performed by Hibernate and `data.sql` can be used to populate it. -NOTE: When including comments in your SQL file, it is advisable to use `--` for single-line comments and `/++*++` and `++*++/` for block comments. Be cautious when using other comment formats, as they may lead to the omission of certain SQL statements during parsing. +NOTE: The initialization scripts support `--` for single line comments and `/++*++ ++*++/` for block comments. +Other comment formats are not supported. If you are using a <>, like Flyway or Liquibase, you should use them alone to create and initialize the schema. Using the basic `schema.sql` and `data.sql` scripts alongside Flyway or Liquibase is not recommended and support will be removed in a future release.