public override void InitializeDatabase(TContext context)
        {
            base.InitializeDatabase(context);

            var dbViewNames = DbViewsInitializationHelper.DeleteTables(context);

            DbViewsInitializationHelper.CreateViews(context.Database, _pathToDirectoryWithSqlScript);
            DbViewsInitializationHelper.ValidateIfAllViewsHaveBeenCreated(context.Database, dbViewNames);
        }
예제 #2
0
        public override void InitializeDatabase(TContext context)
        {
            var dbCompatibleWithModel = context.Database.Exists() && context.Database.CompatibleWithModel(false);

            base.InitializeDatabase(context);

            if (!dbCompatibleWithModel)
            {
                var dbViewNames = DbViewsInitializationHelper.DeleteTables(context);
                DbViewsInitializationHelper.CreateViews(context.Database, _pathToDirectoryWithSqlScript);
                DbViewsInitializationHelper.ValidateIfAllViewsHaveBeenCreated(context.Database, dbViewNames);
            }
        }