Skip to content

Commit 62ded0c

Browse files
Fix adding / converting new lamps fields to database
1 parent a2899cc commit 62ded0c

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/main/java/me/eccentric_nz/TARDIS/database/TARDISSQLiteDatabase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ public void createTables() {
192192
statement.executeUpdate(queryJunk);
193193

194194
// Table structure for table 'lamps'
195-
String queryLamps = "CREATE TABLE IF NOT EXISTS " + prefix + "lamps (l_id INTEGER PRIMARY KEY NOT NULL, tardis_id INTEGER, location TEXT COLLATE NOCASE DEFAULT '')";
195+
String queryLamps = "CREATE TABLE IF NOT EXISTS " + prefix + "lamps (l_id INTEGER PRIMARY KEY NOT NULL, tardis_id INTEGER, location TEXT COLLATE NOCASE DEFAULT '', material_on TEXT DEFAULT '', material_off, percentage REAL DEFAULT 1.0)";
196196
statement.executeUpdate(queryLamps);
197197

198198
// Table structure for table 'light_prefs'

src/main/java/me/eccentric_nz/TARDIS/database/tool/Converter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ public void run() {
234234
sb.append(str);
235235
}
236236
case lamps -> {
237-
str = String.format(SQL.VALUES.get(i), rs.getInt("l_id"), rs.getInt("tardis_id"), rs.getString("location")) + end;
237+
str = String.format(SQL.VALUES.get(i), rs.getInt("l_id"), rs.getInt("tardis_id"), rs.getString("location"), rs.getString("material_on"), rs.getString("material_off"), rs.getFloat("percentage")) + end;
238238
sb.append(str);
239239
}
240240
case light_prefs -> {

src/main/java/me/eccentric_nz/TARDIS/database/tool/Main.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ public static void process(PrintWriter console, File sqlite, File mysql, String
271271
bw.write(str);
272272
}
273273
case lamps -> {
274-
str = String.format(SQL.VALUES.get(i), rs.getInt("l_id"), rs.getInt("tardis_id"), rs.getString("location")) + end;
274+
str = String.format(SQL.VALUES.get(i), rs.getInt("l_id"), rs.getInt("tardis_id"), rs.getString("location"), rs.getString("material_on"), rs.getString("material_off"), rs.getFloat("percentage")) + end;
275275
bw.write(str);
276276
}
277277
case light_prefs -> {

src/main/java/me/eccentric_nz/TARDIS/database/tool/SQL.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ public class SQL {
241241

242242
"(%s, '%s', %s, '%s', '%s', '%s', '%s', '%s')",
243243

244-
"(%s, %s, '%s', '%s', %s, %s)",
244+
"(%s, %s, '%s', '%s', '%s', %s)",
245245

246246
"(%s, %s, '%s', '%s', '%s', '%s', '%s')",
247247

0 commit comments

Comments
 (0)