Add 'display' DB field for nicer variants display. Remove join on Variants table...
[vchess.git] / server / models / Variant.js
index 20bce4a..f439e19 100644 (file)
@@ -1,25 +1,28 @@
-var db = require("../utils/database");
+const db = require("../utils/database");
 
 /*
  * Structure:
  *   id: integer
  *   name: varchar
+ *   display: varchar
+ *   groupe: integer
  *   description: varchar
+ *   noProblems: boolean
  */
 
-const VariantModel =
-{
-       getAll: function(callback)
-       {
-               db.serialize(function() {
-                       const query =
-                               "SELECT * " +
-                               "FROM Variants";
-                       db.all(query, callback);
-               });
-       },
+const VariantModel = {
 
-       //create, update, delete: directly in DB
-}
+  getAll: function(callback) {
+    db.serialize(function() {
+      const query =
+        "SELECT * " +
+        "FROM Variants";
+      db.all(query, callback);
+    });
+  }
+
+  //create, update, delete: directly in DB
+
+};
 
 module.exports = VariantModel;