|
|
|
|
@ -7,11 +7,65 @@ namespace Acme.BookStore.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: "AbpBackgroundJobs",
|
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
Id = table.Column<Guid>(nullable: false),
|
|
|
|
|
ExtraProperties = table.Column<string>(nullable: true),
|
|
|
|
|
ConcurrencyStamp = table.Column<string>(nullable: true),
|
|
|
|
|
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: "AbpClaimTypes",
|
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
Id = table.Column<Guid>(nullable: false),
|
|
|
|
|
ExtraProperties = table.Column<string>(nullable: true),
|
|
|
|
|
ConcurrencyStamp = table.Column<string>(maxLength: 256, nullable: false),
|
|
|
|
|
Name = table.Column<string>(maxLength: 256, nullable: false),
|
|
|
|
|
Required = table.Column<bool>(nullable: false),
|
|
|
|
|
IsStatic = table.Column<bool>(nullable: false),
|
|
|
|
|
@ -45,10 +99,11 @@ namespace Acme.BookStore.Migrations
|
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
Id = table.Column<Guid>(nullable: false),
|
|
|
|
|
ExtraProperties = table.Column<string>(nullable: true),
|
|
|
|
|
ConcurrencyStamp = table.Column<string>(maxLength: 256, nullable: false),
|
|
|
|
|
TenantId = table.Column<Guid>(nullable: true),
|
|
|
|
|
Name = table.Column<string>(maxLength: 256, nullable: false),
|
|
|
|
|
NormalizedName = table.Column<string>(maxLength: 256, nullable: false),
|
|
|
|
|
ConcurrencyStamp = table.Column<string>(nullable: true),
|
|
|
|
|
IsDefault = table.Column<bool>(nullable: false),
|
|
|
|
|
IsStatic = table.Column<bool>(nullable: false),
|
|
|
|
|
IsPublic = table.Column<bool>(nullable: false)
|
|
|
|
|
@ -78,11 +133,13 @@ namespace Acme.BookStore.Migrations
|
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
Id = table.Column<Guid>(nullable: false),
|
|
|
|
|
ExtraProperties = table.Column<string>(nullable: true),
|
|
|
|
|
ConcurrencyStamp = table.Column<string>(nullable: true),
|
|
|
|
|
CreationTime = table.Column<DateTime>(nullable: false),
|
|
|
|
|
CreatorId = table.Column<Guid>(nullable: true),
|
|
|
|
|
LastModificationTime = table.Column<DateTime>(nullable: true),
|
|
|
|
|
LastModifierId = table.Column<Guid>(nullable: true),
|
|
|
|
|
IsDeleted = table.Column<bool>(nullable: false),
|
|
|
|
|
IsDeleted = table.Column<bool>(nullable: false, defaultValue: false),
|
|
|
|
|
DeleterId = table.Column<Guid>(nullable: true),
|
|
|
|
|
DeletionTime = table.Column<DateTime>(nullable: true),
|
|
|
|
|
TenantId = table.Column<Guid>(nullable: true),
|
|
|
|
|
@ -95,20 +152,67 @@ namespace Acme.BookStore.Migrations
|
|
|
|
|
EmailConfirmed = table.Column<bool>(nullable: false, defaultValue: false),
|
|
|
|
|
PasswordHash = table.Column<string>(maxLength: 256, nullable: true),
|
|
|
|
|
SecurityStamp = table.Column<string>(maxLength: 256, nullable: false),
|
|
|
|
|
ConcurrencyStamp = table.Column<string>(maxLength: 256, nullable: false),
|
|
|
|
|
PhoneNumber = table.Column<string>(maxLength: 16, nullable: true),
|
|
|
|
|
PhoneNumberConfirmed = table.Column<bool>(nullable: false, defaultValue: false),
|
|
|
|
|
TwoFactorEnabled = table.Column<bool>(nullable: false, defaultValue: false),
|
|
|
|
|
LockoutEnd = table.Column<DateTimeOffset>(nullable: true),
|
|
|
|
|
LockoutEnabled = table.Column<bool>(nullable: false, defaultValue: false),
|
|
|
|
|
AccessFailedCount = table.Column<int>(nullable: false, defaultValue: 0),
|
|
|
|
|
ExtraProperties = table.Column<string>(nullable: true)
|
|
|
|
|
AccessFailedCount = table.Column<int>(nullable: false, defaultValue: 0)
|
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
|
{
|
|
|
|
|
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)
|
|
|
|
|
},
|
|
|
|
|
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
|
|
|
|
|
@ -155,9 +259,9 @@ namespace Acme.BookStore.Migrations
|
|
|
|
|
name: "AbpUserLogins",
|
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
TenantId = table.Column<Guid>(nullable: true),
|
|
|
|
|
UserId = table.Column<Guid>(nullable: false),
|
|
|
|
|
LoginProvider = table.Column<string>(maxLength: 64, nullable: false),
|
|
|
|
|
TenantId = table.Column<Guid>(nullable: true),
|
|
|
|
|
ProviderKey = table.Column<string>(maxLength: 196, nullable: false),
|
|
|
|
|
ProviderDisplayName = table.Column<string>(maxLength: 128, nullable: true)
|
|
|
|
|
},
|
|
|
|
|
@ -176,9 +280,9 @@ namespace Acme.BookStore.Migrations
|
|
|
|
|
name: "AbpUserRoles",
|
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
TenantId = table.Column<Guid>(nullable: true),
|
|
|
|
|
UserId = table.Column<Guid>(nullable: false),
|
|
|
|
|
RoleId = table.Column<Guid>(nullable: false)
|
|
|
|
|
RoleId = table.Column<Guid>(nullable: false),
|
|
|
|
|
TenantId = table.Column<Guid>(nullable: true)
|
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
|
{
|
|
|
|
|
@ -201,10 +305,10 @@ namespace Acme.BookStore.Migrations
|
|
|
|
|
name: "AbpUserTokens",
|
|
|
|
|
columns: table => new
|
|
|
|
|
{
|
|
|
|
|
TenantId = table.Column<Guid>(nullable: true),
|
|
|
|
|
UserId = table.Column<Guid>(nullable: false),
|
|
|
|
|
LoginProvider = table.Column<string>(maxLength: 64, nullable: false),
|
|
|
|
|
Name = table.Column<string>(maxLength: 128, nullable: false),
|
|
|
|
|
TenantId = table.Column<Guid>(nullable: true),
|
|
|
|
|
Value = table.Column<string>(nullable: true)
|
|
|
|
|
},
|
|
|
|
|
constraints: table =>
|
|
|
|
|
@ -218,6 +322,69 @@ namespace Acme.BookStore.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.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_AbpBackgroundJobs_IsAbandoned_NextTryTime",
|
|
|
|
|
table: "AbpBackgroundJobs",
|
|
|
|
|
columns: new[] { "IsAbandoned", "NextTryTime" });
|
|
|
|
|
|
|
|
|
|
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",
|
|
|
|
|
@ -276,9 +443,18 @@ namespace Acme.BookStore.Migrations
|
|
|
|
|
|
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
|
|
|
{
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "AbpAuditLogActions");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "AbpBackgroundJobs");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "AbpClaimTypes");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "AbpEntityPropertyChanges");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "AbpPermissionGrants");
|
|
|
|
|
|
|
|
|
|
@ -300,11 +476,17 @@ namespace Acme.BookStore.Migrations
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "AbpUserTokens");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "AbpEntityChanges");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "AbpRoles");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "AbpUsers");
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
|
|
|
name: "AbpAuditLogs");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|