@@ -20,7 +20,7 @@ public class OpenApiConfiguration {
|
||||
return new OpenAPI()
|
||||
.info(new Info().title("DiyFile")
|
||||
.description("一款好看的在线文件列表程序")
|
||||
.version("v0.8.2")
|
||||
.version("v0.8.3")
|
||||
.license(new License().name("MIT license").url("https://github.com/besscroft/diyfile/blob/main/LICENSE")))
|
||||
.externalDocs(new ExternalDocumentation()
|
||||
.description("DiyFile 文档")
|
||||
|
||||
@@ -71,6 +71,10 @@
|
||||
<groupId>org.flywaydb</groupId>
|
||||
<artifactId>flyway-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.flywaydb</groupId>
|
||||
<artifactId>flyway-mysql</artifactId>
|
||||
</dependency>
|
||||
<!-- aws-java-sdk-s3 -->
|
||||
<dependency>
|
||||
<groupId>software.amazon.awssdk</groupId>
|
||||
|
||||
@@ -11,6 +11,7 @@ import org.flywaydb.core.api.FlywayException;
|
||||
import org.flywaydb.core.internal.database.DatabaseType;
|
||||
import org.flywaydb.core.internal.exception.FlywaySqlException;
|
||||
import org.flywaydb.core.internal.plugin.PluginRegister;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@@ -37,6 +38,9 @@ public class FlywayConfigure {
|
||||
private static final List<DatabaseType> SORTED_DATABASE_TYPES = new PluginRegister().getPlugins(DatabaseType.class).stream().sorted().collect(Collectors.toList());
|
||||
private final ApplicationContext applicationContext;
|
||||
|
||||
@Value("${spring.flyway.enabled}")
|
||||
private Boolean enabled;
|
||||
|
||||
@PostConstruct
|
||||
public void flywayMigrate() {
|
||||
String datasourceDriveClassName = applicationContext.getEnvironment().getProperty("spring.datasource.driver-class-name");
|
||||
@@ -54,6 +58,10 @@ public class FlywayConfigure {
|
||||
log.info("sqlite 数据库文件已存在,路径:{}", folderPath);
|
||||
}
|
||||
}
|
||||
if (!enabled) {
|
||||
log.info("flyway 已关闭,跳过初始化...");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
String databaseProductName = dataSource.getConnection().getMetaData().getDatabaseProductName();
|
||||
String dbType = databaseProductName.toLowerCase(Locale.ROOT);
|
||||
|
||||
12
pom.xml
12
pom.xml
@@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.1.3</version>
|
||||
<version>3.1.4</version>
|
||||
<relativePath/> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
|
||||
@@ -17,19 +17,19 @@
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<properties>
|
||||
<revision>0.8.2</revision>
|
||||
<revision>0.8.3</revision>
|
||||
<java.version>17</java.version>
|
||||
<maven.compiler.release>17</maven.compiler.release>
|
||||
<maven.compiler.source>${java.version}</maven.compiler.source>
|
||||
<maven.compiler.target>${java.version}</maven.compiler.target>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||
<spring-boot.version>3.1.3</spring-boot.version>
|
||||
<spring-boot.version>3.1.4</spring-boot.version>
|
||||
<mapstruct.version>1.5.5.Final</mapstruct.version>
|
||||
<lombok-mapstruct-binding.version>0.2.0</lombok-mapstruct-binding.version>
|
||||
<mybatis-plus.version>3.5.3.2</mybatis-plus.version>
|
||||
<springdoc.version>2.2.0</springdoc.version>
|
||||
<sa-token.version>1.34.0</sa-token.version>
|
||||
<sa-token.version>1.36.0</sa-token.version>
|
||||
<hutool-all.version>5.8.20</hutool-all.version>
|
||||
<pagehelper.version>1.4.7</pagehelper.version>
|
||||
<oshi.version>6.4.4</oshi.version>
|
||||
@@ -73,6 +73,10 @@
|
||||
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
|
||||
Reference in New Issue
Block a user