Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable type check #728

Merged
merged 8 commits into from
Jun 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jmeter.sampler/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<parent>
<artifactId>meveo</artifactId>
<groupId>org.meveo</groupId>
<version>7.1.4</version>
<version>7.1.5</version>
</parent>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion meveo-admin/ejbs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>meveo-admin</artifactId>
<groupId>org.meveo</groupId>
<version>7.1.4</version>
<version>7.1.5</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>meveo-admin-ejbs</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.hibernate.Session;
import org.meveo.admin.exception.BusinessException;
import org.meveo.cache.CustomFieldsCacheContainerProvider;
import org.meveo.commons.utils.ParamBean;
import org.meveo.commons.utils.StringUtils;
import org.meveo.jpa.EntityManagerProvider;
import org.meveo.model.crm.CustomFieldTemplate;
Expand Down Expand Up @@ -707,8 +708,9 @@ public void addField(String sqlConnectionCode, String dbTableName, CustomFieldTe
* @throws BusinessException if the computed type and the actual type doesn't match
*/
private void checkTypeMatches(String dbTableName, CustomFieldTemplate cft, AddColumnConfig column, String typeName, int typeSize) throws BusinessException {
String type = typeName;
switch (type) {
if(Boolean.parseBoolean(ParamBean.getInstance().getProperty("meveo.sql.check_column_type", "true"))) {
String type = typeName;
switch (type) {
case "int8" :
type = "bigint";
break;
Expand All @@ -726,15 +728,16 @@ private void checkTypeMatches(String dbTableName, CustomFieldTemplate cft, AddCo
if(typeSize != 0) {
type += "(" + typeSize + ")";
}
}

if (column.getType().toLowerCase().contains(type)) {
return;
}

// Field definition must match the existing field
if(!column.getType().toLowerCase().equals(type)) {
throw new BusinessException("Field defintion for " + cft + " (" + column.getType().toLowerCase() + ") does not match existing column in table " + dbTableName + " (" + type + ")");
}

if (column.getType().toLowerCase().contains(type)) {
return;
}

// Field definition must match the existing field
if(!column.getType().toLowerCase().equals(type)) {
throw new BusinessException("Field defintion for " + cft + " (" + column.getType().toLowerCase() + ") does not match existing column in table " + dbTableName + " (" + type + ")");
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion meveo-admin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>org.meveo</groupId>
<artifactId>meveo</artifactId>
<relativePath>../pom.xml</relativePath>
<version>7.1.4</version>
<version>7.1.5</version>
</parent>

<artifactId>meveo-admin</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion meveo-admin/web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<artifactId>meveo-admin</artifactId>
<groupId>org.meveo</groupId>
<relativePath>../pom.xml</relativePath>
<version>7.1.4</version>
<version>7.1.5</version>
</parent>
<artifactId>meveo-admin-web</artifactId>
<name>Meveo Admin Web Application - Web Module</name>
Expand Down
2 changes: 1 addition & 1 deletion meveo-api-dto/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>org.meveo</groupId>
<artifactId>meveo</artifactId>
<relativePath>../pom.xml</relativePath>
<version>7.1.4</version>
<version>7.1.5</version>
</parent>
<artifactId>meveo-api-dto</artifactId>
<name>Meveo API DTO</name>
Expand Down
2 changes: 1 addition & 1 deletion meveo-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<groupId>org.meveo</groupId>
<artifactId>meveo</artifactId>
<relativePath>../pom.xml</relativePath>
<version>7.1.4</version>
<version>7.1.5</version>
</parent>
<artifactId>meveo-api</artifactId>
<name>Meveo API</name>
Expand Down
2 changes: 1 addition & 1 deletion meveo-el-resolver/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>meveo</artifactId>
<groupId>org.meveo</groupId>
<version>7.1.4</version>
<version>7.1.5</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion meveo-json-schema/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>org.meveo</groupId>
<artifactId>meveo</artifactId>
<relativePath>../pom.xml</relativePath>
<version>7.1.4</version>
<version>7.1.5</version>
</parent>

<artifactId>meveo-json-schema</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion meveo-model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>org.meveo</groupId>
<artifactId>meveo</artifactId>
<relativePath>../pom.xml</relativePath>
<version>7.1.4</version>
<version>7.1.5</version>
</parent>
<artifactId>meveo-model</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion meveo-reporting/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<parent>
<artifactId>meveo</artifactId>
<groupId>org.meveo</groupId>
<version>7.1.4</version>
<version>7.1.5</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion meveo-security/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>org.meveo</groupId>
<artifactId>meveo</artifactId>
<relativePath>../pom.xml</relativePath>
<version>7.1.4</version>
<version>7.1.5</version>
</parent>
<artifactId>meveo-security</artifactId>
<packaging>jar</packaging>
Expand Down
2 changes: 1 addition & 1 deletion meveo-ws/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<parent>
<artifactId>meveo</artifactId>
<groupId>org.meveo</groupId>
<version>7.1.4</version>
<version>7.1.5</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>org.meveo</groupId>
<artifactId>meveo</artifactId>
<packaging>pom</packaging>
<version>7.1.4</version>
<version>7.1.5</version>
<name>Meveo Parent Project</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down