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
 			query.exec("UPDATE TypicaFeatures SET version = 7 WHERE feature = 'base-features'");
314
 			query.exec("UPDATE TypicaFeatures SET version = 7 WHERE feature = 'base-features'");
315
 			query = query.invalidate();
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
 		if(Application.databaseConnected()) {
325
 		if(Application.databaseConnected()) {
318
 			query = new QSqlQuery();
326
 			query = new QSqlQuery();
319
 			/* A table keeps track of database versioning information. This
327
 			/* A table keeps track of database versioning information. This
351
 				if(query.value(2) < 7) {
359
 				if(query.value(2) < 7) {
352
 					DBUpdate18();
360
 					DBUpdate18();
353
 				}
361
 				}
362
+                if(query.value(2) < 8) {
363
+                    DBUpdate19();
364
+                }
354
 			}
365
 			}
355
 			else
366
 			else
356
 			{
367
 			{
362
 				DBUpdateReminders();
373
 				DBUpdateReminders();
363
 				DBUpdateSpecification();
374
 				DBUpdateSpecification();
364
 				DBUpdate18();
375
 				DBUpdate18();
376
+                DBUpdate19();
365
 			}
377
 			}
366
 			query.exec("SELECT feature, enabled, version FROM TypicaFeatures WHERE feature = 'sample-roasting'");
378
 			query.exec("SELECT feature, enabled, version FROM TypicaFeatures WHERE feature = 'sample-roasting'");
367
 			if(query.next())
379
 			if(query.next())

Loading…
Cancel
Save