Skip to content
Permalink
Browse files

Clean confusing conditions on both dev and prod database types

In conditions like devDatabaseType === 'X' || prodDatabaseType === 'X' the first part is useless because when devDatabaseType is valued with X (e.g. mysql) and X is different from h2Disk and h2Memory, prodDatabaseType is always valued with X too
  • Loading branch information
murdos committed Feb 11, 2020
1 parent a3e51de commit f772820b6ce1798417cc973c2532078d893e3c9f
@@ -453,19 +453,19 @@ dependencies {
}
implementation "io.springfox:springfox-bean-validators"
<%_ } _%>
<%_ if (devDatabaseType === 'mysql' || prodDatabaseType === 'mysql') { _%>
<%_ if (prodDatabaseType === 'mysql') { _%>
implementation "mysql:mysql-connector-java"
liquibaseRuntime "mysql:mysql-connector-java"
<%_ } _%>
<%_ if (devDatabaseType === 'postgresql' || prodDatabaseType === 'postgresql') { _%>
<%_ if (prodDatabaseType === 'postgresql') { _%>
implementation "org.postgresql:postgresql"
liquibaseRuntime "org.postgresql:postgresql"
<%_ } _%>
<%_ if (devDatabaseType === 'mariadb' || prodDatabaseType === 'mariadb') { _%>
<%_ if (prodDatabaseType === 'mariadb') { _%>
implementation "org.mariadb.jdbc:mariadb-java-client"
liquibaseRuntime "org.mariadb.jdbc:mariadb-java-client"
<%_ } _%>
<%_ if (devDatabaseType === 'mssql' || prodDatabaseType === 'mssql') { _%>
<%_ if (prodDatabaseType === 'mssql') { _%>
implementation "com.microsoft.sqlserver:mssql-jdbc"
implementation "com.github.sabomichal:liquibase-mssql"
liquibaseRuntime "com.microsoft.sqlserver:mssql-jdbc"
@@ -519,7 +519,7 @@ dependencies {
<%_ if (devDatabaseType === 'h2Disk' || devDatabaseType === 'h2Memory') { _%>
liquibaseRuntime "com.h2database:h2"
<%_ } _%>
<%_ if (devDatabaseType === 'oracle' || prodDatabaseType === 'oracle') { _%>
<%_ if (prodDatabaseType === 'oracle') { _%>
implementation "com.oracle.ojdbc:ojdbc8"
liquibaseRuntime "com.oracle.ojdbc:ojdbc8"
<%_ } _%>
@@ -347,13 +347,13 @@
<artifactId>cache-api</artifactId>
</dependency>
<%_ } _%>
<%_ if (devDatabaseType === 'mysql' || prodDatabaseType === 'mysql') { _%>
<%_ if (prodDatabaseType === 'mysql') { _%>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
<%_ } _%>
<%_ if (devDatabaseType === 'mariadb' || prodDatabaseType === 'mariadb') { _%>
<%_ if (prodDatabaseType === 'mariadb') { _%>
<dependency>
<groupId>org.mariadb.jdbc</groupId>
<artifactId>mariadb-java-client</artifactId>
@@ -365,13 +365,13 @@
<artifactId>lz4-java</artifactId>
</dependency>
<%_ } _%>
<%_ if (devDatabaseType === 'oracle' || prodDatabaseType === 'oracle') { _%>
<%_ if (prodDatabaseType === 'oracle') { _%>
<dependency>
<groupId>com.oracle.ojdbc</groupId>
<artifactId>ojdbc8</artifactId>
</dependency>
<%_ } _%>
<%_ if (devDatabaseType === 'mssql' || prodDatabaseType === 'mssql') { _%>
<%_ if (prodDatabaseType === 'mssql') { _%>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
@@ -480,7 +480,7 @@
<artifactId>couchmove</artifactId>
</dependency>
<%_ } _%>
<%_ if (devDatabaseType === 'postgresql' || prodDatabaseType === 'postgresql') { _%>
<%_ if (prodDatabaseType === 'postgresql') { _%>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
@@ -140,10 +140,10 @@
referencedTableName="<%= jhiTablePrefix %>_user"/>
<%_ } _%>
<%_ if (authenticationType !== 'oauth2' || (authenticationType === 'oauth2' && applicationType !== 'microservice')) { _%>
<<% if (devDatabaseType === 'mssql' || prodDatabaseType === 'mssql') { %>ext:<% } %>loadData
<<% if (prodDatabaseType === 'mssql') { %>ext:<% } %>loadData
file="config/liquibase/data/user.csv"
separator=";"
<%_ if (devDatabaseType === 'mssql' || prodDatabaseType === 'mssql') { _%>
<%_ if (prodDatabaseType === 'mssql') { _%>
identityInsertEnabled="true"
<%_ } _%>
tableName="<%= jhiTablePrefix %>_user">
@@ -152,20 +152,20 @@
<%_ } _%>
<column name="activated" type="boolean"/>
<column name="created_date" type="timestamp"/>
</<% if (devDatabaseType === 'mssql' || prodDatabaseType === 'mssql') { %>ext:<% } %>loadData>
</<% if (prodDatabaseType === 'mssql') { %>ext:<% } %>loadData>
<dropDefaultValue tableName="<%= jhiTablePrefix %>_user" columnName="created_date" columnDataType="datetime"/>
<<% if (devDatabaseType === 'mssql' || prodDatabaseType === 'mssql') { %>ext:<% } %>loadData
<<% if (prodDatabaseType === 'mssql') { %>ext:<% } %>loadData
file="config/liquibase/data/authority.csv"
separator=";"
<%_ if (devDatabaseType === 'mssql' || prodDatabaseType === 'mssql') { _%>
<%_ if (prodDatabaseType === 'mssql') { _%>
identityInsertEnabled="true"
<%_ } _%>
tableName="<%= jhiTablePrefix %>_authority"/>
<<% if (devDatabaseType === 'mssql' || prodDatabaseType === 'mssql') { %>ext:<% } %>loadData
<<% if (prodDatabaseType === 'mssql') { %>ext:<% } %>loadData
file="config/liquibase/data/user_authority.csv"
separator=";"
<%_ if (devDatabaseType === 'mssql' || prodDatabaseType === 'mssql') { _%>
<%_ if (prodDatabaseType === 'mssql') { _%>
identityInsertEnabled="true"
<%_ } _%>
tableName="<%= jhiTablePrefix %>_user_authority"/>
@@ -120,7 +120,7 @@
<%_ if (cacheProvider === 'memcached') { _%>
<logger name="net.rubyeye.xmemcached" level="INFO"/>
<%_ } _%>
<%_ if (devDatabaseType === 'postgresql' || prodDatabaseType === 'postgresql') { _%>
<%_ if (prodDatabaseType === 'postgresql') { _%>
<logger name="org.postgresql" level="WARN"/>
<%_ } _%>
<logger name="org.springframework" level="WARN"/>
@@ -132,7 +132,7 @@
<%_ } _%>
<logger name="org.thymeleaf" level="WARN"/>
<logger name="org.xnio" level="WARN"/>
<%_ if (devDatabaseType === 'mssql' || prodDatabaseType === 'mssql') { _%>
<%_ if (prodDatabaseType === 'mssql') { _%>
<logger name="com.microsoft.sqlserver.jdbc.internals" level="WARN"/>
<%_ } _%>
<%_ if (reactive) { _%>
@@ -93,7 +93,7 @@
<%_ if (cacheProvider === 'memcached') { _%>
<logger name="net.rubyeye.xmemcached" level="INFO"/>
<%_ } _%>
<%_ if (devDatabaseType === 'postgresql' || prodDatabaseType === 'postgresql') { _%>
<%_ if (prodDatabaseType === 'postgresql') { _%>
<logger name="org.postgresql.jdbc" level="WARN"/>
<%_ } _%>
<logger name="org.springframework" level="WARN"/>
@@ -109,7 +109,7 @@
<logger name="kafka" level="WARN"/>
<logger name="org.I0Itec" level="WARN"/>
<%_ } _%>
<%_ if (devDatabaseType === 'mssql' || prodDatabaseType === 'mssql') { _%>
<%_ if (prodDatabaseType === 'mssql') { _%>
<logger name="com.microsoft.sqlserver.jdbc.internals" level="WARN"/>
<%_ } _%>
<%_ if (reactive) { _%>

0 comments on commit f772820

Please sign in to comment.
You can’t perform that action at this time.