|
|
|
@ -0,0 +1,212 @@
|
|
|
|
|
using System;
|
|
|
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
|
|
|
|
|
|
namespace Acme.BookStore.Migrations
|
|
|
|
|
{
|
|
|
|
|
public partial class Removed_Audit_Setting_Permission_Modules : Migration
|
|
|
|
|
{
|
|
|
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
|
|
|
{
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "AbpAuditLogActions");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "AbpEntityPropertyChanges");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "AbpPermissionGrants");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "AbpSettings");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "AbpEntityChanges");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "AbpAuditLogs");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
|
|
|
{
|
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
|
name: "AbpAuditLogs",
|
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
|
|
|
ApplicationName = table.Column<string>(type: "nvarchar(96)", maxLength: 96, nullable: true),
|
|
|
|
|
BrowserInfo = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true),
|
|
|
|
|
ClientId = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
|
|
|
|
|
ClientIpAddress = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
|
|
|
|
|
ClientName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
|
|
|
|
|
Comments = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
|
|
|
|
|
ConcurrencyStamp = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
|
|
|
CorrelationId = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
|
|
|
|
|
Exceptions = table.Column<string>(type: "nvarchar(4000)", maxLength: 4000, nullable: true),
|
|
|
|
|
ExecutionDuration = table.Column<int>(type: "int", nullable: false),
|
|
|
|
|
ExecutionTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
|
|
|
|
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
|
|
|
HttpMethod = table.Column<string>(type: "nvarchar(16)", maxLength: 16, nullable: true),
|
|
|
|
|
HttpStatusCode = table.Column<int>(type: "int", nullable: true),
|
|
|
|
|
ImpersonatorTenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
|
|
|
|
ImpersonatorUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
|
|
|
|
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
|
|
|
|
TenantName = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
|
|
|
Url = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
|
|
|
|
|
UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
|
|
|
|
UserName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true)
|
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
|
{
|
|
|
|
|
table.PrimaryKey("PK_AbpAuditLogs", x => x.Id);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
|
name: "AbpPermissionGrants",
|
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
|
|
|
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
|
|
|
|
|
ProviderKey = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
|
|
|
|
|
ProviderName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
|
|
|
|
|
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true)
|
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
|
{
|
|
|
|
|
table.PrimaryKey("PK_AbpPermissionGrants", x => x.Id);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
|
name: "AbpSettings",
|
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
|
|
|
Name = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
|
|
|
|
|
ProviderKey = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
|
|
|
|
|
ProviderName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
|
|
|
|
|
Value = table.Column<string>(type: "nvarchar(2048)", maxLength: 2048, nullable: false)
|
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
|
{
|
|
|
|
|
table.PrimaryKey("PK_AbpSettings", x => x.Id);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
migrationBuilder.CreateTable(
|
|
|
|
|
name: "AbpAuditLogActions",
|
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
|
|
|
AuditLogId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
|
|
|
ExecutionDuration = table.Column<int>(type: "int", nullable: false),
|
|
|
|
|
ExecutionTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
|
|
|
|
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
|
|
|
MethodName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
|
|
|
|
|
Parameters = table.Column<string>(type: "nvarchar(2000)", maxLength: 2000, nullable: true),
|
|
|
|
|
ServiceName = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
|
|
|
|
|
TenantId = table.Column<Guid>(type: "uniqueidentifier", 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>(type: "uniqueidentifier", nullable: false),
|
|
|
|
|
AuditLogId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
|
|
|
ChangeTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
|
|
|
|
ChangeType = table.Column<byte>(type: "tinyint", nullable: false),
|
|
|
|
|
EntityId = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
|
|
|
|
|
EntityTenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
|
|
|
|
EntityTypeFullName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
|
|
|
|
|
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
|
|
|
TenantId = table.Column<Guid>(type: "uniqueidentifier", 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: "AbpEntityPropertyChanges",
|
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
|
|
|
EntityChangeId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
|
|
|
NewValue = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true),
|
|
|
|
|
OriginalValue = table.Column<string>(type: "nvarchar(512)", maxLength: 512, nullable: true),
|
|
|
|
|
PropertyName = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: false),
|
|
|
|
|
PropertyTypeFullName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false),
|
|
|
|
|
TenantId = table.Column<Guid>(type: "uniqueidentifier", 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);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
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_AbpSettings_Name_ProviderName_ProviderKey",
|
|
|
|
|
table: "AbpSettings",
|
|
|
|
|
columns: new[] { "Name", "ProviderName", "ProviderKey" });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|