Skip to content

Commit

Permalink
Merge pull request #14504 from abpframework/OpenIddict4
Browse files Browse the repository at this point in the history
Upgrade to OpenIddict 4.0 preview.
  • Loading branch information
hikalkan authored Nov 4, 2022
2 parents 42caea5 + cd916da commit f3441b6
Show file tree
Hide file tree
Showing 27 changed files with 3,970 additions and 3,404 deletions.

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 OpenIddict.Demo.Server.Migrations
{
/// <inheritdoc />
public partial class Initial : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
Expand All @@ -29,6 +31,42 @@ protected override void Up(MigrationBuilder migrationBuilder)
table.PrimaryKey("PK_AbpClaimTypes", x => x.Id);
});

migrationBuilder.CreateTable(
name: "AbpFeatureGroups",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
DisplayName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpFeatureGroups", x => x.Id);
});

migrationBuilder.CreateTable(
name: "AbpFeatures",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
GroupName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
ParentName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
DisplayName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false),
Description = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
DefaultValue = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
IsVisibleToClients = table.Column<bool>(type: "bit", nullable: false),
IsAvailableToHost = table.Column<bool>(type: "bit", nullable: false),
AllowedProviders = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
ValueType = table.Column<string>(type: "nvarchar(2048)", maxLength: 2048, nullable: true),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpFeatures", x => x.Id);
});

migrationBuilder.CreateTable(
name: "AbpFeatureValues",
columns: table => new
Expand Down Expand Up @@ -103,6 +141,40 @@ protected override void Up(MigrationBuilder migrationBuilder)
table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id);
});

migrationBuilder.CreateTable(
name: "AbpPermissionGroups",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
DisplayName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpPermissionGroups", x => x.Id);
});

migrationBuilder.CreateTable(
name: "AbpPermissions",
columns: table => new
{
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
GroupName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
ParentName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
DisplayName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: false),
IsEnabled = table.Column<bool>(type: "bit", nullable: false),
MultiTenancySide = table.Column<byte>(type: "tinyint", nullable: false),
Providers = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
StateCheckers = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpPermissions", x => x.Id);
});

migrationBuilder.CreateTable(
name: "AbpRoles",
columns: table => new
Expand Down Expand Up @@ -536,6 +608,23 @@ protected override void Up(MigrationBuilder migrationBuilder)
principalColumn: "Id");
});

migrationBuilder.CreateIndex(
name: "IX_AbpFeatureGroups_Name",
table: "AbpFeatureGroups",
column: "Name",
unique: true);

migrationBuilder.CreateIndex(
name: "IX_AbpFeatures_GroupName",
table: "AbpFeatures",
column: "GroupName");

migrationBuilder.CreateIndex(
name: "IX_AbpFeatures_Name",
table: "AbpFeatures",
column: "Name",
unique: true);

migrationBuilder.CreateIndex(
name: "IX_AbpFeatureValues_Name_ProviderName_ProviderKey",
table: "AbpFeatureValues",
Expand Down Expand Up @@ -572,6 +661,23 @@ protected override void Up(MigrationBuilder migrationBuilder)
unique: true,
filter: "[TenantId] IS NOT NULL");

migrationBuilder.CreateIndex(
name: "IX_AbpPermissionGroups_Name",
table: "AbpPermissionGroups",
column: "Name",
unique: true);

migrationBuilder.CreateIndex(
name: "IX_AbpPermissions_GroupName",
table: "AbpPermissions",
column: "GroupName");

migrationBuilder.CreateIndex(
name: "IX_AbpPermissions_Name",
table: "AbpPermissions",
column: "Name",
unique: true);

migrationBuilder.CreateIndex(
name: "IX_AbpRoleClaims_RoleId",
table: "AbpRoleClaims",
Expand Down Expand Up @@ -685,11 +791,18 @@ protected override void Up(MigrationBuilder migrationBuilder)
column: "ReferenceId");
}

/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AbpClaimTypes");

migrationBuilder.DropTable(
name: "AbpFeatureGroups");

migrationBuilder.DropTable(
name: "AbpFeatures");

migrationBuilder.DropTable(
name: "AbpFeatureValues");

Expand All @@ -702,6 +815,12 @@ protected override void Down(MigrationBuilder migrationBuilder)
migrationBuilder.DropTable(
name: "AbpPermissionGrants");

migrationBuilder.DropTable(
name: "AbpPermissionGroups");

migrationBuilder.DropTable(
name: "AbpPermissions");

migrationBuilder.DropTable(
name: "AbpRoleClaims");

Expand Down
Loading

0 comments on commit f3441b6

Please sign in to comment.