Browse Source

Update roasting_specification table to support additional spec elements. Requires PostgreSQL 9.4 or newer.

Neal Wilson 7 years ago
parent
commit
646fdbf45d
1 changed files with 12 additions and 0 deletions
  1. 12
    0
      config/Windows/navigation.xml

+ 12
- 0
config/Windows/navigation.xml View File

@@ -314,6 +314,14 @@
314 314
 			query.exec("UPDATE TypicaFeatures SET version = 7 WHERE feature = 'base-features'");
315 315
 			query = query.invalidate();
316 316
 		};
317
+        /* Updates for Typica version 1.9 */
318
+        var DBUpdate19 = function() {
319
+            var query = new QSqlQuery;
320
+            query.exec("ALTER TABLE roasting_specification ADD COLUMN spec jsonb");
321
+            query.exec("UPDATE TypicaFeatures SET version = 8 WHERE feature = 'base-features'");
322
+            query = query.invalidate();
323
+        };
324
+        
317 325
 		if(Application.databaseConnected()) {
318 326
 			query = new QSqlQuery();
319 327
 			/* A table keeps track of database versioning information. This
@@ -351,6 +359,9 @@
351 359
 				if(query.value(2) < 7) {
352 360
 					DBUpdate18();
353 361
 				}
362
+                if(query.value(2) < 8) {
363
+                    DBUpdate19();
364
+                }
354 365
 			}
355 366
 			else
356 367
 			{
@@ -362,6 +373,7 @@
362 373
 				DBUpdateReminders();
363 374
 				DBUpdateSpecification();
364 375
 				DBUpdate18();
376
+                DBUpdate19();
365 377
 			}
366 378
 			query.exec("SELECT feature, enabled, version FROM TypicaFeatures WHERE feature = 'sample-roasting'");
367 379
 			if(query.next())

Loading…
Cancel
Save