[chronojump] DB: 2.16: Created table lastJumpSimpleTypeParams



commit b29a99f7b915867ba50a6c6e4293c4e5d188d4eb
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Apr 9 17:21:01 2021 +0200

    DB: 2.16: Created table lastJumpSimpleTypeParams

 src/sqlite/jumpType.cs | 17 +++++++++++++++++
 src/sqlite/main.cs     | 12 +++++++++++-
 2 files changed, 28 insertions(+), 1 deletion(-)
---
diff --git a/src/sqlite/jumpType.cs b/src/sqlite/jumpType.cs
index 0e21a735..c13ca5cb 100644
--- a/src/sqlite/jumpType.cs
+++ b/src/sqlite/jumpType.cs
@@ -650,4 +650,21 @@ class SqliteJumpType : Sqlite
                        Sqlite.Close();
        }
 
+       // **************************
+       // **** lastJumpTypeParams **
+       // **************************
+       //for store default params of each jump (simple)
+       //note name is on jumpType table but rest of params are related to jump table
+       protected internal static void createTableLastJumpSimpleTypeParams()
+       {
+               dbcmd.CommandText =
+                       "CREATE TABLE " + Constants.LastJumpSimpleTypeParamsTable + " ( " +
+                       "uniqueID INTEGER PRIMARY KEY, " + //to order if there are more than one by import 
problems
+                       "name TEXT, " +
+                       "weightIsPercent INT, " + //it is a boolean
+                       "weightValue FLOAT, " + //decimal is point
+                       "fallmm INT)"; //-1: start in; >=0: falling height in mm (to be int, can be 0 like 
int he gui can be 0)
+               dbcmd.ExecuteNonQuery();
+       }
+
 }      
diff --git a/src/sqlite/main.cs b/src/sqlite/main.cs
index 8ca30c86..ca2a9dce 100644
--- a/src/sqlite/main.cs
+++ b/src/sqlite/main.cs
@@ -129,7 +129,7 @@ class Sqlite
        /*
         * Important, change this if there's any update to database
         */
-       static string lastChronojumpDatabaseVersion = "2.15";
+       static string lastChronojumpDatabaseVersion = "2.16";
 
        public Sqlite()
        {
@@ -2911,6 +2911,14 @@ class Sqlite
 
                                currentVersion = updateVersion("2.15");
                        }
+                       if(currentVersion == "2.15")
+                       {
+                               LogB.SQL("Created table lastJumpSimpleTypeParams");
+
+                               SqliteJumpType.createTableLastJumpSimpleTypeParams();
+
+                               currentVersion = updateVersion("2.16");
+                       }
 
 
 
@@ -3036,6 +3044,7 @@ class Sqlite
                SqliteJumpType.createTableJumpRjType();
                SqliteJumpType.initializeTableJumpType();
                SqliteJumpType.initializeTableJumpRjType();
+               SqliteJumpType.createTableLastJumpSimpleTypeParams();
                
                //runs
                creationRate ++;
@@ -3132,6 +3141,7 @@ class Sqlite
 //just testing: 1.79 - 1.80 Converted DB to 1.80 Created table ForceSensorElasticBandGlue and moved 
stiffnessString records there
 
 
+               //2.15 - 2.16 Converted DB to 2.16 Created table lastJumpSimpleTypeParams
                //2.14 - 2.15 Converted DB to 2.15 Inserted into preferences: SessionLoadDisplay
                //2.13 - 2.14 Converted DB to 2.14 Doing alter table run, runInterval, tempRunInterval add 
datetime
                //2.12 - 2.13 Converted DB to 2.13 Inserted prefs: PersonSelectWinImages, ExportGraphWidth, 
ExportGraphHeight


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