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

#2094 master #2096

Merged
merged 19 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<tr>
<td>Latest Release</td>
<td>
<a href="https://github.com/ho-dev/HattrickOrganizer/releases/tag/7.3">
<img src="https://img.shields.io/badge/HO-7.3-brightgreen.svg" alt="latest release" />
<a href="https://github.com/ho-dev/HattrickOrganizer/releases/tag/8.0">
<img src="https://img.shields.io/badge/HO-8.0-brightgreen.svg" alt="latest release" />
</a>
</td>
</tr>
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/core/db/AbstractTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ public AbstractTable(String tableName, ConnectionManager connectionManager) {
* @return Truncated string
*/
static String truncateString(String s, int maxLength) {
if (s != null && s.length() > maxLength) return s.substring(0, maxLength);
if (s != null && s.length() > maxLength){
HOLogger.instance().warning(AbstractTable.class, "truncated string: " + s);
return s.substring(0, maxLength);
}
return s;
}

Expand Down
3 changes: 3 additions & 0 deletions src/main/java/core/db/DBUpdater.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ private void updateDBv900(int dbVersion) throws SQLException {
var matchDetailsTable = dbManager.getTable(MatchDetailsTable.TABLENAME);
matchDetailsTable.tryChangeColumn("Matchreport", "VARCHAR(40000)");

var youthScoutCommentTable = dbManager.getTable(YouthScoutCommentTable.TABLENAME);
youthScoutCommentTable.tryChangeColumn("Text", "VARCHAR(1024)");

var playerTable = dbManager.getTable(SpielerTable.TABLENAME);
playerTable.tryAddColumn("SubForm", "FLOAT DEFAULT 0");

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/core/db/YouthScoutCommentTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ protected void initColumns() {
columns = new ColumnDescriptor[]{
ColumnDescriptor.Builder.newInstance().setColumnName("YOUTHPLAYER_ID").setGetter((p) -> ((ScoutComment) p).getYouthPlayerId()).setSetter((p, v) -> ((ScoutComment) p).setYouthPlayerId( (int) v)).setType(Types.INTEGER).isNullable(false).build(),
ColumnDescriptor.Builder.newInstance().setColumnName("INDEX").setGetter((p) -> ((ScoutComment) p).getIndex()).setSetter((p, v) -> ((ScoutComment) p).setIndex( (int) v)).setType(Types.INTEGER).isNullable(false).build(),
ColumnDescriptor.Builder.newInstance().setColumnName("Text").setGetter((p) -> ((ScoutComment) p).getText()).setSetter((p, v) -> ((ScoutComment) p).setText( (String) v)).setType(Types.VARCHAR).setLength(255).isNullable(true).build(),
ColumnDescriptor.Builder.newInstance().setColumnName("Text").setGetter((p) -> truncateString (((ScoutComment) p).getText(), 1024)).setSetter((p, v) -> ((ScoutComment) p).setText( (String) v)).setType(Types.VARCHAR).setLength(1024).isNullable(true).build(),
ColumnDescriptor.Builder.newInstance().setColumnName("Type").setGetter((p) -> ((ScoutComment) p).getType().getValue()).setSetter((p, v) -> ((ScoutComment) p).setType(CommentType.valueOf((Integer) v))).setType(Types.INTEGER).isNullable(true).build(),
ColumnDescriptor.Builder.newInstance().setColumnName("Variation").setGetter((p) -> ((ScoutComment) p).getVariation()).setSetter((p, v) -> ((ScoutComment) p).setVariation((Integer) v)).setType(Types.INTEGER).isNullable(true).build(),
ColumnDescriptor.Builder.newInstance().setColumnName("SkillType").setGetter((p) -> Skills.ScoutCommentSkillTypeID.value(((ScoutComment) p).getSkillType())).setSetter((p, v) -> ((ScoutComment) p).setSkillType(Skills.ScoutCommentSkillTypeID.valueOf((Integer) v))).setType(Types.INTEGER).isNullable(true).build(),
Expand Down
3 changes: 1 addition & 2 deletions src/main/resources/release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,10 @@
### Option setting

### Misc
* Fix missing `stable` tag when creating `tag_stable` release (#2081)

## Translations

Reports by Contributors - April 28, 2024 - June 13, 2024
Reports by Contributors - April 28, 2024 - June 23, 2024

* wsbrenk 0

Expand Down