예제 #1
0
파일: Utilities.cs 프로젝트: p3s/craftsman
        private static bool RunDbMigration(ApiTemplate template, string srcDirectory)
        {
            var webApiProjectClassPath = ClassPathHelper.WebApiProjectClassPath(srcDirectory, template.ProjectName);

            return(ExecuteProcess(
                       "dotnet",
                       @$ "ef migrations add " "InitialMigration" " --project " "{webApiProjectClassPath.FullClassPath}" "",
                       srcDirectory,
                       new Dictionary <string, string>()
            {
                { "ASPNETCORE_ENVIRONMENT", Guid.NewGuid().ToString() }     // guid to not conflict with any given envs
            },
                       20000,
                       $"{Emoji.Known.Warning} {template.ProjectName} Database Migrations timed out and will need to be run manually"));
        }
예제 #2
0
        private static void RunDbMigration(ApiTemplate template, string srcDirectory)
        {
            var webApiProjectClassPath = ClassPathHelper.WebApiProjectClassPath(srcDirectory, template.SolutionName);
            var infraProjectClassPath  = ClassPathHelper.InfrastructureProjectClassPath(srcDirectory, template.SolutionName);

            Utilities.ExecuteProcess(
                "dotnet",
                @$ "ef migrations add " "InitialMigration" " --project " "{infraProjectClassPath.FullClassPath}" " --startup-project " "{webApiProjectClassPath.FullClassPath}" " --output-dir Migrations",
                srcDirectory,
                new Dictionary <string, string>()
            {
                { "ASPNETCORE_ENVIRONMENT", Guid.NewGuid().ToString() }     // guid to not conflict with any given envs
            },
                20000,
                "Db Migrations timed out and will need to be run manually.");
        }