コード例 #1
0
ファイル: Startup.cs プロジェクト: tecsoft/code-reaction
        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);
        }
コード例 #2
0
ファイル: DbTestHelper.cs プロジェクト: tecsoft/code-reaction
        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();
        }
コード例 #3
0
        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());
            }
        }