[Quantproject-developers] QuantProject/b2_DataAccess DataBaseVersionManager.cs,1.2,1.3
Brought to you by:
glauco_1
|
From: <gla...@us...> - 2004-01-03 19:01:47
|
Update of /cvsroot/quantproject/QuantProject/b2_DataAccess
In directory sc8-pr-cvs1:/tmp/cvs-serv27816/b2_DataAccess
Modified Files:
DataBaseVersionManager.cs
Log Message:
Added the method to update the database to version 2
Index: DataBaseVersionManager.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b2_DataAccess/DataBaseVersionManager.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** DataBaseVersionManager.cs 3 Jan 2004 16:20:37 -0000 1.2
--- DataBaseVersionManager.cs 3 Jan 2004 19:01:43 -0000 1.3
***************
*** 70,74 ****
//this.updatingMethods.Add(yourVersionNumber,
// new updatingMethodHandler(this.yourMethodName))
!
}
public DataBaseVersionManager(OleDbConnection oleDbConnection)
--- 70,74 ----
//this.updatingMethods.Add(yourVersionNumber,
// new updatingMethodHandler(this.yourMethodName))
! this.updatingMethods.Add( 2 , new updatingMethodHandler(this.updateToVersion2) );
}
public DataBaseVersionManager(OleDbConnection oleDbConnection)
***************
*** 95,98 ****
--- 95,111 ----
#endregion
+
+ #region "updating methods"
+ private void updateToVersion2()
+ {
+ string command =
+ "create table validatedTickers " +
+ "( vtTicker TEXT(8) , vtStartDate DATETIME , vtEndDate DATETIME , vtDate DATETIME, " +
+ "CONSTRAINT myKey PRIMARY KEY ( vtTicker ) )";
+ OleDbCommand oleDbCommand = new OleDbCommand( command , this.oleDbConnection );
+ oleDbCommand.ExecuteNonQuery();
+ }
+ #endregion
+
#region "UpdateDataBaseStructure"
private int getDataBaseVersionNumber()
|