diff --git a/app/schemas/net.foucry.pilldroid.databases.MedicineDatabase/1.json b/app/schemas/net.foucry.pilldroid.databases.MedicineDatabase/1.json index 15114b9..8c74d87 100644 --- a/app/schemas/net.foucry.pilldroid.databases.MedicineDatabase/1.json +++ b/app/schemas/net.foucry.pilldroid.databases.MedicineDatabase/1.json @@ -2,17 +2,23 @@ "formatVersion": 1, "database": { "version": 1, - "identityHash": "71fee21ecfa4bc2a534eca55c0f0cd49", + "identityHash": "96dc5c4ccb337047e323d613eb86bdd1", "entities": [ { - "tableName": "medicines", - "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`cis` TEXT NOT NULL, `cip13` TEXT, `cip7` TEXT, `administration_mode` TEXT, `name` TEXT, `presentation` TEXT, `label_group` TEXT, `generic_type` INTEGER, PRIMARY KEY(`cis`))", + "tableName": "drugs", + "createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`_id` INTEGER NOT NULL, `cis` TEXT, `cip13` TEXT, `cip7` TEXT, `administration_mode` TEXT, `name` TEXT, `presentation` TEXT, `label_group` TEXT, `generic_type` INTEGER, PRIMARY KEY(`_id`))", "fields": [ + { + "fieldPath": "_id", + "columnName": "_id", + "affinity": "INTEGER", + "notNull": true + }, { "fieldPath": "cis", "columnName": "cis", "affinity": "TEXT", - "notNull": true + "notNull": false }, { "fieldPath": "cip13", @@ -59,7 +65,7 @@ ], "primaryKey": { "columnNames": [ - "cis" + "_id" ], "autoGenerate": false }, @@ -70,7 +76,7 @@ "views": [], "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, '71fee21ecfa4bc2a534eca55c0f0cd49')" + "INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, '96dc5c4ccb337047e323d613eb86bdd1')" ] } } \ No newline at end of file diff --git a/app/src/main/assets/drugs.db b/app/src/main/assets/drugs.db index 2cc6502..adeb8a2 100644 Binary files a/app/src/main/assets/drugs.db and b/app/src/main/assets/drugs.db differ diff --git a/app/src/main/java/net/foucry/pilldroid/models/Medicine.java b/app/src/main/java/net/foucry/pilldroid/models/Medicine.java index d5ea4e6..1fd10be 100644 --- a/app/src/main/java/net/foucry/pilldroid/models/Medicine.java +++ b/app/src/main/java/net/foucry/pilldroid/models/Medicine.java @@ -4,10 +4,10 @@ import androidx.annotation.NonNull; import androidx.room.Entity; import androidx.room.PrimaryKey; -@Entity(tableName = "medicines") +@Entity(tableName = "drugs") public class Medicine { @PrimaryKey - @NonNull + @NonNull private Integer _id; private String cis; private String cip13; private String cip7; @@ -85,4 +85,13 @@ public class Medicine { public void setGeneric_type(Integer generic_type) { this.generic_type = generic_type; } + + @NonNull + public Integer get_id() { + return _id; + } + + public void set_id(@NonNull Integer _id) { + this._id = _id; + } }