Skip to content

Commit edaf72c

Browse files
authored
Add update migrations script (#376)
1 parent 7f00516 commit edaf72c

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

migrations/updateMigrations.cmd

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
echo Make sure to have ran build.cmd once to ensure artifacts have been created.
2+
rd "Company.WebApplication1" /s /q
3+
mkdir "Company.WebApplication1"
4+
dotnet new razor --auth Individual -i ..\artifacts\build\Microsoft.DotNet.Web.ProjectTemplates.*.nupkg -o Company.WebApplication1
5+
copy "Company.WebApplication1\Data\Migrations\*" "..\src\Microsoft.DotNet.Web.ProjectTemplates\content\RazorPagesWeb-CSharp\Data\SqlLite"
6+
rd "Company.WebApplication1" /s /q
7+
mkdir "Company.WebApplication1"
8+
dotnet new razor --auth Individual --use-local-db -i ..\artifacts\build\Microsoft.DotNet.Web.ProjectTemplates.*.nupkg -o Company.WebApplication1
9+
copy "Company.WebApplication1\Data\Migrations\*" "..\src\Microsoft.DotNet.Web.ProjectTemplates\content\RazorPagesWeb-CSharp\Data\SqlServer"
10+
rd "Company.WebApplication1" /s /q
11+
mkdir "Company.WebApplication1"
12+
dotnet new mvc --auth Individual --use-local-db -i ..\artifacts\build\Microsoft.DotNet.Web.ProjectTemplates.*.nupkg -o Company.WebApplication1
13+
copy "Company.WebApplication1\Data\Migrations\*" "..\src\Microsoft.DotNet.Web.ProjectTemplates\content\StarterWeb-CSharp\Data\SqlServer"
14+
rd "Company.WebApplication1" /s /q
15+
mkdir "Company.WebApplication1"
16+
dotnet new mvc --auth Individual -i ..\artifacts\build\Microsoft.DotNet.Web.ProjectTemplates.*.nupkg -o Company.WebApplication1
17+
copy "Company.WebApplication1\Data\Migrations\*" "..\src\Microsoft.DotNet.Web.ProjectTemplates\content\StarterWeb-CSharp\Data\SqlLite"
18+
rd "Company.WebApplication1" /s /q

test/Templates.Test/Helpers/TemplateTestBase.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ protected void AssertDirectoryExists(string path, bool shouldExist)
107107
}
108108
}
109109

110+
// If this fails, you should generate new migrations via migrations/updateMigrations.cmd
110111
protected void AssertEmptyMigration(string migration)
111112
{
112113
var fullPath = Path.Combine(TemplateOutputDir, "Data/Migrations");

0 commit comments

Comments
 (0)