mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-23 16:53:04 +02:00
Merge pull request #165 from erijo/nonnull
Readd NonNull annotation on ScaleUser gender and scaleUnit
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
"formatVersion": 1,
|
"formatVersion": 1,
|
||||||
"database": {
|
"database": {
|
||||||
"version": 2,
|
"version": 2,
|
||||||
"identityHash": "6e74b969dde2ca76a6fe8ace46a51f8c",
|
"identityHash": "166a2a83c723c4117edaf1d107ac5194",
|
||||||
"entities": [
|
"entities": [
|
||||||
{
|
{
|
||||||
"tableName": "scaleMeasurements",
|
"tableName": "scaleMeasurements",
|
||||||
@@ -120,7 +120,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"tableName": "scaleUsers",
|
"tableName": "scaleUsers",
|
||||||
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `username` TEXT, `birthday` INTEGER, `bodyHeight` INTEGER NOT NULL, `scaleUnit` INTEGER, `gender` INTEGER, `initialWeight` REAL NOT NULL, `goalWeight` REAL NOT NULL, `goalDate` INTEGER)",
|
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `username` TEXT, `birthday` INTEGER, `bodyHeight` INTEGER NOT NULL, `scaleUnit` INTEGER NOT NULL, `gender` INTEGER NOT NULL, `initialWeight` REAL NOT NULL, `goalWeight` REAL NOT NULL, `goalDate` INTEGER)",
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"fieldPath": "id",
|
"fieldPath": "id",
|
||||||
@@ -150,13 +150,13 @@
|
|||||||
"fieldPath": "scaleUnit",
|
"fieldPath": "scaleUnit",
|
||||||
"columnName": "scaleUnit",
|
"columnName": "scaleUnit",
|
||||||
"affinity": "INTEGER",
|
"affinity": "INTEGER",
|
||||||
"notNull": false
|
"notNull": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldPath": "gender",
|
"fieldPath": "gender",
|
||||||
"columnName": "gender",
|
"columnName": "gender",
|
||||||
"affinity": "INTEGER",
|
"affinity": "INTEGER",
|
||||||
"notNull": false
|
"notNull": true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldPath": "initialWeight",
|
"fieldPath": "initialWeight",
|
||||||
@@ -189,7 +189,7 @@
|
|||||||
],
|
],
|
||||||
"setupQueries": [
|
"setupQueries": [
|
||||||
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
|
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
|
||||||
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"6e74b969dde2ca76a6fe8ace46a51f8c\")"
|
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"166a2a83c723c4117edaf1d107ac5194\")"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -19,6 +19,7 @@ package com.health.openscale.core.datatypes;
|
|||||||
import android.arch.persistence.room.ColumnInfo;
|
import android.arch.persistence.room.ColumnInfo;
|
||||||
import android.arch.persistence.room.Entity;
|
import android.arch.persistence.room.Entity;
|
||||||
import android.arch.persistence.room.PrimaryKey;
|
import android.arch.persistence.room.PrimaryKey;
|
||||||
|
import android.support.annotation.NonNull;
|
||||||
|
|
||||||
import com.health.openscale.core.utils.Converters;
|
import com.health.openscale.core.utils.Converters;
|
||||||
import com.health.openscale.core.utils.DateTimeHelpers;
|
import com.health.openscale.core.utils.DateTimeHelpers;
|
||||||
@@ -38,8 +39,10 @@ public class ScaleUser {
|
|||||||
@ColumnInfo(name = "bodyHeight")
|
@ColumnInfo(name = "bodyHeight")
|
||||||
private int bodyHeight;
|
private int bodyHeight;
|
||||||
@ColumnInfo(name = "scaleUnit")
|
@ColumnInfo(name = "scaleUnit")
|
||||||
|
@NonNull
|
||||||
private Converters.WeightUnit scaleUnit;
|
private Converters.WeightUnit scaleUnit;
|
||||||
@ColumnInfo(name = "gender")
|
@ColumnInfo(name = "gender")
|
||||||
|
@NonNull
|
||||||
private Converters.Gender gender;
|
private Converters.Gender gender;
|
||||||
@ColumnInfo(name = "initialWeight")
|
@ColumnInfo(name = "initialWeight")
|
||||||
private float initialWeight;
|
private float initialWeight;
|
||||||
|
Reference in New Issue
Block a user