Skip to content

Commit

Permalink
Add default names to all recorded scores with null "playerName".
Browse files Browse the repository at this point in the history
Signed-off-by: Jeffrey Han <itdelatrisu@gmail.com>
  • Loading branch information
itdelatrisu committed Feb 1, 2017
1 parent baf35e3 commit bcb53c5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/itdelatrisu/opsu/db/ScoreDB.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import itdelatrisu.opsu.beatmap.Beatmap;
import itdelatrisu.opsu.options.Options;
import itdelatrisu.opsu.user.User;
import itdelatrisu.opsu.user.UserList;

import java.sql.Connection;
import java.sql.PreparedStatement;
Expand All @@ -46,7 +47,7 @@ public class ScoreDB {
* This value should be changed whenever the database format changes.
* Add any update queries to the {@link #getUpdateQueries(int)} method.
*/
private static final int DATABASE_VERSION = 20170131;
private static final int DATABASE_VERSION = 20170201;

/**
* Returns a list of SQL queries to apply, in order, to update from
Expand All @@ -60,6 +61,8 @@ private static List<String> getUpdateQueries(int version) {
list.add("ALTER TABLE scores ADD COLUMN replay TEXT");
if (version < 20150401)
list.add("ALTER TABLE scores ADD COLUMN playerName TEXT");
if (version < 20170201)
list.add(String.format("UPDATE scores SET playerName = '%s' WHERE playerName IS NULL", UserList.DEFAULT_USER_NAME));

/* add future updates here */

Expand Down

0 comments on commit bcb53c5

Please sign in to comment.