Example #1
0
        public void Configuration(IAppBuilder app)
        {
            SchemaMigration.Execute();

            HttpConfiguration httpConfiguration = new HttpConfiguration();

            ConfigureAuth(app);
            WebApiConfig.Register(httpConfiguration);
            app.UseWebApi(httpConfiguration);

            // Perhaps there's a better place for this call?
            scheduler.Start(new System.Threading.TimerCallback(ImportLatestLogs), 60);
        }
Example #2
0
        public static void ResetDatabase()
        {
            FileInfo dbFile = new FileInfo("../../../Domain/Database/CodeReaction.sqlite");

            if (dbFile.Exists == false)
            {
                throw new FileNotFoundException();
            }

            dbFile.CopyTo("CodeReaction.sqlite", true);

            SchemaMigration.Execute();
        }
        public void MigrateAll()
        {
            using (var db = new DbCodeReview())
            {
                try
                {
                    db.SchemaVersion.Any();

                    Assert.Fail("Schema vesions exist !");
                }
                catch { }
            }

            SchemaMigration.Execute();

            using (var db = new DbCodeReview())
            {
                Assert.AreEqual(Index.Migrations.Keys.Max(), db.SchemaVersion.Max(v => v.Number));
                Assert.AreEqual(Index.Migrations.Count, db.SchemaVersion.Count());
            }
        }