Browse Source

Resolved #399: Added background jobs and audit logging module to the startup template.

pull/441/head
Halil ibrahim Kalkan 8 years ago
parent
commit
b3222927b0
  1. 2
      modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo/Abp/BackgroundJobs/BackgroundJobsDomainModule.cs
  2. 2
      modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs
  3. 10
      templates/mvc/src/MyCompanyName.MyProjectName.Application/Permissions/MyProjectNamePermissions.cs
  4. 2
      templates/mvc/src/MyCompanyName.MyProjectName.Domain/MyCompanyName.MyProjectName.Domain.csproj
  5. 7
      templates/mvc/src/MyCompanyName.MyProjectName.Domain/MyProjectNameDomainModule.cs
  6. 4
      templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameDbContext.cs
  7. 7
      templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameEntityFrameworkCoreModule.cs
  8. 279
      templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20180917104042_Initial_Modules.Designer.cs
  9. 212
      templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20180917104042_Initial_Modules.cs
  10. 276
      templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/MyProjectNameDbContextModelSnapshot.cs
  11. 8
      templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/MyCompanyName.MyProjectName.EntityFrameworkCore.csproj
  12. 6
      templates/mvc/src/MyCompanyName.MyProjectName.MongoDB/MongoDb/MyProjectNameMongoDbModule.cs
  13. 2
      templates/mvc/src/MyCompanyName.MyProjectName.MongoDB/MyCompanyName.MyProjectName.MongoDB.csproj
  14. 5
      templates/mvc/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs

2
modules/background-jobs/src/Volo.Abp.BackgroundJobs.Domain/Volo/Abp/BackgroundJobs/BackgroundJobsDomainModule.cs

@ -9,7 +9,7 @@ namespace Volo.Abp.BackgroundJobs
typeof(AbpBackgroundJobsModule),
typeof(AbpAutoMapperModule)
)]
public class BackgroundJobsDomainModule : AbpModule
public class BackgroundJobsDomainModule : AbpModule //TODO: Rename to AbpBackgroundJobsDomainModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{

2
modules/docs/src/Volo.Docs.Web/Pages/Documents/Project/Index.cshtml.cs

@ -48,7 +48,7 @@ namespace Volo.Docs.Pages.Documents.Project
Version = latestVersion.Version;
}
latestVersion.DisplayText = $"latest {latestVersion.Version}";
latestVersion.DisplayText = $"{latestVersion.Version} (latest)";
latestVersion.Version = "latest";
Document = await _documentAppService.GetByNameAsync(ProjectName, DocumentName, Version);

10
templates/mvc/src/MyCompanyName.MyProjectName.Application/Permissions/MyProjectNamePermissions.cs

@ -1,4 +1,6 @@
namespace MyCompanyName.MyProjectName.Permissions
using System;
namespace MyCompanyName.MyProjectName.Permissions
{
public static class MyProjectNamePermissions
{
@ -6,5 +8,11 @@
//Add your own permission names. Example:
//public const string MyPermission1 = GroupName + ".MyPermission1";
public static string[] GetAll()
{
//Return an array of all permissions
return Array.Empty<string>();
}
}
}

2
templates/mvc/src/MyCompanyName.MyProjectName.Domain/MyCompanyName.MyProjectName.Domain.csproj

@ -7,6 +7,8 @@
<ItemGroup>
<ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.Domain\Volo.Abp.Identity.Domain.csproj" />
<ProjectReference Include="..\..\..\..\modules\background-jobs\src\Volo.Abp.BackgroundJobs.Domain\Volo.Abp.BackgroundJobs.Domain.csproj" />
<ProjectReference Include="..\..\..\..\modules\audit-logging\src\Volo.Abp.AuditLogging.Domain\Volo.Abp.AuditLogging.Domain.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.Auditing\Volo.Abp.Auditing.csproj" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.DataAnnotations" Version="2.1.1" />
</ItemGroup>

7
templates/mvc/src/MyCompanyName.MyProjectName.Domain/MyProjectNameDomainModule.cs

@ -2,6 +2,8 @@
using MyCompanyName.MyProjectName.Localization.MyProjectName;
using MyCompanyName.MyProjectName.Settings;
using Volo.Abp.Auditing;
using Volo.Abp.AuditLogging;
using Volo.Abp.BackgroundJobs;
using Volo.Abp.Identity;
using Volo.Abp.Localization;
using Volo.Abp.Localization.Resources.AbpValidation;
@ -13,7 +15,10 @@ namespace MyCompanyName.MyProjectName
{
[DependsOn(
typeof(AbpIdentityDomainModule),
typeof(AbpAuditingModule))] //TODO: Replace with AbpAuditLoggingDomainModule when it's done.
typeof(AbpAuditingModule),
typeof(BackgroundJobsDomainModule),
typeof(AbpAuditLoggingDomainModule)
)]
public class MyProjectNameDomainModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)

4
templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameDbContext.cs

@ -1,4 +1,6 @@
using Microsoft.EntityFrameworkCore;
using Volo.Abp.AuditLogging.EntityFrameworkCore;
using Volo.Abp.BackgroundJobs.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.Identity.EntityFrameworkCore;
using Volo.Abp.PermissionManagement.EntityFrameworkCore;
@ -21,6 +23,8 @@ namespace MyCompanyName.MyProjectName.EntityFrameworkCore
modelBuilder.ConfigureIdentity();
modelBuilder.ConfigurePermissionManagement();
modelBuilder.ConfigureSettingManagement();
modelBuilder.ConfigureBackgroundJobs();
modelBuilder.ConfigureAuditLogging();
}
}
}

7
templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/EntityFrameworkCore/MyProjectNameEntityFrameworkCoreModule.cs

@ -1,4 +1,6 @@
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AuditLogging.EntityFrameworkCore;
using Volo.Abp.BackgroundJobs.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.SqlServer;
using Volo.Abp.Identity.EntityFrameworkCore;
using Volo.Abp.Modularity;
@ -12,7 +14,10 @@ namespace MyCompanyName.MyProjectName.EntityFrameworkCore
typeof(AbpIdentityEntityFrameworkCoreModule),
typeof(AbpPermissionManagementEntityFrameworkCoreModule),
typeof(AbpSettingManagementEntityFrameworkCoreModule),
typeof(AbpEntityFrameworkCoreSqlServerModule))]
typeof(AbpEntityFrameworkCoreSqlServerModule),
typeof(BackgroundJobsEntityFrameworkCoreModule),
typeof(AbpAuditLoggingEntityFrameworkCoreModule)
)]
public class MyProjectNameEntityFrameworkCoreModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)

279
templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20180528221424_Initial.Designer.cs → templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20180917104042_Initial_Modules.Designer.cs

@ -1,27 +1,260 @@
// <auto-generated />
using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Metadata.Internal;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using MyCompanyName.MyProjectName.EntityFrameworkCore;
using Volo.Abp.BackgroundJobs;
namespace MyCompanyName.MyProjectName.Migrations
{
[DbContext(typeof(MyProjectNameDbContext))]
[Migration("20180528221424_Initial")]
partial class Initial
[Migration("20180917104042_Initial_Modules")]
partial class Initial_Modules
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.1.0-preview2-30571")
.HasAnnotation("ProductVersion", "2.1.1-rtm-30846")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("BrowserInfo")
.HasColumnName("BrowserInfo")
.HasMaxLength(512);
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>("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<Guid?>("AuditLogId1");
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("AuditLogId1");
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<Guid?>("AuditLogId1");
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("AuditLogId1");
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<Guid?>("EntityChangeId1");
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.HasIndex("EntityChangeId1");
b.ToTable("AbpEntityPropertyChanges");
});
modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime");
b.Property<bool>("IsAbandoned")
.ValueGeneratedOnAdd()
.HasDefaultValue(false);
b.Property<string>("JobArgs")
.IsRequired()
.HasMaxLength(1048576);
b.Property<string>("JobName")
.IsRequired()
.HasMaxLength(128);
b.Property<DateTime?>("LastTryTime");
b.Property<DateTime>("NextTryTime");
b.Property<byte>("Priority")
.ValueGeneratedOnAdd()
.HasDefaultValue((byte)15);
b.Property<short>("TryCount")
.ValueGeneratedOnAdd()
.HasDefaultValue((short)0);
b.HasKey("Id");
b.HasIndex("IsAbandoned", "NextTryTime");
b.ToTable("AbpBackgroundJobs");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b =>
{
b.Property<Guid>("Id")
@ -287,6 +520,42 @@ namespace MyCompanyName.MyProjectName.Migrations
b.ToTable("AbpSettings");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b =>
{
b.HasOne("Volo.Abp.AuditLogging.AuditLog")
.WithMany()
.HasForeignKey("AuditLogId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("Volo.Abp.AuditLogging.AuditLog")
.WithMany("Actions")
.HasForeignKey("AuditLogId1");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b =>
{
b.HasOne("Volo.Abp.AuditLogging.AuditLog")
.WithMany()
.HasForeignKey("AuditLogId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("Volo.Abp.AuditLogging.AuditLog")
.WithMany("EntityChanges")
.HasForeignKey("AuditLogId1");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b =>
{
b.HasOne("Volo.Abp.AuditLogging.EntityChange")
.WithMany()
.HasForeignKey("EntityChangeId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("Volo.Abp.AuditLogging.EntityChange")
.WithMany("PropertyChanges")
.HasForeignKey("EntityChangeId1");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b =>
{
b.HasOne("Volo.Abp.Identity.IdentityRole")

212
templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20180528221424_Initial.cs → templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/20180917104042_Initial_Modules.cs

@ -1,13 +1,58 @@
using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore.Migrations;
namespace MyCompanyName.MyProjectName.Migrations
{
public partial class Initial : Migration
public partial class Initial_Modules : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AbpAuditLogs",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
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),
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),
ExtraProperties = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpAuditLogs", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpBackgroundJobs",
columns: table => new
{
Id = table.Column<Guid>(nullable: false),
JobName = table.Column<string>(maxLength: 128, nullable: false),
JobArgs = table.Column<string>(maxLength: 1048576, nullable: false),
TryCount = table.Column<short>(nullable: false, defaultValue: (short)0),
CreationTime = table.Column<DateTime>(nullable: false),
NextTryTime = table.Column<DateTime>(nullable: false),
LastTryTime = table.Column<DateTime>(nullable: true),
IsAbandoned = table.Column<bool>(nullable: false, defaultValue: false),
Priority = table.Column<byte>(nullable: false, defaultValue: (byte)15)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpBackgroundJobs", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpPermissionGrants",
columns: table => new
@ -80,6 +125,69 @@ namespace MyCompanyName.MyProjectName.Migrations
table.PrimaryKey("PK_AbpUsers", x => x.Id);
});
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),
AuditLogId1 = table.Column<Guid>(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);
table.ForeignKey(
name: "FK_AbpAuditLogActions_AbpAuditLogs_AuditLogId1",
column: x => x.AuditLogId1,
principalTable: "AbpAuditLogs",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
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),
AuditLogId1 = table.Column<Guid>(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);
table.ForeignKey(
name: "FK_AbpEntityChanges_AbpAuditLogs_AuditLogId1",
column: x => x.AuditLogId1,
principalTable: "AbpAuditLogs",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "AbpRoleClaims",
columns: table => new
@ -189,6 +297,91 @@ namespace MyCompanyName.MyProjectName.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),
EntityChangeId1 = table.Column<Guid>(nullable: true)
},
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);
table.ForeignKey(
name: "FK_AbpEntityPropertyChanges_AbpEntityChanges_EntityChangeId1",
column: x => x.EntityChangeId1,
principalTable: "AbpEntityChanges",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
name: "IX_AbpAuditLogActions_AuditLogId",
table: "AbpAuditLogActions",
column: "AuditLogId");
migrationBuilder.CreateIndex(
name: "IX_AbpAuditLogActions_AuditLogId1",
table: "AbpAuditLogActions",
column: "AuditLogId1");
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_AbpBackgroundJobs_IsAbandoned_NextTryTime",
table: "AbpBackgroundJobs",
columns: new[] { "IsAbandoned", "NextTryTime" });
migrationBuilder.CreateIndex(
name: "IX_AbpEntityChanges_AuditLogId",
table: "AbpEntityChanges",
column: "AuditLogId");
migrationBuilder.CreateIndex(
name: "IX_AbpEntityChanges_AuditLogId1",
table: "AbpEntityChanges",
column: "AuditLogId1");
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_AbpEntityPropertyChanges_EntityChangeId1",
table: "AbpEntityPropertyChanges",
column: "EntityChangeId1");
migrationBuilder.CreateIndex(
name: "IX_AbpPermissionGrants_Name_ProviderName_ProviderKey",
table: "AbpPermissionGrants",
@ -247,6 +440,15 @@ namespace MyCompanyName.MyProjectName.Migrations
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AbpAuditLogActions");
migrationBuilder.DropTable(
name: "AbpBackgroundJobs");
migrationBuilder.DropTable(
name: "AbpEntityPropertyChanges");
migrationBuilder.DropTable(
name: "AbpPermissionGrants");
@ -268,11 +470,17 @@ namespace MyCompanyName.MyProjectName.Migrations
migrationBuilder.DropTable(
name: "AbpUserTokens");
migrationBuilder.DropTable(
name: "AbpEntityChanges");
migrationBuilder.DropTable(
name: "AbpRoles");
migrationBuilder.DropTable(
name: "AbpUsers");
migrationBuilder.DropTable(
name: "AbpAuditLogs");
}
}
}

276
templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/Migrations/MyProjectNameDbContextModelSnapshot.cs

@ -1,13 +1,11 @@
// <auto-generated />
using System;
using System.Collections.Generic;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Metadata.Internal;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using MyCompanyName.MyProjectName.EntityFrameworkCore;
using Volo.Abp.BackgroundJobs;
namespace MyCompanyName.MyProjectName.Migrations
{
@ -18,9 +16,243 @@ namespace MyCompanyName.MyProjectName.Migrations
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.1.0-preview2-30571")
.HasAnnotation("ProductVersion", "2.1.1-rtm-30846")
.HasAnnotation("Relational:MaxIdentifierLength", 128)
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("BrowserInfo")
.HasColumnName("BrowserInfo")
.HasMaxLength(512);
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>("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<Guid?>("AuditLogId1");
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("AuditLogId1");
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<Guid?>("AuditLogId1");
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("AuditLogId1");
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<Guid?>("EntityChangeId1");
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.HasIndex("EntityChangeId1");
b.ToTable("AbpEntityPropertyChanges");
});
modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("CreationTime")
.HasColumnName("CreationTime");
b.Property<bool>("IsAbandoned")
.ValueGeneratedOnAdd()
.HasDefaultValue(false);
b.Property<string>("JobArgs")
.IsRequired()
.HasMaxLength(1048576);
b.Property<string>("JobName")
.IsRequired()
.HasMaxLength(128);
b.Property<DateTime?>("LastTryTime");
b.Property<DateTime>("NextTryTime");
b.Property<byte>("Priority")
.ValueGeneratedOnAdd()
.HasDefaultValue((byte)15);
b.Property<short>("TryCount")
.ValueGeneratedOnAdd()
.HasDefaultValue((short)0);
b.HasKey("Id");
b.HasIndex("IsAbandoned", "NextTryTime");
b.ToTable("AbpBackgroundJobs");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b =>
{
b.Property<Guid>("Id")
@ -286,6 +518,42 @@ namespace MyCompanyName.MyProjectName.Migrations
b.ToTable("AbpSettings");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b =>
{
b.HasOne("Volo.Abp.AuditLogging.AuditLog")
.WithMany()
.HasForeignKey("AuditLogId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("Volo.Abp.AuditLogging.AuditLog")
.WithMany("Actions")
.HasForeignKey("AuditLogId1");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b =>
{
b.HasOne("Volo.Abp.AuditLogging.AuditLog")
.WithMany()
.HasForeignKey("AuditLogId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("Volo.Abp.AuditLogging.AuditLog")
.WithMany("EntityChanges")
.HasForeignKey("AuditLogId1");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b =>
{
b.HasOne("Volo.Abp.AuditLogging.EntityChange")
.WithMany()
.HasForeignKey("EntityChangeId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("Volo.Abp.AuditLogging.EntityChange")
.WithMany("PropertyChanges")
.HasForeignKey("EntityChangeId1");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b =>
{
b.HasOne("Volo.Abp.Identity.IdentityRole")

8
templates/mvc/src/MyCompanyName.MyProjectName.EntityFrameworkCore/MyCompanyName.MyProjectName.EntityFrameworkCore.csproj

@ -5,6 +5,12 @@
<RootNamespace>MyCompanyName.MyProjectName</RootNamespace>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Migrations\20180528221424_Initial.cs" />
<Compile Remove="Migrations\20180917103757_Added_Modules.cs" />
<Compile Remove="Migrations\20180917103851_Added_Modules.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.1.1" />
@ -16,6 +22,8 @@
<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\identity\src\Volo.Abp.Identity.EntityFrameworkCore\Volo.Abp.Identity.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\modules\background-jobs\src\Volo.Abp.BackgroundJobs.EntityFrameworkCore\Volo.Abp.BackgroundJobs.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\modules\audit-logging\src\Volo.Abp.AuditLogging.EntityFrameworkCore\Volo.Abp.AuditLogging.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\framework\src\Volo.Abp.EntityFrameworkCore.SqlServer\Volo.Abp.EntityFrameworkCore.SqlServer.csproj" />
</ItemGroup>

6
templates/mvc/src/MyCompanyName.MyProjectName.MongoDB/MongoDb/MyProjectNameMongoDbModule.cs

@ -1,4 +1,6 @@
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AuditLogging.MongoDB;
using Volo.Abp.BackgroundJobs.MongoDB;
using Volo.Abp.Identity.MongoDB;
using Volo.Abp.Modularity;
using Volo.Abp.PermissionManagement.MongoDB;
@ -9,7 +11,9 @@ namespace MyCompanyName.MyProjectName.MongoDb
[DependsOn(
typeof(AbpPermissionManagementMongoDbModule),
typeof(AbpSettingManagementMongoDbModule),
typeof(AbpIdentityMongoDbModule)
typeof(AbpIdentityMongoDbModule),
typeof(BackgroundJobsMongoDbModule),
typeof(AbpAuditLoggingMongoDbModule)
)]
public class MyProjectNameMongoDbModule : AbpModule
{

2
templates/mvc/src/MyCompanyName.MyProjectName.MongoDB/MyCompanyName.MyProjectName.MongoDB.csproj

@ -10,6 +10,8 @@
<ProjectReference Include="..\..\..\..\modules\permission-management\src\Volo.Abp.PermissionManagement.MongoDB\Volo.Abp.PermissionManagement.MongoDB.csproj" />
<ProjectReference Include="..\..\..\..\modules\setting-management\src\Volo.Abp.SettingManagement.MongoDB\Volo.Abp.SettingManagement.MongoDB.csproj" />
<ProjectReference Include="..\..\..\..\modules\identity\src\Volo.Abp.Identity.MongoDB\Volo.Abp.Identity.MongoDB.csproj" />
<ProjectReference Include="..\..\..\..\modules\background-jobs\src\Volo.Abp.BackgroundJobs.MongoDB\Volo.Abp.BackgroundJobs.MongoDB.csproj" />
<ProjectReference Include="..\..\..\..\modules\audit-logging\src\Volo.Abp.AuditLogging.MongoDB\Volo.Abp.AuditLogging.MongoDB.csproj" />
</ItemGroup>
</Project>

5
templates/mvc/src/MyCompanyName.MyProjectName.Web/MyProjectNameWebModule.cs

@ -1,4 +1,5 @@
using System.IO;
using System.Linq;
using Localization.Resources.AbpUi;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
@ -7,6 +8,7 @@ using Microsoft.Extensions.DependencyInjection;
using MyCompanyName.MyProjectName.EntityFrameworkCore;
using MyCompanyName.MyProjectName.Localization.MyProjectName;
using MyCompanyName.MyProjectName.Menus;
using MyCompanyName.MyProjectName.Permissions;
using Swashbuckle.AspNetCore.Swagger;
using Volo.Abp;
using Volo.Abp.Account.Web;
@ -204,7 +206,8 @@ namespace MyCompanyName.MyProjectName
.GetRequiredService<IIdentityDataSeeder>()
.SeedAsync(
"1q2w3E*",
IdentityPermissions.GetAll() //.Union(MyProjectNamePermissions.GetAll())
IdentityPermissions.GetAll()
.Union(MyProjectNamePermissions.GetAll())
);
});
}

Loading…
Cancel
Save