Unverified Commit f155c993 authored by Mathieu Féry (Mathius)'s avatar Mathieu Féry (Mathius)
Browse files

Save new name property inside db for favs

parent 1e342137
Pipeline #28832 failed with stages
in 55 seconds
......@@ -81,11 +81,12 @@ public class DnDSheetDB extends BaseDB {
public static final String CLASS = "class";
public static final String SAVES_ID = "saves_id";
public static final String ATTRS = "attrs";
public static final String NAME = "name";
}
static {
PRIMARY_KEY = Vars._ID;
TABLE_NAME = Vars.TABLE_NAME;
DATABASE_VERSION = 5;
DATABASE_VERSION = 7;
DATABASE_NAME = TABLE_NAME;
List<String> tempInt = new ArrayList<>();
tempInt.add(Vars.HP);
......@@ -108,6 +109,7 @@ public class DnDSheetDB extends BaseDB {
tempString.add(Vars.PERSONALITY);
tempString.add(Vars.GIF_ID);
tempString.add(Vars.CLASS);
tempString.add(Vars.NAME);
stringAttrs = tempString;
List<String> tempAllString = new ArrayList<>();
tempAllString.addAll(stringAttrs);
......@@ -217,7 +219,8 @@ public class DnDSheetDB extends BaseDB {
langs, equips, notes, spells,
new DnDSavesDB(ctx, currentVersion).getDnDSaves(cursor.getInt(cursor.getColumnIndex(
Vars.SAVES_ID))),
new DnDAttrs(attrs), new DnDSkills(skills), gif
new DnDAttrs(attrs), new DnDSkills(skills), gif,
cursor.getString(cursor.getColumnIndex(Vars.NAME))
);
}
......@@ -287,6 +290,7 @@ public class DnDSheetDB extends BaseDB {
new GIFArtifactDB(ctx, currentVersion).insertGIFArtifact(sheet.getGIF().artifact);
values.put(Vars.SAVES_ID, sheet.saves.hashCode());
new DnDSavesDB(ctx, currentVersion).insertDnDSaves(sheet.saves);
values.put(Vars.NAME, sheet.name);
values.put(Vars._ID, sheet.hashCode());
SQLiteDatabase db = this.getWritableDatabase();
db.insert(tableName(), null, values);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment