Example #1
0
        private static async Task FullInstallation()
        {
            // Remove previous (unversioned) versions of the database, if any
            if (await FileOperations.CheckFile(FileNaming.DatabasePath))
            {
                UserLog.Add(LogStrings.DatabaseMigrationReset);

                Log.Debug("Deleting old database: bye bye existing data");
                Log.Event("Database.reset");
                var token = await FileOperations.GetToken(FileNaming.DatabasePath);

                await token.Delete();
            }

            // Database creation
            using (var db = OpenConnection()) {
                db.CreateTable <TrackUploadRecord>();
                db.CreateTable <StatisticRecord>();
            }

            Log.Event("Database.create");
        }