Revised module references for the service template. Fixed #872.

pull/900/head
Halil ibrahim Kalkan 7 years ago
parent 4207445845
commit 511718cfe7

@ -1,7 +1,10 @@
using Microsoft.EntityFrameworkCore;
using Volo.Abp.AuditLogging.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.Identity.EntityFrameworkCore;
using Volo.Abp.IdentityServer.EntityFrameworkCore;
using Volo.Abp.PermissionManagement.EntityFrameworkCore;
using Volo.Abp.SettingManagement.EntityFrameworkCore;
namespace IdentityServerHost
{
@ -17,6 +20,9 @@ namespace IdentityServerHost
{
base.OnModelCreating(modelBuilder);
modelBuilder.ConfigurePermissionManagement();
modelBuilder.ConfigureSettingManagement();
modelBuilder.ConfigureAuditLogging();
modelBuilder.ConfigureIdentity();
modelBuilder.ConfigureIdentityServer();
}

@ -17,6 +17,9 @@
<ProjectReference Include="..\..\..\..\modules\identityserver\src\Volo.Abp.IdentityServer.EntityFrameworkCore\Volo.Abp.IdentityServer.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.EntityFrameworkCore\Volo.Abp.Identity.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.AspNetCore\Volo.Abp.Identity.AspNetCore.csproj" />
<ProjectReference Include="..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.EntityFrameworkCore\Volo.Abp.PermissionManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\modules\setting-management\src\Volo.Abp.SettingManagement.EntityFrameworkCore\Volo.Abp.SettingManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\modules\audit-logging\src\Volo.Abp.AuditLogging.EntityFrameworkCore\Volo.Abp.AuditLogging.EntityFrameworkCore.csproj" />
</ItemGroup>
<ItemGroup>
@ -26,9 +29,4 @@
<None Remove="Logs\**" />
</ItemGroup>
<ItemGroup>
<Compile Remove="Migrations\20181212121034_Initial.cs" />
<Compile Remove="Migrations\20181218135354_Initial.cs" />
</ItemGroup>
</Project>

@ -10,7 +10,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace IdentityServerHost.Migrations
{
[DbContext(typeof(DemoAppDbContext))]
[Migration("20190107114341_Initial")]
[Migration("20190320142333_Initial")]
partial class Initial
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
@ -21,6 +21,202 @@ namespace IdentityServerHost.Migrations
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ApplicationName")
.HasColumnName("ApplicationName")
.HasMaxLength(96);
b.Property<string>("BrowserInfo")
.HasColumnName("BrowserInfo")
.HasMaxLength(512);
b.Property<string>("ClientId")
.HasColumnName("ClientId")
.HasMaxLength(64);
b.Property<string>("ClientIpAddress")
.HasColumnName("ClientIpAddress")
.HasMaxLength(64);
b.Property<string>("ClientName")
.HasColumnName("ClientName")
.HasMaxLength(128);
b.Property<string>("Comments")
.HasColumnName("Comments")
.HasMaxLength(256);
b.Property<string>("ConcurrencyStamp");
b.Property<string>("CorrelationId")
.HasColumnName("CorrelationId")
.HasMaxLength(64);
b.Property<string>("Exceptions")
.HasColumnName("Exceptions")
.HasMaxLength(4000);
b.Property<int>("ExecutionDuration")
.HasColumnName("ExecutionDuration");
b.Property<DateTime>("ExecutionTime");
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties");
b.Property<string>("HttpMethod")
.HasColumnName("HttpMethod")
.HasMaxLength(16);
b.Property<int?>("HttpStatusCode")
.HasColumnName("HttpStatusCode");
b.Property<Guid?>("ImpersonatorTenantId")
.HasColumnName("ImpersonatorTenantId");
b.Property<Guid?>("ImpersonatorUserId")
.HasColumnName("ImpersonatorUserId");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId");
b.Property<string>("Url")
.HasColumnName("Url")
.HasMaxLength(256);
b.Property<Guid?>("UserId")
.HasColumnName("UserId");
b.Property<string>("UserName")
.HasColumnName("UserName")
.HasMaxLength(256);
b.HasKey("Id");
b.HasIndex("TenantId", "ExecutionTime");
b.HasIndex("TenantId", "UserId", "ExecutionTime");
b.ToTable("AbpAuditLogs");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<Guid>("AuditLogId")
.HasColumnName("AuditLogId");
b.Property<int>("ExecutionDuration")
.HasColumnName("ExecutionDuration");
b.Property<DateTime>("ExecutionTime")
.HasColumnName("ExecutionTime");
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties");
b.Property<string>("MethodName")
.HasColumnName("MethodName")
.HasMaxLength(128);
b.Property<string>("Parameters")
.HasColumnName("Parameters")
.HasMaxLength(2000);
b.Property<string>("ServiceName")
.HasColumnName("ServiceName")
.HasMaxLength(256);
b.Property<Guid?>("TenantId");
b.HasKey("Id");
b.HasIndex("AuditLogId");
b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime");
b.ToTable("AbpAuditLogActions");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<Guid>("AuditLogId")
.HasColumnName("AuditLogId");
b.Property<DateTime>("ChangeTime")
.HasColumnName("ChangeTime");
b.Property<byte>("ChangeType")
.HasColumnName("ChangeType");
b.Property<string>("EntityId")
.IsRequired()
.HasColumnName("EntityId")
.HasMaxLength(128);
b.Property<string>("EntityTypeFullName")
.IsRequired()
.HasColumnName("EntityTypeFullName")
.HasMaxLength(128);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId");
b.HasKey("Id");
b.HasIndex("AuditLogId");
b.HasIndex("TenantId", "EntityTypeFullName", "EntityId");
b.ToTable("AbpEntityChanges");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<Guid>("EntityChangeId");
b.Property<string>("NewValue")
.HasColumnName("NewValue")
.HasMaxLength(512);
b.Property<string>("OriginalValue")
.HasColumnName("OriginalValue")
.HasMaxLength(512);
b.Property<string>("PropertyName")
.IsRequired()
.HasColumnName("PropertyName")
.HasMaxLength(128);
b.Property<string>("PropertyTypeFullName")
.IsRequired()
.HasColumnName("PropertyTypeFullName")
.HasMaxLength(64);
b.Property<Guid?>("TenantId");
b.HasKey("Id");
b.HasIndex("EntityChangeId");
b.ToTable("AbpEntityPropertyChanges");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b =>
{
b.Property<Guid>("Id")
@ -445,7 +641,7 @@ namespace IdentityServerHost.Migrations
b.Property<bool>("BackChannelLogoutSessionRequired");
b.Property<string>("BackChannelLogoutUri")
.HasMaxLength(2000);
.HasMaxLength(300);
b.Property<string>("ClientClaimsPrefix")
.HasMaxLength(200);
@ -458,7 +654,7 @@ namespace IdentityServerHost.Migrations
.HasMaxLength(200);
b.Property<string>("ClientUri")
.HasMaxLength(2000);
.HasMaxLength(300);
b.Property<string>("ConcurrencyStamp");
@ -477,14 +673,14 @@ namespace IdentityServerHost.Migrations
b.Property<bool>("FrontChannelLogoutSessionRequired");
b.Property<string>("FrontChannelLogoutUri")
.HasMaxLength(2000);
.HasMaxLength(300);
b.Property<int>("IdentityTokenLifetime");
b.Property<bool>("IncludeJwtId");
b.Property<string>("LogoUri")
.HasMaxLength(2000);
.HasMaxLength(300);
b.Property<string>("PairWiseSubjectSalt")
.HasMaxLength(200);
@ -517,22 +713,15 @@ namespace IdentityServerHost.Migrations
modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<Guid>("ClientId");
b.Property<string>("Type")
.IsRequired()
.HasMaxLength(250);
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(250);
b.HasKey("Id");
b.HasIndex("ClientId");
b.HasKey("ClientId", "Type", "Value");
b.ToTable("IdentityServerClientClaims");
});
@ -578,7 +767,7 @@ namespace IdentityServerHost.Migrations
b.Property<Guid>("ClientId");
b.Property<string>("PostLogoutRedirectUri")
.HasMaxLength(2000);
.HasMaxLength(200);
b.HasKey("ClientId", "PostLogoutRedirectUri");
@ -590,11 +779,11 @@ namespace IdentityServerHost.Migrations
b.Property<Guid>("ClientId");
b.Property<string>("Key")
.HasMaxLength(250);
.HasMaxLength(64);
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(2000);
.HasMaxLength(128);
b.HasKey("ClientId", "Key");
@ -606,7 +795,7 @@ namespace IdentityServerHost.Migrations
b.Property<Guid>("ClientId");
b.Property<string>("RedirectUri")
.HasMaxLength(2000);
.HasMaxLength(200);
b.HasKey("ClientId", "RedirectUri");
@ -727,6 +916,82 @@ namespace IdentityServerHost.Migrations
b.ToTable("IdentityServerIdentityResources");
});
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.IsRequired()
.HasMaxLength(64);
b.Property<string>("ProviderName")
.IsRequired()
.HasMaxLength(64);
b.Property<Guid?>("TenantId");
b.HasKey("Id");
b.HasIndex("Name", "ProviderName", "ProviderKey");
b.ToTable("AbpPermissionGrants");
});
modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.HasMaxLength(64);
b.Property<string>("ProviderName")
.HasMaxLength(64);
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(2048);
b.HasKey("Id");
b.HasIndex("Name", "ProviderName", "ProviderKey");
b.ToTable("AbpSettings");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b =>
{
b.HasOne("Volo.Abp.AuditLogging.AuditLog")
.WithMany("Actions")
.HasForeignKey("AuditLogId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b =>
{
b.HasOne("Volo.Abp.AuditLogging.AuditLog")
.WithMany("EntityChanges")
.HasForeignKey("AuditLogId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b =>
{
b.HasOne("Volo.Abp.AuditLogging.EntityChange")
.WithMany("PropertyChanges")
.HasForeignKey("EntityChangeId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b =>
{
b.HasOne("Volo.Abp.Identity.IdentityRole")

@ -7,6 +7,37 @@ namespace IdentityServerHost.Migrations
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AbpAuditLogs",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true),
ConcurrencyStamp = table.Column<string>(nullable: true),
ApplicationName = table.Column<string>(maxLength: 96, nullable: true),
UserId = table.Column<Guid>(nullable: true),
UserName = table.Column<string>(maxLength: 256, nullable: true),
TenantId = table.Column<Guid>(nullable: true),
ImpersonatorUserId = table.Column<Guid>(nullable: true),
ImpersonatorTenantId = table.Column<Guid>(nullable: true),
ExecutionTime = table.Column<DateTime>(nullable: false),
ExecutionDuration = table.Column<int>(nullable: false),
ClientIpAddress = table.Column<string>(maxLength: 64, nullable: true),
ClientName = table.Column<string>(maxLength: 128, nullable: true),
ClientId = table.Column<string>(maxLength: 64, nullable: true),
CorrelationId = table.Column<string>(maxLength: 64, nullable: true),
BrowserInfo = table.Column<string>(maxLength: 512, nullable: true),
HttpMethod = table.Column<string>(maxLength: 16, nullable: true),
Url = table.Column<string>(maxLength: 256, nullable: true),
Exceptions = table.Column<string>(maxLength: 4000, nullable: true),
Comments = table.Column<string>(maxLength: 256, nullable: true),
HttpStatusCode = table.Column<int>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpAuditLogs", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpClaimTypes",
columns: table => new
@ -27,6 +58,21 @@ namespace IdentityServerHost.Migrations
table.PrimaryKey("PK_AbpClaimTypes", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpPermissionGrants",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
TenantId = table.Column<Guid>(nullable: true),
Name = table.Column<string>(maxLength: 128, nullable: false),
ProviderName = table.Column<string>(maxLength: 64, nullable: false),
ProviderKey = table.Column<string>(maxLength: 64, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpRoles",
columns: table => new
@ -46,6 +92,21 @@ namespace IdentityServerHost.Migrations
table.PrimaryKey("PK_AbpRoles", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpSettings",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
Name = table.Column<string>(maxLength: 128, nullable: false),
Value = table.Column<string>(maxLength: 2048, nullable: false),
ProviderName = table.Column<string>(maxLength: 64, nullable: true),
ProviderKey = table.Column<string>(maxLength: 64, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpSettings", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpUsers",
columns: table => new
@ -109,8 +170,8 @@ namespace IdentityServerHost.Migrations
ClientId = table.Column<string>(maxLength: 200, nullable: false),
ClientName = table.Column<string>(maxLength: 200, nullable: true),
Description = table.Column<string>(maxLength: 1000, nullable: true),
ClientUri = table.Column<string>(maxLength: 2000, nullable: true),
LogoUri = table.Column<string>(maxLength: 2000, nullable: true),
ClientUri = table.Column<string>(maxLength: 300, nullable: true),
LogoUri = table.Column<string>(maxLength: 300, nullable: true),
Enabled = table.Column<bool>(nullable: false),
ProtocolType = table.Column<string>(maxLength: 200, nullable: false),
RequireClientSecret = table.Column<bool>(nullable: false),
@ -120,9 +181,9 @@ namespace IdentityServerHost.Migrations
RequirePkce = table.Column<bool>(nullable: false),
AllowPlainTextPkce = table.Column<bool>(nullable: false),
AllowAccessTokensViaBrowser = table.Column<bool>(nullable: false),
FrontChannelLogoutUri = table.Column<string>(maxLength: 2000, nullable: true),
FrontChannelLogoutUri = table.Column<string>(maxLength: 300, nullable: true),
FrontChannelLogoutSessionRequired = table.Column<bool>(nullable: false),
BackChannelLogoutUri = table.Column<string>(maxLength: 2000, nullable: true),
BackChannelLogoutUri = table.Column<string>(maxLength: 300, nullable: true),
BackChannelLogoutSessionRequired = table.Column<bool>(nullable: false),
AllowOfflineAccess = table.Column<bool>(nullable: false),
IdentityTokenLifetime = table.Column<int>(nullable: false),
@ -186,6 +247,55 @@ namespace IdentityServerHost.Migrations
table.PrimaryKey("PK_IdentityServerPersistedGrants", x => x.Key);
});
migrationBuilder.CreateTable(
name: "AbpAuditLogActions",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
TenantId = table.Column<Guid>(nullable: true),
AuditLogId = table.Column<Guid>(nullable: false),
ServiceName = table.Column<string>(maxLength: 256, nullable: true),
MethodName = table.Column<string>(maxLength: 128, nullable: true),
Parameters = table.Column<string>(maxLength: 2000, nullable: true),
ExecutionTime = table.Column<DateTime>(nullable: false),
ExecutionDuration = table.Column<int>(nullable: false),
ExtraProperties = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpAuditLogActions", x => x.Id);
table.ForeignKey(
name: "FK_AbpAuditLogActions_AbpAuditLogs_AuditLogId",
column: x => x.AuditLogId,
principalTable: "AbpAuditLogs",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AbpEntityChanges",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
AuditLogId = table.Column<Guid>(nullable: false),
TenantId = table.Column<Guid>(nullable: true),
ChangeTime = table.Column<DateTime>(nullable: false),
ChangeType = table.Column<byte>(nullable: false),
EntityId = table.Column<string>(maxLength: 128, nullable: false),
EntityTypeFullName = table.Column<string>(maxLength: 128, nullable: false),
ExtraProperties = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpEntityChanges", x => x.Id);
table.ForeignKey(
name: "FK_AbpEntityChanges_AbpAuditLogs_AuditLogId",
column: x => x.AuditLogId,
principalTable: "AbpAuditLogs",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AbpRoleClaims",
columns: table => new
@ -361,14 +471,13 @@ namespace IdentityServerHost.Migrations
name: "IdentityServerClientClaims",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
ClientId = table.Column<Guid>(nullable: false),
Type = table.Column<string>(maxLength: 250, nullable: false),
Value = table.Column<string>(maxLength: 250, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityServerClientClaims", x => x.Id);
table.PrimaryKey("PK_IdentityServerClientClaims", x => new { x.ClientId, x.Type, x.Value });
table.ForeignKey(
name: "FK_IdentityServerClientClaims_IdentityServerClients_ClientId",
column: x => x.ClientId,
@ -436,7 +545,7 @@ namespace IdentityServerHost.Migrations
columns: table => new
{
ClientId = table.Column<Guid>(nullable: false),
PostLogoutRedirectUri = table.Column<string>(maxLength: 2000, nullable: false)
PostLogoutRedirectUri = table.Column<string>(maxLength: 200, nullable: false)
},
constraints: table =>
{
@ -454,8 +563,8 @@ namespace IdentityServerHost.Migrations
columns: table => new
{
ClientId = table.Column<Guid>(nullable: false),
Key = table.Column<string>(maxLength: 250, nullable: false),
Value = table.Column<string>(maxLength: 2000, nullable: false)
Key = table.Column<string>(maxLength: 64, nullable: false),
Value = table.Column<string>(maxLength: 128, nullable: false)
},
constraints: table =>
{
@ -473,7 +582,7 @@ namespace IdentityServerHost.Migrations
columns: table => new
{
ClientId = table.Column<Guid>(nullable: false),
RedirectUri = table.Column<string>(maxLength: 2000, nullable: false)
RedirectUri = table.Column<string>(maxLength: 200, nullable: false)
},
constraints: table =>
{
@ -543,6 +652,29 @@ namespace IdentityServerHost.Migrations
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AbpEntityPropertyChanges",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
TenantId = table.Column<Guid>(nullable: true),
EntityChangeId = table.Column<Guid>(nullable: false),
NewValue = table.Column<string>(maxLength: 512, nullable: true),
OriginalValue = table.Column<string>(maxLength: 512, nullable: true),
PropertyName = table.Column<string>(maxLength: 128, nullable: false),
PropertyTypeFullName = table.Column<string>(maxLength: 64, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpEntityPropertyChanges", x => x.Id);
table.ForeignKey(
name: "FK_AbpEntityPropertyChanges_AbpEntityChanges_EntityChangeId",
column: x => x.EntityChangeId,
principalTable: "AbpEntityChanges",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "IdentityServerApiScopeClaims",
columns: table => new
@ -562,6 +694,46 @@ namespace IdentityServerHost.Migrations
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_AbpAuditLogActions_AuditLogId",
table: "AbpAuditLogActions",
column: "AuditLogId");
migrationBuilder.CreateIndex(
name: "IX_AbpAuditLogActions_TenantId_ServiceName_MethodName_ExecutionTime",
table: "AbpAuditLogActions",
columns: new[] { "TenantId", "ServiceName", "MethodName", "ExecutionTime" });
migrationBuilder.CreateIndex(
name: "IX_AbpAuditLogs_TenantId_ExecutionTime",
table: "AbpAuditLogs",
columns: new[] { "TenantId", "ExecutionTime" });
migrationBuilder.CreateIndex(
name: "IX_AbpAuditLogs_TenantId_UserId_ExecutionTime",
table: "AbpAuditLogs",
columns: new[] { "TenantId", "UserId", "ExecutionTime" });
migrationBuilder.CreateIndex(
name: "IX_AbpEntityChanges_AuditLogId",
table: "AbpEntityChanges",
column: "AuditLogId");
migrationBuilder.CreateIndex(
name: "IX_AbpEntityChanges_TenantId_EntityTypeFullName_EntityId",
table: "AbpEntityChanges",
columns: new[] { "TenantId", "EntityTypeFullName", "EntityId" });
migrationBuilder.CreateIndex(
name: "IX_AbpEntityPropertyChanges_EntityChangeId",
table: "AbpEntityPropertyChanges",
column: "EntityChangeId");
migrationBuilder.CreateIndex(
name: "IX_AbpPermissionGrants_Name_ProviderName_ProviderKey",
table: "AbpPermissionGrants",
columns: new[] { "Name", "ProviderName", "ProviderKey" });
migrationBuilder.CreateIndex(
name: "IX_AbpRoleClaims_RoleId",
table: "AbpRoleClaims",
@ -572,6 +744,11 @@ namespace IdentityServerHost.Migrations
table: "AbpRoles",
column: "NormalizedName");
migrationBuilder.CreateIndex(
name: "IX_AbpSettings_Name_ProviderName_ProviderKey",
table: "AbpSettings",
columns: new[] { "Name", "ProviderName", "ProviderKey" });
migrationBuilder.CreateIndex(
name: "IX_AbpUserClaims_UserId",
table: "AbpUserClaims",
@ -607,11 +784,6 @@ namespace IdentityServerHost.Migrations
table: "AbpUsers",
column: "UserName");
migrationBuilder.CreateIndex(
name: "IX_IdentityServerClientClaims_ClientId",
table: "IdentityServerClientClaims",
column: "ClientId");
migrationBuilder.CreateIndex(
name: "IX_IdentityServerClients_ClientId",
table: "IdentityServerClients",
@ -626,12 +798,24 @@ namespace IdentityServerHost.Migrations
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AbpAuditLogActions");
migrationBuilder.DropTable(
name: "AbpClaimTypes");
migrationBuilder.DropTable(
name: "AbpEntityPropertyChanges");
migrationBuilder.DropTable(
name: "AbpPermissionGrants");
migrationBuilder.DropTable(
name: "AbpRoleClaims");
migrationBuilder.DropTable(
name: "AbpSettings");
migrationBuilder.DropTable(
name: "AbpUserClaims");
@ -686,6 +870,9 @@ namespace IdentityServerHost.Migrations
migrationBuilder.DropTable(
name: "IdentityServerPersistedGrants");
migrationBuilder.DropTable(
name: "AbpEntityChanges");
migrationBuilder.DropTable(
name: "AbpRoles");
@ -701,6 +888,9 @@ namespace IdentityServerHost.Migrations
migrationBuilder.DropTable(
name: "IdentityServerIdentityResources");
migrationBuilder.DropTable(
name: "AbpAuditLogs");
migrationBuilder.DropTable(
name: "IdentityServerApiResources");
}

@ -19,6 +19,202 @@ namespace IdentityServerHost.Migrations
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("ApplicationName")
.HasColumnName("ApplicationName")
.HasMaxLength(96);
b.Property<string>("BrowserInfo")
.HasColumnName("BrowserInfo")
.HasMaxLength(512);
b.Property<string>("ClientId")
.HasColumnName("ClientId")
.HasMaxLength(64);
b.Property<string>("ClientIpAddress")
.HasColumnName("ClientIpAddress")
.HasMaxLength(64);
b.Property<string>("ClientName")
.HasColumnName("ClientName")
.HasMaxLength(128);
b.Property<string>("Comments")
.HasColumnName("Comments")
.HasMaxLength(256);
b.Property<string>("ConcurrencyStamp");
b.Property<string>("CorrelationId")
.HasColumnName("CorrelationId")
.HasMaxLength(64);
b.Property<string>("Exceptions")
.HasColumnName("Exceptions")
.HasMaxLength(4000);
b.Property<int>("ExecutionDuration")
.HasColumnName("ExecutionDuration");
b.Property<DateTime>("ExecutionTime");
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties");
b.Property<string>("HttpMethod")
.HasColumnName("HttpMethod")
.HasMaxLength(16);
b.Property<int?>("HttpStatusCode")
.HasColumnName("HttpStatusCode");
b.Property<Guid?>("ImpersonatorTenantId")
.HasColumnName("ImpersonatorTenantId");
b.Property<Guid?>("ImpersonatorUserId")
.HasColumnName("ImpersonatorUserId");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId");
b.Property<string>("Url")
.HasColumnName("Url")
.HasMaxLength(256);
b.Property<Guid?>("UserId")
.HasColumnName("UserId");
b.Property<string>("UserName")
.HasColumnName("UserName")
.HasMaxLength(256);
b.HasKey("Id");
b.HasIndex("TenantId", "ExecutionTime");
b.HasIndex("TenantId", "UserId", "ExecutionTime");
b.ToTable("AbpAuditLogs");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<Guid>("AuditLogId")
.HasColumnName("AuditLogId");
b.Property<int>("ExecutionDuration")
.HasColumnName("ExecutionDuration");
b.Property<DateTime>("ExecutionTime")
.HasColumnName("ExecutionTime");
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties");
b.Property<string>("MethodName")
.HasColumnName("MethodName")
.HasMaxLength(128);
b.Property<string>("Parameters")
.HasColumnName("Parameters")
.HasMaxLength(2000);
b.Property<string>("ServiceName")
.HasColumnName("ServiceName")
.HasMaxLength(256);
b.Property<Guid?>("TenantId");
b.HasKey("Id");
b.HasIndex("AuditLogId");
b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime");
b.ToTable("AbpAuditLogActions");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<Guid>("AuditLogId")
.HasColumnName("AuditLogId");
b.Property<DateTime>("ChangeTime")
.HasColumnName("ChangeTime");
b.Property<byte>("ChangeType")
.HasColumnName("ChangeType");
b.Property<string>("EntityId")
.IsRequired()
.HasColumnName("EntityId")
.HasMaxLength(128);
b.Property<string>("EntityTypeFullName")
.IsRequired()
.HasColumnName("EntityTypeFullName")
.HasMaxLength(128);
b.Property<string>("ExtraProperties")
.HasColumnName("ExtraProperties");
b.Property<Guid?>("TenantId")
.HasColumnName("TenantId");
b.HasKey("Id");
b.HasIndex("AuditLogId");
b.HasIndex("TenantId", "EntityTypeFullName", "EntityId");
b.ToTable("AbpEntityChanges");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<Guid>("EntityChangeId");
b.Property<string>("NewValue")
.HasColumnName("NewValue")
.HasMaxLength(512);
b.Property<string>("OriginalValue")
.HasColumnName("OriginalValue")
.HasMaxLength(512);
b.Property<string>("PropertyName")
.IsRequired()
.HasColumnName("PropertyName")
.HasMaxLength(128);
b.Property<string>("PropertyTypeFullName")
.IsRequired()
.HasColumnName("PropertyTypeFullName")
.HasMaxLength(64);
b.Property<Guid?>("TenantId");
b.HasKey("Id");
b.HasIndex("EntityChangeId");
b.ToTable("AbpEntityPropertyChanges");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b =>
{
b.Property<Guid>("Id")
@ -443,7 +639,7 @@ namespace IdentityServerHost.Migrations
b.Property<bool>("BackChannelLogoutSessionRequired");
b.Property<string>("BackChannelLogoutUri")
.HasMaxLength(2000);
.HasMaxLength(300);
b.Property<string>("ClientClaimsPrefix")
.HasMaxLength(200);
@ -456,7 +652,7 @@ namespace IdentityServerHost.Migrations
.HasMaxLength(200);
b.Property<string>("ClientUri")
.HasMaxLength(2000);
.HasMaxLength(300);
b.Property<string>("ConcurrencyStamp");
@ -475,14 +671,14 @@ namespace IdentityServerHost.Migrations
b.Property<bool>("FrontChannelLogoutSessionRequired");
b.Property<string>("FrontChannelLogoutUri")
.HasMaxLength(2000);
.HasMaxLength(300);
b.Property<int>("IdentityTokenLifetime");
b.Property<bool>("IncludeJwtId");
b.Property<string>("LogoUri")
.HasMaxLength(2000);
.HasMaxLength(300);
b.Property<string>("PairWiseSubjectSalt")
.HasMaxLength(200);
@ -515,22 +711,15 @@ namespace IdentityServerHost.Migrations
modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<Guid>("ClientId");
b.Property<string>("Type")
.IsRequired()
.HasMaxLength(250);
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(250);
b.HasKey("Id");
b.HasIndex("ClientId");
b.HasKey("ClientId", "Type", "Value");
b.ToTable("IdentityServerClientClaims");
});
@ -576,7 +765,7 @@ namespace IdentityServerHost.Migrations
b.Property<Guid>("ClientId");
b.Property<string>("PostLogoutRedirectUri")
.HasMaxLength(2000);
.HasMaxLength(200);
b.HasKey("ClientId", "PostLogoutRedirectUri");
@ -588,11 +777,11 @@ namespace IdentityServerHost.Migrations
b.Property<Guid>("ClientId");
b.Property<string>("Key")
.HasMaxLength(250);
.HasMaxLength(64);
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(2000);
.HasMaxLength(128);
b.HasKey("ClientId", "Key");
@ -604,7 +793,7 @@ namespace IdentityServerHost.Migrations
b.Property<Guid>("ClientId");
b.Property<string>("RedirectUri")
.HasMaxLength(2000);
.HasMaxLength(200);
b.HasKey("ClientId", "RedirectUri");
@ -725,6 +914,82 @@ namespace IdentityServerHost.Migrations
b.ToTable("IdentityServerIdentityResources");
});
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.IsRequired()
.HasMaxLength(64);
b.Property<string>("ProviderName")
.IsRequired()
.HasMaxLength(64);
b.Property<Guid?>("TenantId");
b.HasKey("Id");
b.HasIndex("Name", "ProviderName", "ProviderKey");
b.ToTable("AbpPermissionGrants");
});
modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128);
b.Property<string>("ProviderKey")
.HasMaxLength(64);
b.Property<string>("ProviderName")
.HasMaxLength(64);
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(2048);
b.HasKey("Id");
b.HasIndex("Name", "ProviderName", "ProviderKey");
b.ToTable("AbpSettings");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b =>
{
b.HasOne("Volo.Abp.AuditLogging.AuditLog")
.WithMany("Actions")
.HasForeignKey("AuditLogId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b =>
{
b.HasOne("Volo.Abp.AuditLogging.AuditLog")
.WithMany("EntityChanges")
.HasForeignKey("AuditLogId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b =>
{
b.HasOne("Volo.Abp.AuditLogging.EntityChange")
.WithMany("PropertyChanges")
.HasForeignKey("EntityChangeId")
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b =>
{
b.HasOne("Volo.Abp.Identity.IdentityRole")

@ -1,6 +1,7 @@
{
"ConnectionStrings": {
"Default": "Server=localhost;Database=IdentityServerHost;Trusted_Connection=True;MultipleActiveResultSets=true",
"SqlServerCache": "Server=localhost;Database=MyProjectNameCache;Trusted_Connection=True;MultipleActiveResultSets=true"
"Default": "Server=localhost;Database=MyProjectName_Identity;Trusted_Connection=True;MultipleActiveResultSets=true",
"SqlServerCache": "Server=localhost;Database=MyProjectName_Cache;Trusted_Connection=True;MultipleActiveResultSets=true"
}
}

@ -21,8 +21,9 @@ namespace MyCompanyName.MyProjectName.Host
modelBuilder.ConfigurePermissionManagement();
modelBuilder.ConfigureSettingManagement();
modelBuilder.ConfigureMyProjectName();
modelBuilder.ConfigureAuditLogging();
modelBuilder.ConfigureMyProjectName();
}
}
}

@ -10,7 +10,7 @@ using MyCompanyName.MyProjectName.Host;
namespace MyCompanyName.MyProjectName.Host.Migrations
{
[DbContext(typeof(DemoAppDbContext))]
[Migration("20190214093219_Initial")]
[Migration("20190320142412_Initial")]
partial class Initial
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)

@ -1 +1 @@
dotnet sql-cache create "Server=localhost;Database=MyProjectNameCache;Trusted_Connection=True;MultipleActiveResultSets=true" dbo TestCache
dotnet sql-cache create "Server=localhost;Database=MyProjectName_Cache;Trusted_Connection=True;MultipleActiveResultSets=true" dbo TestCache

@ -1,6 +1,11 @@
{
"ConnectionStrings": {
"Default": "Server=localhost;Database=MyProjectNameHost;Trusted_Connection=True;MultipleActiveResultSets=true",
"SqlServerCache": "Server=localhost;Database=MyProjectNameCache;Trusted_Connection=True;MultipleActiveResultSets=true"
"Default": "Server=localhost;Database=MyProjectName_ModuleDb;Trusted_Connection=True;MultipleActiveResultSets=true",
"AbpSettingManagement": "Server=localhost;Database=MyProjectName_Identity;Trusted_Connection=True;MultipleActiveResultSets=true",
"AbpPermissionManagement": "Server=localhost;Database=MyProjectName_Identity;Trusted_Connection=True;MultipleActiveResultSets=true",
"AbpAuditLogging": "Server=localhost;Database=MyProjectName_Identity;Trusted_Connection=True;MultipleActiveResultSets=true",
"SqlServerCache": "Server=localhost;Database=MyProjectName_Cache;Trusted_Connection=True;MultipleActiveResultSets=true"
}
}
Loading…
Cancel
Save