mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-24 09:13:04 +02:00
removed notnull annotations.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
"formatVersion": 1,
|
||||
"database": {
|
||||
"version": 2,
|
||||
"identityHash": "166a2a83c723c4117edaf1d107ac5194",
|
||||
"identityHash": "6e74b969dde2ca76a6fe8ace46a51f8c",
|
||||
"entities": [
|
||||
{
|
||||
"tableName": "scaleMeasurements",
|
||||
@@ -120,7 +120,7 @@
|
||||
},
|
||||
{
|
||||
"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 NOT NULL, `gender` INTEGER NOT NULL, `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, `gender` INTEGER, `initialWeight` REAL NOT NULL, `goalWeight` REAL NOT NULL, `goalDate` INTEGER)",
|
||||
"fields": [
|
||||
{
|
||||
"fieldPath": "id",
|
||||
@@ -150,13 +150,13 @@
|
||||
"fieldPath": "scaleUnit",
|
||||
"columnName": "scaleUnit",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "gender",
|
||||
"columnName": "gender",
|
||||
"affinity": "INTEGER",
|
||||
"notNull": true
|
||||
"notNull": false
|
||||
},
|
||||
{
|
||||
"fieldPath": "initialWeight",
|
||||
@@ -189,7 +189,7 @@
|
||||
],
|
||||
"setupQueries": [
|
||||
"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, \"166a2a83c723c4117edaf1d107ac5194\")"
|
||||
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"6e74b969dde2ca76a6fe8ace46a51f8c\")"
|
||||
]
|
||||
}
|
||||
}
|
@@ -23,7 +23,6 @@ import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Handler;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.text.format.DateFormat;
|
||||
import android.util.Log;
|
||||
@@ -106,7 +105,7 @@ public class OpenScale {
|
||||
.allowMainThreadQueries()
|
||||
.addCallback(new RoomDatabase.Callback() {
|
||||
@Override
|
||||
public void onOpen(@NonNull SupportSQLiteDatabase db) {
|
||||
public void onOpen(SupportSQLiteDatabase db) {
|
||||
super.onOpen(db);
|
||||
db.setForeignKeyConstraintsEnabled(true);
|
||||
}
|
||||
|
@@ -15,8 +15,6 @@
|
||||
*/
|
||||
package com.health.openscale.core.alarm;
|
||||
|
||||
import android.support.annotation.NonNull;
|
||||
|
||||
import java.util.Calendar;
|
||||
|
||||
public class AlarmEntry implements Comparable<AlarmEntry>
|
||||
@@ -78,7 +76,7 @@ public class AlarmEntry implements Comparable<AlarmEntry>
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(@NonNull AlarmEntry o)
|
||||
public int compareTo(AlarmEntry o)
|
||||
{
|
||||
int rc = compare(dayOfWeek, o.dayOfWeek);
|
||||
if (rc == 0) rc = compare(timeInMillis, o.timeInMillis);
|
||||
|
@@ -21,7 +21,6 @@ import android.arch.persistence.room.Database;
|
||||
import android.arch.persistence.room.RoomDatabase;
|
||||
import android.arch.persistence.room.TypeConverters;
|
||||
import android.arch.persistence.room.migration.Migration;
|
||||
import android.support.annotation.NonNull;
|
||||
|
||||
import com.health.openscale.core.datatypes.ScaleMeasurement;
|
||||
import com.health.openscale.core.datatypes.ScaleUser;
|
||||
@@ -35,7 +34,7 @@ public abstract class AppDatabase extends RoomDatabase {
|
||||
|
||||
public static final Migration MIGRATION_1_2 = new Migration(1, 2) {
|
||||
@Override
|
||||
public void migrate(@NonNull SupportSQLiteDatabase database) {
|
||||
public void migrate(SupportSQLiteDatabase database) {
|
||||
database.beginTransaction();
|
||||
try {
|
||||
// Drop old index on datetime only
|
||||
|
@@ -19,7 +19,6 @@ package com.health.openscale.core.datatypes;
|
||||
import android.arch.persistence.room.ColumnInfo;
|
||||
import android.arch.persistence.room.Entity;
|
||||
import android.arch.persistence.room.PrimaryKey;
|
||||
import android.support.annotation.NonNull;
|
||||
|
||||
import com.health.openscale.core.utils.Converters;
|
||||
import com.health.openscale.core.utils.DateTimeHelpers;
|
||||
@@ -39,10 +38,8 @@ public class ScaleUser {
|
||||
@ColumnInfo(name = "bodyHeight")
|
||||
private int bodyHeight;
|
||||
@ColumnInfo(name = "scaleUnit")
|
||||
@NonNull
|
||||
private Converters.WeightUnit scaleUnit;
|
||||
@ColumnInfo(name = "gender")
|
||||
@NonNull
|
||||
private Converters.Gender gender;
|
||||
@ColumnInfo(name = "initialWeight")
|
||||
private float initialWeight;
|
||||
|
Reference in New Issue
Block a user