Skip to content

Commit

Permalink
Update Migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
VahidN committed Nov 9, 2022
1 parent 83130c1 commit a3767d9
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"request": "launch",
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceRoot}/src/ASPNETCoreIdentitySample/bin/Debug/net6.0/ASPNETCoreIdentitySample.dll",
"program": "${workspaceRoot}/src/ASPNETCoreIdentitySample/bin/Debug/net7.0/ASPNETCoreIdentitySample.dll",
"args": [],
"cwd": "${workspaceRoot}/src/ASPNETCoreIdentitySample",
"stopAtEntry": false,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@

namespace ASPNETCoreIdentitySample.DataLayer.MSSQL.Migrations
{
public partial class V2022_01_29_1755 : Migration
/// <inheritdoc />
public partial class V202211091902 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.EnsureSchema(
Expand Down Expand Up @@ -422,6 +424,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
column: "CategoryId");
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,18 @@ protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "6.0.1")
.HasAnnotation("ProductVersion", "7.0.0")
.HasAnnotation("Relational:MaxIdentifierLength", 128);

SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);

modelBuilder.Entity("ASPNETCoreIdentitySample.Entities.Category", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("int");

SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

b.Property<string>("CreatedByBrowserName")
.HasMaxLength(1000)
Expand Down Expand Up @@ -78,7 +78,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.ValueGeneratedOnAdd()
.HasColumnType("int");

SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

b.Property<string>("FriendlyName")
.HasColumnType("nvarchar(450)");
Expand All @@ -101,7 +101,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.ValueGeneratedOnAdd()
.HasColumnType("int");

SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

b.Property<string>("CreatedByBrowserName")
.HasMaxLength(1000)
Expand Down Expand Up @@ -187,7 +187,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.ValueGeneratedOnAdd()
.HasColumnType("int");

SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
Expand Down Expand Up @@ -248,7 +248,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.ValueGeneratedOnAdd()
.HasColumnType("int");

SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

b.Property<string>("ClaimType")
.HasColumnType("nvarchar(max)");
Expand Down Expand Up @@ -300,7 +300,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.ValueGeneratedOnAdd()
.HasColumnType("int");

SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

b.Property<int>("AccessFailedCount")
.HasColumnType("int");
Expand Down Expand Up @@ -423,7 +423,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.ValueGeneratedOnAdd()
.HasColumnType("int");

SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

b.Property<string>("ClaimType")
.HasColumnType("nvarchar(max)");
Expand Down Expand Up @@ -614,7 +614,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.ValueGeneratedOnAdd()
.HasColumnType("int");

SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

b.Property<string>("CreatedByBrowserName")
.HasMaxLength(1000)
Expand Down Expand Up @@ -665,7 +665,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.ValueGeneratedOnAdd()
.HasColumnType("int");

SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"), 1L, 1);
SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property<int>("Id"));

b.Property<int>("CategoryId")
.HasColumnType("int");
Expand Down Expand Up @@ -704,7 +704,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.HasColumnType("nvarchar(450)");

b.Property<decimal>("Price")
.HasColumnType("decimal(18,6)");
.HasColumnType("decimal(18, 6)");

b.HasKey("Id");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%c_%%a_%%b)
For /f "tokens=1-2 delims=/:" %%a in ("%TIME: =0%") do (set mytime=%%a%%b)
dotnet tool update --global dotnet-ef --version 6.0.9
dotnet tool update --global dotnet-ef --version 7.0.0
dotnet build
dotnet ef migrations --startup-project ../ASPNETCoreIdentitySample/ add V%mydate%_%mytime% --context MsSqlDbContext
pause
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dotnet tool update --global dotnet-ef --version 6.0.9
dotnet tool update --global dotnet-ef --version 7.0.0
dotnet build
dotnet ef --startup-project ../ASPNETCoreIdentitySample/ database update --context MsSqlDbContext
pause

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@

namespace ASPNETCoreIdentitySample.DataLayer.SQLite.Migrations
{
public partial class V2022_01_29_1758 : Migration
/// <inheritdoc />
public partial class V202211091903 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.EnsureSchema(
Expand Down Expand Up @@ -419,6 +421,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
column: "CategoryId");
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
#pragma warning disable 612, 618
modelBuilder
.UseCollation("NOCASE")
.HasAnnotation("ProductVersion", "6.0.1");
.HasAnnotation("ProductVersion", "7.0.0");

modelBuilder.Entity("ASPNETCoreIdentitySample.Entities.Category", b =>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%c_%%a_%%b)
For /f "tokens=1-2 delims=/:" %%a in ("%TIME: =0%") do (set mytime=%%a%%b)
dotnet tool update --global dotnet-ef --version 6.0.9
dotnet tool update --global dotnet-ef --version 7.0.0
dotnet build
dotnet ef migrations --startup-project ../ASPNETCoreIdentitySample/ add V%mydate%_%mytime% --context SQLiteDbContext
pause
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dotnet tool update --global dotnet-ef --version 6.0.9
dotnet tool update --global dotnet-ef --version 7.0.0
dotnet build
dotnet ef --startup-project ../ASPNETCoreIdentitySample/ database update --context SQLiteDbContext
pause
8 changes: 4 additions & 4 deletions src/ASPNETCoreIdentitySample/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@
},
"ConnectionStrings": {
"SqlServer": {
"ApplicationDbContextConnection": "Data Source=(local);Initial Catalog=TestASPNETCore60101IdentityDb;Integrated Security=true"
"ApplicationDbContextConnection": "Data Source=(local);Initial Catalog=TestASPNETCore70100IdentityDb;Integrated Security=true"
},
"LocalDb": {
"InitialCatalog": "TestASPNETCore60101IdentityDb",
"AttachDbFilename": "TestASPNETCore60101IdentityDb.mdf"
"InitialCatalog": "TestASPNETCore70100IdentityDb",
"AttachDbFilename": "TestASPNETCore70100IdentityDb.mdf"
},
"SQLite": {
"ApplicationDbContextConnection": "Data Source=|DataDirectory|\\TestASPNETCore60101IdentityDb.sqlite"
"ApplicationDbContextConnection": "Data Source=|DataDirectory|\\TestASPNETCore70100IdentityDb.sqlite"
}
},
"EnableEmailConfirmation": true,
Expand Down

0 comments on commit a3767d9

Please sign in to comment.