1
0

feat(web): 更新数据源配置并迁移数据库

- 修改 .idea/dataSources.xml 中的数据源配置,更新为新的 MySQL 数据源
- 更新 DataResourceController 中的属性名称,以适应新的数据库结构
- 修改 CsvResourceFormat、JsonLineResourceFormat 和 JsonResourceFormat 类中的属性名称
- 更新 application.yml 中的数据库配置,使用新的 MySQL 数据源
- 在 pom.xml 中添加 MySQL 连接器依赖,以支持新的数据库
This commit is contained in:
2024-12-18 12:26:06 +08:00
parent cedb108049
commit 083a8771d2
7 changed files with 19 additions and 15 deletions

View File

@@ -174,18 +174,18 @@ public class DataResourceController extends SimpleControllerSupport<DataResource
break;
case JSON:
JsonResourceFormat jsonFormat = (JsonResourceFormat) dataResource.getFormat();
item.setJsonSchemaText(jsonFormat.getSchema());
item.setJsonSchema(mapper.readValue(jsonFormat.getSchema(), Map.class));
item.setJsonSchemaText(jsonFormat.getJsonSchema());
item.setJsonSchema(mapper.readValue(jsonFormat.getJsonSchema(), Map.class));
break;
case JSON_LINE:
JsonLineResourceFormat jsonLineFormat = (JsonLineResourceFormat) dataResource.getFormat();
item.setJsonLineSchemaText(jsonLineFormat.getSchema());
item.setJsonLineSchema(mapper.readValue(jsonLineFormat.getSchema(), Map.class));
item.setJsonLineSchemaText(jsonLineFormat.getJsonSchema());
item.setJsonLineSchema(mapper.readValue(jsonLineFormat.getJsonSchema(), Map.class));
break;
case CSV:
CsvResourceFormat csvFormat = (CsvResourceFormat) dataResource.getFormat();
item.setCsvSchemaText(csvFormat.getSchema());
item.setCsvSchema(mapper.readValue(csvFormat.getSchema(), Map.class));
item.setCsvSchemaText(csvFormat.getCsvSchema());
item.setCsvSchema(mapper.readValue(csvFormat.getCsvSchema(), Map.class));
break;
}
if (ObjectUtil.isNotNull(dataResource.getExample())) {

View File

@@ -28,7 +28,7 @@ import org.hibernate.annotations.Where;
@SQLDelete(sql = "update " + Constants.TABLE_PREFIX + "resource_format" + " set deleted = true where id = ?")
@Where(clause = LogicDeleteIdOnlyEntity.LOGIC_DELETE_CLAUSE)
public class CsvResourceFormat extends ResourceFormat {
private String schema;
private String csvSchema;
@Override
public Type getFormatType() {

View File

@@ -28,7 +28,7 @@ import org.hibernate.annotations.Where;
@SQLDelete(sql = "update " + Constants.TABLE_PREFIX + "resource_format" + " set deleted = true where id = ?")
@Where(clause = LogicDeleteIdOnlyEntity.LOGIC_DELETE_CLAUSE)
public class JsonLineResourceFormat extends ResourceFormat {
private String schema;
private String jsonSchema;
@Override
public Type getFormatType() {

View File

@@ -28,7 +28,7 @@ import org.hibernate.annotations.Where;
@SQLDelete(sql = "update " + Constants.TABLE_PREFIX + "resource_format" + " set deleted = true where id = ?")
@Where(clause = LogicDeleteIdOnlyEntity.LOGIC_DELETE_CLAUSE)
public class JsonResourceFormat extends ResourceFormat {
private String schema;
private String jsonSchema;
@Override
public Type getFormatType() {

View File

@@ -6,10 +6,10 @@ spring:
profiles:
include: common,metrics,encrypt
datasource:
url: jdbc:h2:./database;DATABASE_TO_LOWER=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE
username: lanyuanxiaoyao
password: lanyuanxiaoyao
driver-class-name: org.h2.Driver
url: jdbc:mysql://132.122.1.185:31000/gringotts
username: iap
password: SLvwP6@SM2J*SbUw_iap
driver-class-name: com.mysql.cj.jdbc.Driver
jpa:
generate-ddl: true
show-sql: true