[Review] Updated migrations and scripts (#484)

* Update migrations

* Add regex for schema name and product version

* Fix ModelSnapshot product version

* Change version to 2.1.0
This commit is contained in:
Hao Kung 2018-05-03 13:22:26 -07:00 committed by GitHub
parent 99114c25a4
commit 89956df7ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 286 additions and 240 deletions

View File

@ -1,18 +1,64 @@
SET version=2.1.0
echo Make sure to have ran build.cmd once to ensure artifacts have been created. echo Make sure to have ran build.cmd once to ensure artifacts have been created.
echo Generating version=%version%, edit updateMigrations.cmd to update the version.
echo Generating migration for RazorPages-SqlLite--------------
rd "Company.WebApplication1" /s /q rd "Company.WebApplication1" /s /q
mkdir "Company.WebApplication1" mkdir "Company.WebApplication1"
dotnet new razor --auth Individual -i ..\artifacts\build\Microsoft.DotNet.Web.ProjectTemplates.*.nupkg -o Company.WebApplication1 dotnet new razor --auth Individual -i ..\artifacts\build\Microsoft.DotNet.Web.ProjectTemplates.*.nupkg -o Company.WebApplication1
rd "Company.WebApplication1\Data\Migrations" /s /q
cd Company.WebApplication1
dotnet ef migrations add CreateIdentitySchema -o Data\Migrations
cd ..
move Company.WebApplication1\Data\Migrations\*.Designer.cs Company.WebApplication1\Data\Migrations\00000000000000_CreateIdentitySchema.Designer.cs
move Company.WebApplication1\Data\Migrations\*_CreateIdentitySchema.cs Company.WebApplication1\Data\Migrations\00000000000000_CreateIdentitySchema.cs
powershell.exe -command "(Get-Content Company.WebApplication1\Data\Migrations\00000000000000_CreateIdentitySchema.Designer.cs) -replace('([0-9]{14})_CreateIdentitySchema', '00000000000000_CreateIdentitySchema') | Set-Content Company.WebApplication1\Data\Migrations\00000000000000_CreateIdentitySchema.Designer.cs"
powershell.exe -command "(Get-Content Company.WebApplication1\Data\Migrations\00000000000000_CreateIdentitySchema.Designer.cs) -replace('[0-9].[0-9].[0-9]-[^-]*-[0-9]*', '%version%') | Set-Content Company.WebApplication1\Data\Migrations\00000000000000_CreateIdentitySchema.Designer.cs"
powershell.exe -command "(Get-Content Company.WebApplication1\Data\Migrations\ApplicationDbContextModelSnapshot.cs) -replace('[0-9].[0-9].[0-9]-[^-]*-[0-9]*', '%version%') | Set-Content Company.WebApplication1\Data\Migrations\ApplicationDbContextModelSnapshot.cs"
copy "Company.WebApplication1\Data\Migrations\*" "..\src\Microsoft.DotNet.Web.ProjectTemplates\content\RazorPagesWeb-CSharp\Data\SqlLite" copy "Company.WebApplication1\Data\Migrations\*" "..\src\Microsoft.DotNet.Web.ProjectTemplates\content\RazorPagesWeb-CSharp\Data\SqlLite"
echo Generating migration for RazorPages-SqlServer(localb)--------------
rd "Company.WebApplication1" /s /q rd "Company.WebApplication1" /s /q
mkdir "Company.WebApplication1" mkdir "Company.WebApplication1"
dotnet new razor --auth Individual --use-local-db -i ..\artifacts\build\Microsoft.DotNet.Web.ProjectTemplates.*.nupkg -o Company.WebApplication1 dotnet new razor --auth Individual --use-local-db -i ..\artifacts\build\Microsoft.DotNet.Web.ProjectTemplates.*.nupkg -o Company.WebApplication1
rd "Company.WebApplication1\Data\Migrations" /s /q
cd Company.WebApplication1
dotnet ef migrations add CreateIdentitySchema -o Data\Migrations
cd ..
move Company.WebApplication1\Data\Migrations\*.Designer.cs Company.WebApplication1\Data\Migrations\00000000000000_CreateIdentitySchema.Designer.cs
move Company.WebApplication1\Data\Migrations\*_CreateIdentitySchema.cs Company.WebApplication1\Data\Migrations\00000000000000_CreateIdentitySchema.cs
powershell.exe -command "(Get-Content Company.WebApplication1\Data\Migrations\00000000000000_CreateIdentitySchema.Designer.cs) -replace('([0-9]{14})_CreateIdentitySchema', '00000000000000_CreateIdentitySchema') | Set-Content Company.WebApplication1\Data\Migrations\00000000000000_CreateIdentitySchema.Designer.cs"
powershell.exe -command "(Get-Content Company.WebApplication1\Data\Migrations\00000000000000_CreateIdentitySchema.Designer.cs) -replace('[0-9].[0-9].[0-9]-[^-]*-[0-9]*', '%version%') | Set-Content Company.WebApplication1\Data\Migrations\00000000000000_CreateIdentitySchema.Designer.cs"
powershell.exe -command "(Get-Content Company.WebApplication1\Data\Migrations\ApplicationDbContextModelSnapshot.cs) -replace('[0-9].[0-9].[0-9]-[^-]*-[0-9]*', '%version%') | Set-Content Company.WebApplication1\Data\Migrations\ApplicationDbContextModelSnapshot.cs"
copy "Company.WebApplication1\Data\Migrations\*" "..\src\Microsoft.DotNet.Web.ProjectTemplates\content\RazorPagesWeb-CSharp\Data\SqlServer" copy "Company.WebApplication1\Data\Migrations\*" "..\src\Microsoft.DotNet.Web.ProjectTemplates\content\RazorPagesWeb-CSharp\Data\SqlServer"
rd "Company.WebApplication1" /s /q rd "Company.WebApplication1" /s /q
echo Generating migration for StarterWeb-SqlServer(localb)--------------
mkdir "Company.WebApplication1" mkdir "Company.WebApplication1"
dotnet new mvc --auth Individual --use-local-db -i ..\artifacts\build\Microsoft.DotNet.Web.ProjectTemplates.*.nupkg -o Company.WebApplication1 dotnet new mvc --auth Individual --use-local-db -i ..\artifacts\build\Microsoft.DotNet.Web.ProjectTemplates.*.nupkg -o Company.WebApplication1
rd "Company.WebApplication1\Data\Migrations" /s /q
cd Company.WebApplication1
dotnet ef migrations add CreateIdentitySchema -o Data\Migrations
cd ..
move Company.WebApplication1\Data\Migrations\*.Designer.cs Company.WebApplication1\Data\Migrations\00000000000000_CreateIdentitySchema.Designer.cs
move Company.WebApplication1\Data\Migrations\*_CreateIdentitySchema.cs Company.WebApplication1\Data\Migrations\00000000000000_CreateIdentitySchema.cs
powershell.exe -command "(Get-Content Company.WebApplication1\Data\Migrations\00000000000000_CreateIdentitySchema.Designer.cs) -replace('([0-9]{14})_CreateIdentitySchema', '00000000000000_CreateIdentitySchema') | Set-Content Company.WebApplication1\Data\Migrations\00000000000000_CreateIdentitySchema.Designer.cs"
powershell.exe -command "(Get-Content Company.WebApplication1\Data\Migrations\00000000000000_CreateIdentitySchema.Designer.cs) -replace('[0-9].[0-9].[0-9]-[^-]*-[0-9]*', '%version%') | Set-Content Company.WebApplication1\Data\Migrations\00000000000000_CreateIdentitySchema.Designer.cs"
powershell.exe -command "(Get-Content Company.WebApplication1\Data\Migrations\ApplicationDbContextModelSnapshot.cs) -replace('[0-9].[0-9].[0-9]-[^-]*-[0-9]*', '%version%') | Set-Content Company.WebApplication1\Data\Migrations\ApplicationDbContextModelSnapshot.cs"
copy "Company.WebApplication1\Data\Migrations\*" "..\src\Microsoft.DotNet.Web.ProjectTemplates\content\StarterWeb-CSharp\Data\SqlServer" copy "Company.WebApplication1\Data\Migrations\*" "..\src\Microsoft.DotNet.Web.ProjectTemplates\content\StarterWeb-CSharp\Data\SqlServer"
echo Generating migration for StarterWeb-SqlLite--------------
rd "Company.WebApplication1" /s /q rd "Company.WebApplication1" /s /q
mkdir "Company.WebApplication1" mkdir "Company.WebApplication1"
dotnet new mvc --auth Individual -i ..\artifacts\build\Microsoft.DotNet.Web.ProjectTemplates.*.nupkg -o Company.WebApplication1 dotnet new mvc --auth Individual -i ..\artifacts\build\Microsoft.DotNet.Web.ProjectTemplates.*.nupkg -o Company.WebApplication1
rd "Company.WebApplication1\Data\Migrations" /s /q
cd Company.WebApplication1
dotnet ef migrations add CreateIdentitySchema -o Data\Migrations
cd ..
move Company.WebApplication1\Data\Migrations\*.Designer.cs Company.WebApplication1\Data\Migrations\00000000000000_CreateIdentitySchema.Designer.cs
move Company.WebApplication1\Data\Migrations\*_CreateIdentitySchema.cs Company.WebApplication1\Data\Migrations\00000000000000_CreateIdentitySchema.cs
powershell.exe -command "(Get-Content Company.WebApplication1\Data\Migrations\00000000000000_CreateIdentitySchema.Designer.cs) -replace('([0-9]{14})_CreateIdentitySchema', '00000000000000_CreateIdentitySchema') | Set-Content Company.WebApplication1\Data\Migrations\00000000000000_CreateIdentitySchema.Designer.cs"
powershell.exe -command "(Get-Content Company.WebApplication1\Data\Migrations\00000000000000_CreateIdentitySchema.Designer.cs) -replace('[0-9].[0-9].[0-9]-[^-]*-[0-9]*', '%version%') | Set-Content Company.WebApplication1\Data\Migrations\00000000000000_CreateIdentitySchema.Designer.cs"
powershell.exe -command "(Get-Content Company.WebApplication1\Data\Migrations\ApplicationDbContextModelSnapshot.cs) -replace('[0-9].[0-9].[0-9]-[^-]*-[0-9]*', '%version%') | Set-Content Company.WebApplication1\Data\Migrations\ApplicationDbContextModelSnapshot.cs"
copy "Company.WebApplication1\Data\Migrations\*" "..\src\Microsoft.DotNet.Web.ProjectTemplates\content\StarterWeb-CSharp\Data\SqlLite" copy "Company.WebApplication1\Data\Migrations\*" "..\src\Microsoft.DotNet.Web.ProjectTemplates\content\StarterWeb-CSharp\Data\SqlLite"
rd "Company.WebApplication1" /s /q rd "Company.WebApplication1" /s /q

View File

@ -1,8 +1,10 @@
using System; // <auto-generated />
using System;
using Company.WebApplication1.Data;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace Company.WebApplication1.Data.Migrations namespace Company.WebApplication1.Data.Migrations
{ {
@ -14,7 +16,49 @@ namespace Company.WebApplication1.Data.Migrations
{ {
#pragma warning disable 612, 618 #pragma warning disable 612, 618
modelBuilder modelBuilder
.HasAnnotation("ProductVersion", "2.1.0-preview1"); .HasAnnotation("ProductVersion", "2.1.0");
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken();
b.Property<string>("Name")
.HasMaxLength(256);
b.Property<string>("NormalizedName")
.HasMaxLength(256);
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasName("RoleNameIndex");
b.ToTable("AspNetRoles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ClaimType");
b.Property<string>("ClaimValue");
b.Property<string>("RoleId")
.IsRequired();
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
{ {
@ -66,48 +110,6 @@ namespace Company.WebApplication1.Data.Migrations
b.ToTable("AspNetUsers"); b.ToTable("AspNetUsers");
}); });
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken();
b.Property<string>("Name")
.HasMaxLength(256);
b.Property<string>("NormalizedName")
.HasMaxLength(256);
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasName("RoleNameIndex");
b.ToTable("AspNetRoles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ClaimType");
b.Property<string>("ClaimValue");
b.Property<string>("RoleId")
.IsRequired();
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
@ -224,4 +226,4 @@ namespace Company.WebApplication1.Data.Migrations
#pragma warning restore 612, 618 #pragma warning restore 612, 618
} }
} }
} }

View File

@ -1,7 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
namespace Company.WebApplication1.Data.Migrations namespace Company.WebApplication1.Data.Migrations
@ -217,4 +214,4 @@ namespace Company.WebApplication1.Data.Migrations
name: "AspNetUsers"); name: "AspNetUsers");
} }
} }
} }

View File

@ -1,8 +1,9 @@
using System; // <auto-generated />
using System;
using Company.WebApplication1.Data;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Company.WebApplication1.Data.Migrations namespace Company.WebApplication1.Data.Migrations
{ {
@ -13,7 +14,7 @@ namespace Company.WebApplication1.Data.Migrations
{ {
#pragma warning disable 612, 618 #pragma warning disable 612, 618
modelBuilder modelBuilder
.HasAnnotation("ProductVersion", "2.1.0-preview1-28193"); .HasAnnotation("ProductVersion", "2.1.0");
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{ {
@ -220,8 +221,7 @@ namespace Company.WebApplication1.Data.Migrations
.HasForeignKey("UserId") .HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade); .OnDelete(DeleteBehavior.Cascade);
}); });
#pragma warning restore 612, 618 #pragma warning restore 612, 618
} }
} }
} }

View File

@ -1,11 +1,11 @@
using System; // <auto-generated />
using System.Collections.Generic; using System;
using System.Linq; using Company.WebApplication1.Data;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace Company.WebApplication1.Data.Migrations namespace Company.WebApplication1.Data.Migrations
{ {
@ -17,9 +17,54 @@ namespace Company.WebApplication1.Data.Migrations
{ {
#pragma warning disable 612, 618 #pragma warning disable 612, 618
modelBuilder modelBuilder
.HasAnnotation("ProductVersion", "2.1.0-preview1") .HasAnnotation("ProductVersion", "2.1.0")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken();
b.Property<string>("Name")
.HasMaxLength(256);
b.Property<string>("NormalizedName")
.HasMaxLength(256);
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasName("RoleNameIndex")
.HasFilter("[NormalizedName] IS NOT NULL");
b.ToTable("AspNetRoles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("ClaimType");
b.Property<string>("ClaimValue");
b.Property<string>("RoleId")
.IsRequired();
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
{ {
b.Property<string>("Id") b.Property<string>("Id")
@ -71,53 +116,11 @@ namespace Company.WebApplication1.Data.Migrations
b.ToTable("AspNetUsers"); b.ToTable("AspNetUsers");
}); });
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken();
b.Property<string>("Name")
.HasMaxLength(256);
b.Property<string>("NormalizedName")
.HasMaxLength(256);
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasName("RoleNameIndex")
.HasFilter("[NormalizedName] IS NOT NULL");
b.ToTable("AspNetRoles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ClaimType");
b.Property<string>("ClaimValue");
b.Property<string>("RoleId")
.IsRequired();
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd(); .ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("ClaimType"); b.Property<string>("ClaimType");
@ -230,4 +233,4 @@ namespace Company.WebApplication1.Data.Migrations
#pragma warning restore 612, 618 #pragma warning restore 612, 618
} }
} }
} }

View File

@ -1,7 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
@ -220,4 +217,4 @@ namespace Company.WebApplication1.Data.Migrations
name: "AspNetUsers"); name: "AspNetUsers");
} }
} }
} }

View File

@ -1,11 +1,10 @@
using System; // <auto-generated />
using System.Collections.Generic; using System;
using System.Linq; using Company.WebApplication1.Data;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace Company.WebApplication1.Data.Migrations namespace Company.WebApplication1.Data.Migrations
{ {
@ -16,7 +15,8 @@ namespace Company.WebApplication1.Data.Migrations
{ {
#pragma warning disable 612, 618 #pragma warning disable 612, 618
modelBuilder modelBuilder
.HasAnnotation("ProductVersion", "2.1.0-preview1-28193") .HasAnnotation("ProductVersion", "2.1.0")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
@ -46,7 +46,8 @@ namespace Company.WebApplication1.Data.Migrations
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd(); .ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("ClaimType"); b.Property<string>("ClaimType");
@ -116,7 +117,8 @@ namespace Company.WebApplication1.Data.Migrations
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd(); .ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("ClaimType"); b.Property<string>("ClaimType");
@ -226,8 +228,7 @@ namespace Company.WebApplication1.Data.Migrations
.HasForeignKey("UserId") .HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade); .OnDelete(DeleteBehavior.Cascade);
}); });
#pragma warning restore 612, 618 #pragma warning restore 612, 618
} }
} }
} }

View File

@ -1,8 +1,10 @@
using System; // <auto-generated />
using System;
using Company.WebApplication1.Data;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace Company.WebApplication1.Data.Migrations namespace Company.WebApplication1.Data.Migrations
{ {
@ -14,7 +16,49 @@ namespace Company.WebApplication1.Data.Migrations
{ {
#pragma warning disable 612, 618 #pragma warning disable 612, 618
modelBuilder modelBuilder
.HasAnnotation("ProductVersion", "2.1.0-preview1"); .HasAnnotation("ProductVersion", "2.1.0");
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken();
b.Property<string>("Name")
.HasMaxLength(256);
b.Property<string>("NormalizedName")
.HasMaxLength(256);
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasName("RoleNameIndex");
b.ToTable("AspNetRoles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ClaimType");
b.Property<string>("ClaimValue");
b.Property<string>("RoleId")
.IsRequired();
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
{ {
@ -66,48 +110,6 @@ namespace Company.WebApplication1.Data.Migrations
b.ToTable("AspNetUsers"); b.ToTable("AspNetUsers");
}); });
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken();
b.Property<string>("Name")
.HasMaxLength(256);
b.Property<string>("NormalizedName")
.HasMaxLength(256);
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasName("RoleNameIndex");
b.ToTable("AspNetRoles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ClaimType");
b.Property<string>("ClaimValue");
b.Property<string>("RoleId")
.IsRequired();
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
@ -224,4 +226,4 @@ namespace Company.WebApplication1.Data.Migrations
#pragma warning restore 612, 618 #pragma warning restore 612, 618
} }
} }
} }

View File

@ -1,7 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
namespace Company.WebApplication1.Data.Migrations namespace Company.WebApplication1.Data.Migrations
@ -217,4 +214,4 @@ namespace Company.WebApplication1.Data.Migrations
name: "AspNetUsers"); name: "AspNetUsers");
} }
} }
} }

View File

@ -1,8 +1,9 @@
using System; // <auto-generated />
using System;
using Company.WebApplication1.Data;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Microsoft.EntityFrameworkCore.Migrations;
namespace Company.WebApplication1.Data.Migrations namespace Company.WebApplication1.Data.Migrations
{ {
@ -13,7 +14,7 @@ namespace Company.WebApplication1.Data.Migrations
{ {
#pragma warning disable 612, 618 #pragma warning disable 612, 618
modelBuilder modelBuilder
.HasAnnotation("ProductVersion", "2.1.0-preview1-28193"); .HasAnnotation("ProductVersion", "2.1.0");
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{ {
@ -220,8 +221,7 @@ namespace Company.WebApplication1.Data.Migrations
.HasForeignKey("UserId") .HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade); .OnDelete(DeleteBehavior.Cascade);
}); });
#pragma warning restore 612, 618 #pragma warning restore 612, 618
} }
} }
} }

View File

@ -1,11 +1,11 @@
using System; // <auto-generated />
using System.Collections.Generic; using System;
using System.Linq; using Company.WebApplication1.Data;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace Company.WebApplication1.Data.Migrations namespace Company.WebApplication1.Data.Migrations
{ {
@ -17,9 +17,54 @@ namespace Company.WebApplication1.Data.Migrations
{ {
#pragma warning disable 612, 618 #pragma warning disable 612, 618
modelBuilder modelBuilder
.HasAnnotation("ProductVersion", "2.1.0-preview1") .HasAnnotation("ProductVersion", "2.1.0")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken();
b.Property<string>("Name")
.HasMaxLength(256);
b.Property<string>("NormalizedName")
.HasMaxLength(256);
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasName("RoleNameIndex")
.HasFilter("[NormalizedName] IS NOT NULL");
b.ToTable("AspNetRoles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("ClaimType");
b.Property<string>("ClaimValue");
b.Property<string>("RoleId")
.IsRequired();
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
{ {
b.Property<string>("Id") b.Property<string>("Id")
@ -71,53 +116,11 @@ namespace Company.WebApplication1.Data.Migrations
b.ToTable("AspNetUsers"); b.ToTable("AspNetUsers");
}); });
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property<string>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken();
b.Property<string>("Name")
.HasMaxLength(256);
b.Property<string>("NormalizedName")
.HasMaxLength(256);
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
.HasName("RoleNameIndex")
.HasFilter("[NormalizedName] IS NOT NULL");
b.ToTable("AspNetRoles");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ClaimType");
b.Property<string>("ClaimValue");
b.Property<string>("RoleId")
.IsRequired();
b.HasKey("Id");
b.HasIndex("RoleId");
b.ToTable("AspNetRoleClaims");
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd(); .ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("ClaimType"); b.Property<string>("ClaimType");
@ -230,4 +233,4 @@ namespace Company.WebApplication1.Data.Migrations
#pragma warning restore 612, 618 #pragma warning restore 612, 618
} }
} }
} }

View File

@ -1,7 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Migrations;
@ -220,4 +217,4 @@ namespace Company.WebApplication1.Data.Migrations
name: "AspNetUsers"); name: "AspNetUsers");
} }
} }
} }

View File

@ -1,11 +1,10 @@
using System; // <auto-generated />
using System.Collections.Generic; using System;
using System.Linq; using Company.WebApplication1.Data;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace Company.WebApplication1.Data.Migrations namespace Company.WebApplication1.Data.Migrations
{ {
@ -16,7 +15,8 @@ namespace Company.WebApplication1.Data.Migrations
{ {
#pragma warning disable 612, 618 #pragma warning disable 612, 618
modelBuilder modelBuilder
.HasAnnotation("ProductVersion", "2.1.0-preview1-28193") .HasAnnotation("ProductVersion", "2.1.0")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
@ -46,7 +46,8 @@ namespace Company.WebApplication1.Data.Migrations
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd(); .ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("ClaimType"); b.Property<string>("ClaimType");
@ -116,7 +117,8 @@ namespace Company.WebApplication1.Data.Migrations
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b => modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
{ {
b.Property<int>("Id") b.Property<int>("Id")
.ValueGeneratedOnAdd(); .ValueGeneratedOnAdd()
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
b.Property<string>("ClaimType"); b.Property<string>("ClaimType");
@ -226,8 +228,7 @@ namespace Company.WebApplication1.Data.Migrations
.HasForeignKey("UserId") .HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade); .OnDelete(DeleteBehavior.Cascade);
}); });
#pragma warning restore 612, 618 #pragma warning restore 612, 618
} }
} }
} }