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

Релиз 2024.1.1 #596

Merged
merged 4 commits into from
May 4, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</parent>
<groupId>ru.investbook</groupId>
<artifactId>investbook</artifactId>
<version>2024.1</version>
<version>2024.1.1</version>

<name>investbook</name>
<description>Investor Accounting Book</description>
Expand Down Expand Up @@ -62,7 +62,7 @@

<properties>
<!-- Valid version is (0-255).(0-255).(0-65535) -->
<win.msi.version>24.1</win.msi.version>
<win.msi.version>24.1.1</win.msi.version>
<java.version>21</java.version>
</properties>

Expand Down Expand Up @@ -96,12 +96,12 @@
<dependency>
<groupId>com.github.spacious-team</groupId>
<artifactId>broker-report-parser-api</artifactId>
<version>2023.1</version>
<version>2024.1</version>
</dependency>
<dependency>
<groupId>com.github.spacious-team</groupId>
<artifactId>table-wrapper-spring-boot-starter</artifactId>
<version>2023.1</version>
<version>2024.1</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/ru/investbook/upgrade/SqlDataExporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@
@Service
@RequiredArgsConstructor
public class SqlDataExporter {
private static final String EXPORT_FILE_NAME = "export-2022.9.sql";
private final String expectedInvestbookVersionsForExport = "2022.9";
private static final String INVESTBOOK_VERSION_PREFIX_FOR_EXPORT = "2024.1.";
private static final String EXPORT_FILE_NAME = "export-2024.1.x.sql";
private final BuildProperties buildProperties;
private final InvestbookProperties investbookProperties;
private final JdbcTemplate jdbcTemplate;

@PreDestroy
public void preDestroy() {
String version = buildProperties.getVersion();
if (version.startsWith(expectedInvestbookVersionsForExport)) {
if (version.startsWith(INVESTBOOK_VERSION_PREFIX_FOR_EXPORT)) {
Path file = investbookProperties.getDataPath()
.resolve(EXPORT_FILE_NAME)
.toAbsolutePath();
Expand All @@ -54,6 +54,7 @@ public void preDestroy() {
private void exportSqlData(Path file) {
try {
Instant t0 = Instant.now();
// DROP is required to delete tables created by Flyway
jdbcTemplate.execute("SCRIPT DROP TO '" + file + "' CHARSET 'UTF-8'");
Instant t1 = Instant.now();
log.info("Экспорт БД в файл '{}' завершен за {}", file, Duration.between(t0, t1));
Expand Down