Skip to content

Commit

Permalink
Merge pull request #258 from PBH-BTN/master
Browse files Browse the repository at this point in the history
5.0.2
  • Loading branch information
Ghost-chu authored Jul 17, 2024
2 parents 5d2c2a3 + c154cc7 commit 1ba7c2d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.ghostchu.peerbanhelper</groupId>
<artifactId>peerbanhelper</artifactId>
<version>5.0.1</version>
<version>5.0.2</version>
<packaging>takari-jar</packaging>

<name>PeerBanHelper</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ private void createTables() throws SQLException {

private void performUpgrade() throws SQLException {
Dao<MetadataEntity, String> metadata = DaoManager.createDao(getDataSource(), MetadataEntity.class);
MetadataEntity version = metadata.createIfNotExists(new MetadataEntity("version", "2"));
MetadataEntity version = metadata.createIfNotExists(new MetadataEntity("version", "0"));
int v = Integer.parseInt(version.getValue());
if (v < 2) {
if (v < 3) {
try {
// so something
var historyDao = DaoManager.createDao(getDataSource(), HistoryEntity.class);
historyDao.executeRaw("ALTER TABLE " + historyDao.getTableName() + " ADD COLUMN downloader VARCHAR DEFAULT ''");
} catch (Exception err) {
log.error("Unable to upgrade database schema", err);
}
v = 2;
v = 3;
}
version.setValue(String.valueOf(v));
metadata.update(version);
Expand Down

0 comments on commit 1ba7c2d

Please sign in to comment.