Bladeren bron

List affected columns on INSERT operations

Neal Wilson 10 jaren geleden
bovenliggende
commit
30a56fe90a
3 gewijzigde bestanden met toevoegingen van 4 en 4 verwijderingen
  1. 1
    1
      config/Windows/greeninventory.xml
  2. 1
    1
      config/Windows/greensales.xml
  3. 2
    2
      config/Windows/importprofiles.xml

+ 1
- 1
config/Windows/greeninventory.xml Bestand weergeven

@@ -40,7 +40,7 @@
40 40
 			var button = findChildObject(this, 'update');
41 41
 			var value = findChildObject(this, 'quantity');
42 42
 			button.clicked.connect(function() {
43
-				q = "INSERT INTO inventory VALUES ('now', ";
43
+				q = "INSERT INTO inventory (time, item, quantity) VALUES ('now', ";
44 44
 				q = q + items.currentData();
45 45
 				q = q + ", ";
46 46
 				if(units.currentText == "lb") {

+ 1
- 1
config/Windows/greensales.xml Bestand weergeven

@@ -53,7 +53,7 @@
53 53
 			var submit = findChildObject(this, 'submit');
54 54
 			submit.clicked.connect(function() {
55 55
 				var query = new QSqlQuery();
56
-				query.prepare("INSERT INTO sale VALUES(:time, :item, :quantity, :customer)");
56
+				query.prepare("INSERT INTO sale (time, item, quantity, customer) VALUES(:time, :item, :quantity, :customer)");
57 57
 				query.bind(":time", dateField.text);
58 58
 				if(customerField.text == "") {
59 59
 					query.bind(":customer", null);

+ 2
- 2
config/Windows/importprofiles.xml Bestand weergeven

@@ -13,7 +13,7 @@
13 13
             var filename = QFileDialog.getOpenFileName(win, 'Open Log…', QSettings.value('script/lastDir', '') + '/');
14 14
             if(filename != '') {
15 15
                 QSettings.setValue("script/lastDir", dir(filename));
16
-                var q = "INSERT INTO files VALUES(default, :name, 'profile', NULL, :data) RETURNING id";
16
+                var q = "INSERT INTO files (id, name, type, note, file) VALUES(default, :name, 'profile', NULL, :data) RETURNING id";
17 17
                 query = new QSqlQuery();
18 18
                 query.prepare(q);
19 19
                 query.bind(":name", baseName(filename));
@@ -22,7 +22,7 @@
22 22
                 query.next();
23 23
                 var fileno = query.value(0);
24 24
                 var id = box.currentData();
25
-                q = "INSERT INTO item_files VALUES('now', ";
25
+                q = "INSERT INTO item_files (time, item, files) VALUES('now', ";
26 26
                 q = q + id;
27 27
                 q = q + ", '{";
28 28
                 q = q + fileno;

Laden…
Annuleren
Opslaan