[chronojump] DB:1.30 Added SIMULATED session



commit dca54726440ba713762e206a87e47638fac15ebe
Author: Xavier de Blas <xaviblas gmail com>
Date:   Thu Jul 21 17:12:14 2016 +0200

    DB:1.30 Added SIMULATED session

 src/sqlite/main.cs    |   19 ++++++++++++++++++-
 src/sqlite/session.cs |    8 ++++++++
 2 files changed, 26 insertions(+), 1 deletions(-)
---
diff --git a/src/sqlite/main.cs b/src/sqlite/main.cs
index 8bf9194..a6260ea 100644
--- a/src/sqlite/main.cs
+++ b/src/sqlite/main.cs
@@ -78,7 +78,7 @@ class Sqlite
        /*
         * Important, change this if there's any update to database
         */
-       static string lastChronojumpDatabaseVersion = "1.29";
+       static string lastChronojumpDatabaseVersion = "1.30";
 
        public Sqlite() {
        }
@@ -1882,6 +1882,17 @@ class Sqlite
                                SqlitePreferences.Update ("databaseVersion", newVersion, true); 
                                currentVersion = newVersion;
                        }
+                       if(currentVersion == "1.29") {
+                               LogB.SQL("Added SIMULATED session");
+       
+                               //add SIMULATED session if doesn't exists. Unique session where tests can be 
simulated.
+                               SqliteSession.insertSimulatedSession();
+
+                               newVersion = "1.30";
+                               SqlitePreferences.Update ("databaseVersion", newVersion, true); 
+                               currentVersion = newVersion;
+                       }
+
 
 
                        // --- add more updates here
@@ -1944,6 +1955,10 @@ class Sqlite
                } else {
                        SqliteSession sqliteSessionObject = new SqliteSession();
                        sqliteSessionObject.createTable(Constants.SessionTable);
+                       
+                       //add SIMULATED session if doesn't exists. Unique session where tests can be 
simulated.
+                       SqliteSession.insertSimulatedSession();
+                       
                        SqlitePersonSessionNotUpload.CreateTable();
                        creationRate ++;
                }
@@ -2037,6 +2052,8 @@ class Sqlite
                SqliteExecuteAuto.addChronojumpProfileAndBilateral();
                
                //changes [from - to - desc]
+               //1.29 - 1.30 Converted DB to 1.30 Added SIMULATED session
+               //1.28 - 1.29 Converted DB to 1.29 Changed reaction time rows have reactionTime as default 
value
                //1.27 - 1.28 Converted DB to 1.28 Changed encoderAutoSaveCurve BESTMEANPOWER to BEST
                //1.26 - 1.27 Converted DB to 1.27 Changing runDoubleContactsMS and runIDoubleContactsMS from 
1000ms to 300ms
                //1.25 - 1.26 Converted DB to 1.26 Changed Inclinated to Inclined
diff --git a/src/sqlite/session.cs b/src/sqlite/session.cs
index 88afa2e..c3d3a81 100644
--- a/src/sqlite/session.cs
+++ b/src/sqlite/session.cs
@@ -82,6 +82,14 @@ class SqliteSession : Sqlite
                return myLast;
        }
 
+       protected internal static void insertSimulatedSession()
+       {
+               if(! Sqlite.Exists (true, Constants.SessionTable, "SIMULATED"))
+                       Insert(true, Constants.SessionTable, "-1", "SIMULATED", "", DateTime.Today, 
+                                       Constants.SportUndefinedID, Constants.SpeciallityUndefinedID, 
Constants.LevelUndefinedID,
+                                       Catalog.GetString("Use this session to simulate tests."), 
Constants.ServerUndefinedID);
+       }
+
        public static void Update(int uniqueID, string name, string place, DateTime date, int personsSportID, 
int personsSpeciallityID, int personsPractice, string comments) 
        {
                //TODO: serverUniqueID (but cannot be changed in gui/edit, then not need now)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]