mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-12-28 19:45:50 +01:00
db refactoring: change column order for health overlay table also
This commit is contained in:
parent
359ed46b06
commit
68b303246d
@ -158,15 +158,16 @@ public class GBDaoGenerator {
|
||||
private static Entity addPebbleHealthActivityKindOverlay(Schema schema, Entity user, Entity device) {
|
||||
Entity activityOverlay = addEntity(schema, "PebbleHealthActivityOverlay");
|
||||
activityOverlay.addIdProperty();
|
||||
Property timestampFrom = activityOverlay.addIntProperty("timestampFrom").notNull().getProperty();
|
||||
Property timestampTo = activityOverlay.addIntProperty("timestampTo").notNull().getProperty();
|
||||
activityOverlay.addIntProperty("rawKind").notNull();
|
||||
|
||||
Property userId = activityOverlay.addLongProperty("userId").getProperty();
|
||||
activityOverlay.addToOne(user, userId);
|
||||
Property deviceId = activityOverlay.addLongProperty("deviceId").getProperty();
|
||||
activityOverlay.addToOne(device, deviceId);
|
||||
|
||||
Property timestampFrom = activityOverlay.addIntProperty("timestampFrom").notNull().getProperty();
|
||||
Property timestampTo = activityOverlay.addIntProperty("timestampTo").notNull().getProperty();
|
||||
activityOverlay.addIntProperty("rawKind").notNull();
|
||||
|
||||
Index indexUnique = new Index();
|
||||
indexUnique.addProperty(deviceId);
|
||||
indexUnique.addProperty(timestampFrom);
|
||||
|
@ -72,7 +72,7 @@ class DatalogSessionHealthOverlayData extends DatalogSessionPebbleHealth {
|
||||
|
||||
List<PebbleHealthActivityOverlay> overlayList = new ArrayList<>();
|
||||
for (OverlayRecord overlayRecord : overlayRecords) {
|
||||
overlayList.add(new PebbleHealthActivityOverlay(null, overlayRecord.timestampStart, overlayRecord.timestampStart + overlayRecord.durationSeconds - 1, overlayRecord.type, userId, deviceId)); //TODO: consider if "-1" is what we really want
|
||||
overlayList.add(new PebbleHealthActivityOverlay(null, userId, deviceId, overlayRecord.timestampStart, overlayRecord.timestampStart + overlayRecord.durationSeconds - 1, overlayRecord.type)); //TODO: consider if "-1" is what we really want
|
||||
}
|
||||
overlayDao.insertOrReplaceInTx(overlayList);
|
||||
} catch (Exception ex) {
|
||||
|
@ -71,7 +71,7 @@ class DatalogSessionHealthSleep extends DatalogSessionPebbleHealth {
|
||||
|
||||
List<PebbleHealthActivityOverlay> overlayList = new ArrayList<>();
|
||||
for (SleepRecord sleepRecord : sleepRecords) {
|
||||
overlayList.add(new PebbleHealthActivityOverlay(null, sleepRecord.bedTimeStart, sleepRecord.bedTimeEnd - 1, sleepRecord.type, userId, deviceId)); //TODO: consider if "-1" is what we really want
|
||||
overlayList.add(new PebbleHealthActivityOverlay(null, userId, deviceId, sleepRecord.bedTimeStart, sleepRecord.bedTimeEnd - 1, sleepRecord.type)); //TODO: consider if "-1" is what we really want
|
||||
}
|
||||
overlayDao.insertOrReplaceInTx(overlayList);
|
||||
} catch (Exception ex) {
|
||||
|
Loading…
Reference in New Issue
Block a user