mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-09-27 22:17:32 +02:00
Fix PlayerTableRowPatch is applied check
This commit is contained in:
parent
acf9d92b1d
commit
63350a4fea
@ -43,10 +43,10 @@ public class PlayerTableRowPatch extends Patch {
|
|||||||
|
|
||||||
private boolean tableRowIdsAreUniquePerTableId() {
|
private boolean tableRowIdsAreUniquePerTableId() {
|
||||||
String columnCountPerTableSql = SELECT +
|
String columnCountPerTableSql = SELECT +
|
||||||
TABLE_ID + ",COUNT(1) as c" +
|
USER_UUID + ',' + TABLE_ID + ",COUNT(1) as c" +
|
||||||
FROM + TABLE_NAME +
|
FROM + TABLE_NAME +
|
||||||
WHERE + TABLE_ROW + "=?" +
|
WHERE + TABLE_ROW + "=?" +
|
||||||
GROUP_BY + TABLE_ID;
|
GROUP_BY + TABLE_ID + ',' + USER_UUID;
|
||||||
return query(new QueryStatement<>(columnCountPerTableSql) {
|
return query(new QueryStatement<>(columnCountPerTableSql) {
|
||||||
@Override
|
@Override
|
||||||
public void prepare(PreparedStatement statement) throws SQLException {
|
public void prepare(PreparedStatement statement) throws SQLException {
|
||||||
|
@ -43,10 +43,10 @@ public class ServerTableRowPatch extends Patch {
|
|||||||
|
|
||||||
private boolean tableRowIdsAreUniquePerTableId() {
|
private boolean tableRowIdsAreUniquePerTableId() {
|
||||||
String columnCountPerTableSql = SELECT +
|
String columnCountPerTableSql = SELECT +
|
||||||
TABLE_ID + ",COUNT(1) as c" +
|
SERVER_UUID + ',' + TABLE_ID + ",COUNT(1) as c" +
|
||||||
FROM + TABLE_NAME +
|
FROM + TABLE_NAME +
|
||||||
WHERE + TABLE_ROW + "=?" +
|
WHERE + TABLE_ROW + "=?" +
|
||||||
GROUP_BY + TABLE_ID;
|
GROUP_BY + TABLE_ID + ',' + SERVER_UUID;
|
||||||
return query(new QueryStatement<>(columnCountPerTableSql) {
|
return query(new QueryStatement<>(columnCountPerTableSql) {
|
||||||
@Override
|
@Override
|
||||||
public void prepare(PreparedStatement statement) throws SQLException {
|
public void prepare(PreparedStatement statement) throws SQLException {
|
||||||
|
@ -119,7 +119,7 @@ public class RandomData {
|
|||||||
public static FinishedSession randomSession(ServerUUID serverUUID, String[] worlds, long start, UUID... uuids) {
|
public static FinishedSession randomSession(ServerUUID serverUUID, String[] worlds, long start, UUID... uuids) {
|
||||||
DataMap extraData = new DataMap();
|
DataMap extraData = new DataMap();
|
||||||
extraData.put(WorldTimes.class, RandomData.randomWorldTimes(worlds));
|
extraData.put(WorldTimes.class, RandomData.randomWorldTimes(worlds));
|
||||||
long end = RandomData.randomTimeAfter(start);
|
long end = RandomData.randomTimeAfter(start + 1);
|
||||||
|
|
||||||
if (uuids.length >= 2) {
|
if (uuids.length >= 2) {
|
||||||
List<PlayerKill> kills = RandomData.randomKills(serverUUID, uuids[0], pickAtRandom(Arrays.copyOfRange(uuids, 1, uuids.length)));
|
List<PlayerKill> kills = RandomData.randomKills(serverUUID, uuids[0], pickAtRandom(Arrays.copyOfRange(uuids, 1, uuids.length)));
|
||||||
|
Loading…
Reference in New Issue
Block a user