Example #1
0
 protected override void PerformUpgrade(string sourceLocation, string targetLocation)
 {
     try
     {
         string query = string.Format(upgradeQuery, sourceLocation, logDatabaseLocation);
         using (var databaseFile = new ProjectDatabaseFile(targetLocation))
         {
             databaseFile.OpenDatabaseConnection();
             databaseFile.ExecuteQuery(query);
         }
     }
     catch (SQLiteException exception)
     {
         throw new CriticalMigrationException(string.Format(Resources.ProjectUpgradeScript_Upgrading_Version_0_To_Version_1_Failed,
                                                            FromVersion(), ToVersion()), exception);
     }
 }
Example #2
0
        protected override IVersionedFile GetEmptyVersionedFile(string location)
        {
            try
            {
                using (var databaseFile = new ProjectDatabaseFile(location))
                {
                    databaseFile.OpenDatabaseConnection();
                    databaseFile.ExecuteQuery(createQuery);
                }

                return(new ProjectVersionedFile(location));
            }
            catch (SQLiteException exception)
            {
                throw new CriticalMigrationException(string.Format(Resources.ProjectCreateScript_Creating_Version_0_Failed,
                                                                   GetVersion()), exception);
            }
        }