diff --git a/bookstore/src/main/resources/application-dev.properties b/bookstore/src/main/resources/application-dev.properties index 0dbffec..e1cb43e 100644 --- a/bookstore/src/main/resources/application-dev.properties +++ b/bookstore/src/main/resources/application-dev.properties @@ -1,19 +1,9 @@ # Pekka Helenius , Fjordtek 2020 # Development configuration - - - -# Temporary, volatile database -spring.h2.console.enabled = true -spring.h2.console.path = /h2-console - -# Ref: http://h2database.com/html/features.html # -spring.datasource.url = jdbc:h2:mem:testdb;MODE=MySQL -spring.jpa.show-sql = true - - +# NOTE: Database configuration should be provided in additional +# database-dev.properties file. management.endpoints.enabled-by-default = true management.endpoints.web.exposure.include = * \ No newline at end of file diff --git a/bookstore/src/main/resources/application-prod.properties b/bookstore/src/main/resources/application-prod.properties index 5ab21ed..23fad4b 100644 --- a/bookstore/src/main/resources/application-prod.properties +++ b/bookstore/src/main/resources/application-prod.properties @@ -1,57 +1,6 @@ # Pekka Helenius , Fjordtek 2020 # Production configuration - - - -# Persistent database -spring.datasource.driver-class-name = com.mysql.cj.jdbc.Driver -spring.datasource.url = jdbc:mysql://127.0.0.1:3306/?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC -spring.datasource.username = -spring.datasource.password = -spring.datasource.initialization-mode = always - -spring.h2.console.enabled = false -spring.jpa.show-sql = false - -# Disable auto-IDs, let SQL server handle them -spring.jpa.hibernate.use-new-id-generator-mappings = false - - - -# Hibernate (& SQL server) table naming strategy - -# NOTE: SQL server // Unix environments # -# Table names are case sensitive. -# For more information, see -# https://dev.mysql.com/doc/refman/8.0/en/identifier-case-sensitivity.html -# -# Most notable the following part: -# -# "...such (table) names are not case-sensitive in Windows, but are case-sensitive in -# most varieties of Unix. One notable exception is macOS, which is Unix-based -# but uses a default file system type (HFS+) that is not case-sensitive." -# -# If required, configure [mysqld] section in -# SQL server configuration file (Unix: usually /etc/mysql/my.cnf OR /etc/my.cnf), -# especially configuration entry 'lower_case_table_names' -# -# Please remember, when creating table schema (resources/schema.sql), -# and configuring @Table annotation naming scheme for tables, -# consider the following factors: -# -# 1) Target SQL server environment* -# - SQL server naming policy configuration -# - SQL server operating system environment (see reference link & quote above) -# -# 2) Defined letter case used in @Table annotation name parameters in this -# application context. Practically meaning any classes defined as Jakarta -# Persistence entities (classes with @Entity annotations). -# -# *If unsure, contact your SQL server administrator to get required assistance -# for your application configuration. -# -spring.jpa.hibernate.naming.physical-strategy = org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl - -#spring.jpa.hibernate.ddl-auto = validate +# NOTE: Database configuration should be provided in additional +# database-prod.properties file. \ No newline at end of file diff --git a/bookstore/src/main/resources/application.properties b/bookstore/src/main/resources/application.properties index 5093e93..505cd59 100644 --- a/bookstore/src/main/resources/application.properties +++ b/bookstore/src/main/resources/application.properties @@ -7,7 +7,7 @@ # dev :: for development # prod :: for production # -spring.profiles.active = dev +spring.profiles.active = prod # Default HTTP TCP port number for this server application # Do not set this value below 1024 as these TCP/UDP ports are privileged, requiring root permissions diff --git a/bookstore/src/main/resources/database-dev.properties b/bookstore/src/main/resources/database-dev.properties new file mode 100644 index 0000000..a43b7f7 --- /dev/null +++ b/bookstore/src/main/resources/database-dev.properties @@ -0,0 +1,8 @@ +# Temporary, volatile database +spring.h2.console.enabled = true +spring.h2.console.path = /h2-console + +# Ref: http://h2database.com/html/features.html +# +spring.datasource.url = jdbc:h2:mem:testdb;MODE=MySQL +spring.jpa.show-sql = true \ No newline at end of file diff --git a/bookstore/src/main/resources/database-prod.default.properties b/bookstore/src/main/resources/database-prod.default.properties new file mode 100644 index 0000000..d33476b --- /dev/null +++ b/bookstore/src/main/resources/database-prod.default.properties @@ -0,0 +1,51 @@ +# Persistent database +spring.datasource.driver-class-name = com.mysql.cj.jdbc.Driver +spring.datasource.url = jdbc:mysql://127.0.0.1:3306/?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC +spring.datasource.username = +spring.datasource.password = +spring.datasource.initialization-mode = always + +spring.h2.console.enabled = false +spring.jpa.show-sql = false + +# Disable auto-IDs, let SQL server handle them +spring.jpa.hibernate.use-new-id-generator-mappings = false + + + +# Hibernate (& SQL server) table naming strategy + +# NOTE: SQL server // Unix environments +# +# Table names are case sensitive. +# For more information, see +# https://dev.mysql.com/doc/refman/8.0/en/identifier-case-sensitivity.html +# +# Most notable the following part: +# +# "...such (table) names are not case-sensitive in Windows, but are case-sensitive in +# most varieties of Unix. One notable exception is macOS, which is Unix-based +# but uses a default file system type (HFS+) that is not case-sensitive." +# +# If required, configure [mysqld] section in +# SQL server configuration file (Unix: usually /etc/mysql/my.cnf OR /etc/my.cnf), +# especially configuration entry 'lower_case_table_names' +# +# Please remember, when creating table schema (resources/schema.sql), +# and configuring @Table annotation naming scheme for tables, +# consider the following factors: +# +# 1) Target SQL server environment* +# - SQL server naming policy configuration +# - SQL server operating system environment (see reference link & quote above) +# +# 2) Defined letter case used in @Table annotation name parameters in this +# application context. Practically meaning any classes defined as Jakarta +# Persistence entities (classes with @Entity annotations). +# +# *If unsure, contact your SQL server administrator to get required assistance +# for your application configuration. +# +spring.jpa.hibernate.naming.physical-strategy = org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl + +#spring.jpa.hibernate.ddl-auto = validate