Skip to content

Commit b12094d

Browse files
VCST-1592: Update OpenIddict (#2842)
1 parent a314abb commit b12094d

File tree

12 files changed

+2381
-18
lines changed

12 files changed

+2381
-18
lines changed

src/VirtoCommerce.Platform.Data.MySql/Migrations/Security/20241003120247_UpdateOpenIddict.Designer.cs

+701
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
using Microsoft.EntityFrameworkCore.Metadata;
2+
using Microsoft.EntityFrameworkCore.Migrations;
3+
4+
#nullable disable
5+
6+
namespace VirtoCommerce.Platform.Data.MySql.Migrations.Security
7+
{
8+
/// <inheritdoc />
9+
public partial class UpdateOpenIddict : Migration
10+
{
11+
/// <inheritdoc />
12+
protected override void Up(MigrationBuilder migrationBuilder)
13+
{
14+
migrationBuilder.RenameColumn(
15+
name: "Type",
16+
table: "OpenIddictApplications",
17+
newName: "ClientType");
18+
19+
migrationBuilder.AddColumn<string>(
20+
name: "ApplicationType",
21+
table: "OpenIddictApplications",
22+
type: "varchar(50)",
23+
maxLength: 50,
24+
nullable: true)
25+
.Annotation("MySql:CharSet", "utf8mb4");
26+
27+
migrationBuilder.AddColumn<string>(
28+
name: "JsonWebKeySet",
29+
table: "OpenIddictApplications",
30+
type: "longtext",
31+
nullable: true)
32+
.Annotation("MySql:CharSet", "utf8mb4");
33+
34+
migrationBuilder.AddColumn<string>(
35+
name: "Settings",
36+
table: "OpenIddictApplications",
37+
type: "longtext",
38+
nullable: true)
39+
.Annotation("MySql:CharSet", "utf8mb4");
40+
41+
migrationBuilder.AlterColumn<int>(
42+
name: "Id",
43+
table: "AspNetUserClaims",
44+
type: "int",
45+
nullable: false,
46+
oldClrType: typeof(int),
47+
oldType: "int")
48+
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
49+
50+
migrationBuilder.AlterColumn<int>(
51+
name: "Id",
52+
table: "AspNetRoleClaims",
53+
type: "int",
54+
nullable: false,
55+
oldClrType: typeof(int),
56+
oldType: "int")
57+
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
58+
}
59+
60+
/// <inheritdoc />
61+
protected override void Down(MigrationBuilder migrationBuilder)
62+
{
63+
migrationBuilder.DropColumn(
64+
name: "ApplicationType",
65+
table: "OpenIddictApplications");
66+
67+
migrationBuilder.DropColumn(
68+
name: "JsonWebKeySet",
69+
table: "OpenIddictApplications");
70+
71+
migrationBuilder.DropColumn(
72+
name: "Settings",
73+
table: "OpenIddictApplications");
74+
75+
migrationBuilder.RenameColumn(
76+
name: "ClientType",
77+
table: "OpenIddictApplications",
78+
newName: "Type");
79+
80+
migrationBuilder.AlterColumn<int>(
81+
name: "Id",
82+
table: "AspNetUserClaims",
83+
type: "int",
84+
nullable: false,
85+
oldClrType: typeof(int),
86+
oldType: "int")
87+
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
88+
89+
migrationBuilder.AlterColumn<int>(
90+
name: "Id",
91+
table: "AspNetRoleClaims",
92+
type: "int",
93+
nullable: false,
94+
oldClrType: typeof(int),
95+
oldType: "int")
96+
.OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
97+
}
98+
}
99+
}

src/VirtoCommerce.Platform.Data.MySql/Migrations/Security/SecurityDbContextModelSnapshot.cs

+21-4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System;
33
using Microsoft.EntityFrameworkCore;
44
using Microsoft.EntityFrameworkCore.Infrastructure;
5+
using Microsoft.EntityFrameworkCore.Metadata;
56
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
67
using VirtoCommerce.Platform.Security.Repositories;
78

@@ -16,15 +17,19 @@ protected override void BuildModel(ModelBuilder modelBuilder)
1617
{
1718
#pragma warning disable 612, 618
1819
modelBuilder
19-
.HasAnnotation("ProductVersion", "6.0.13")
20+
.HasAnnotation("ProductVersion", "8.0.8")
2021
.HasAnnotation("Relational:MaxIdentifierLength", 64);
2122

23+
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
24+
2225
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
2326
{
2427
b.Property<int>("Id")
2528
.ValueGeneratedOnAdd()
2629
.HasColumnType("int");
2730

31+
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
32+
2833
b.Property<string>("ClaimType")
2934
.HasColumnType("longtext");
3035

@@ -49,6 +54,8 @@ protected override void BuildModel(ModelBuilder modelBuilder)
4954
.ValueGeneratedOnAdd()
5055
.HasColumnType("int");
5156

57+
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<int>("Id"));
58+
5259
b.Property<string>("ClaimType")
5360
.HasColumnType("longtext");
5461

@@ -135,13 +142,21 @@ protected override void BuildModel(ModelBuilder modelBuilder)
135142
.ValueGeneratedOnAdd()
136143
.HasColumnType("varchar(95)");
137144

145+
b.Property<string>("ApplicationType")
146+
.HasMaxLength(50)
147+
.HasColumnType("varchar(50)");
148+
138149
b.Property<string>("ClientId")
139150
.HasMaxLength(100)
140151
.HasColumnType("varchar(100)");
141152

142153
b.Property<string>("ClientSecret")
143154
.HasColumnType("longtext");
144155

156+
b.Property<string>("ClientType")
157+
.HasMaxLength(50)
158+
.HasColumnType("varchar(50)");
159+
145160
b.Property<string>("ConcurrencyToken")
146161
.IsConcurrencyToken()
147162
.HasMaxLength(50)
@@ -157,6 +172,9 @@ protected override void BuildModel(ModelBuilder modelBuilder)
157172
b.Property<string>("DisplayNames")
158173
.HasColumnType("longtext");
159174

175+
b.Property<string>("JsonWebKeySet")
176+
.HasColumnType("longtext");
177+
160178
b.Property<string>("Permissions")
161179
.HasColumnType("longtext");
162180

@@ -172,9 +190,8 @@ protected override void BuildModel(ModelBuilder modelBuilder)
172190
b.Property<string>("Requirements")
173191
.HasColumnType("longtext");
174192

175-
b.Property<string>("Type")
176-
.HasMaxLength(50)
177-
.HasColumnType("varchar(50)");
193+
b.Property<string>("Settings")
194+
.HasColumnType("longtext");
178195

179196
b.HasKey("Id");
180197

0 commit comments

Comments
 (0)