mirror of https://github.com/abpframework/abp.git
committed by
GitHub
6 changed files with 943 additions and 308 deletions
@ -0,0 +1,226 @@ |
|||
using System; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
namespace Volo.BloggingTestApp.EntityFrameworkCore.Migrations |
|||
{ |
|||
public partial class Added_SecurityLogs : Migration |
|||
{ |
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "ConcurrencyStamp", |
|||
table: "BlgUsers", |
|||
maxLength: 40, |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldType: "nvarchar(max)", |
|||
oldNullable: true); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "ConcurrencyStamp", |
|||
table: "BlgTags", |
|||
maxLength: 40, |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldType: "nvarchar(max)", |
|||
oldNullable: true); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "ConcurrencyStamp", |
|||
table: "BlgPosts", |
|||
maxLength: 40, |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldType: "nvarchar(max)", |
|||
oldNullable: true); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "ConcurrencyStamp", |
|||
table: "BlgComments", |
|||
maxLength: 40, |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldType: "nvarchar(max)", |
|||
oldNullable: true); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "ConcurrencyStamp", |
|||
table: "BlgBlogs", |
|||
maxLength: 40, |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldType: "nvarchar(max)", |
|||
oldNullable: true); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "ConcurrencyStamp", |
|||
table: "AbpUsers", |
|||
maxLength: 40, |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldType: "nvarchar(max)", |
|||
oldNullable: true); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "ConcurrencyStamp", |
|||
table: "AbpRoles", |
|||
maxLength: 40, |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldType: "nvarchar(256)", |
|||
oldMaxLength: 256); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "ConcurrencyStamp", |
|||
table: "AbpOrganizationUnits", |
|||
maxLength: 40, |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldType: "nvarchar(max)", |
|||
oldNullable: true); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "ConcurrencyStamp", |
|||
table: "AbpClaimTypes", |
|||
maxLength: 40, |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldType: "nvarchar(256)", |
|||
oldMaxLength: 256); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "AbpSecurityLogs", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(nullable: false), |
|||
ExtraProperties = table.Column<string>(nullable: true), |
|||
ConcurrencyStamp = table.Column<string>(maxLength: 40, nullable: true), |
|||
TenantId = table.Column<Guid>(nullable: true), |
|||
ApplicationName = table.Column<string>(maxLength: 96, nullable: true), |
|||
Identity = table.Column<string>(maxLength: 96, nullable: true), |
|||
Action = table.Column<string>(maxLength: 96, nullable: true), |
|||
UserId = table.Column<Guid>(nullable: true), |
|||
UserName = table.Column<string>(maxLength: 256, nullable: true), |
|||
TenantName = table.Column<string>(maxLength: 64, nullable: true), |
|||
ClientId = table.Column<string>(maxLength: 64, nullable: true), |
|||
CorrelationId = table.Column<string>(maxLength: 64, nullable: true), |
|||
ClientIpAddress = table.Column<string>(maxLength: 64, nullable: true), |
|||
BrowserInfo = table.Column<string>(maxLength: 512, nullable: true), |
|||
CreationTime = table.Column<DateTime>(nullable: false) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_AbpSecurityLogs", x => x.Id); |
|||
}); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpSecurityLogs_TenantId_Action", |
|||
table: "AbpSecurityLogs", |
|||
columns: new[] { "TenantId", "Action" }); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpSecurityLogs_TenantId_ApplicationName", |
|||
table: "AbpSecurityLogs", |
|||
columns: new[] { "TenantId", "ApplicationName" }); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpSecurityLogs_TenantId_Identity", |
|||
table: "AbpSecurityLogs", |
|||
columns: new[] { "TenantId", "Identity" }); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpSecurityLogs_TenantId_UserId", |
|||
table: "AbpSecurityLogs", |
|||
columns: new[] { "TenantId", "UserId" }); |
|||
} |
|||
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropTable( |
|||
name: "AbpSecurityLogs"); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "ConcurrencyStamp", |
|||
table: "BlgUsers", |
|||
type: "nvarchar(max)", |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldMaxLength: 40, |
|||
oldNullable: true); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "ConcurrencyStamp", |
|||
table: "BlgTags", |
|||
type: "nvarchar(max)", |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldMaxLength: 40, |
|||
oldNullable: true); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "ConcurrencyStamp", |
|||
table: "BlgPosts", |
|||
type: "nvarchar(max)", |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldMaxLength: 40, |
|||
oldNullable: true); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "ConcurrencyStamp", |
|||
table: "BlgComments", |
|||
type: "nvarchar(max)", |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldMaxLength: 40, |
|||
oldNullable: true); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "ConcurrencyStamp", |
|||
table: "BlgBlogs", |
|||
type: "nvarchar(max)", |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldMaxLength: 40, |
|||
oldNullable: true); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "ConcurrencyStamp", |
|||
table: "AbpUsers", |
|||
type: "nvarchar(max)", |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldMaxLength: 40, |
|||
oldNullable: true); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "ConcurrencyStamp", |
|||
table: "AbpRoles", |
|||
type: "nvarchar(256)", |
|||
maxLength: 256, |
|||
nullable: false, |
|||
oldClrType: typeof(string), |
|||
oldMaxLength: 40, |
|||
oldNullable: true); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "ConcurrencyStamp", |
|||
table: "AbpOrganizationUnits", |
|||
type: "nvarchar(max)", |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldMaxLength: 40, |
|||
oldNullable: true); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "ConcurrencyStamp", |
|||
table: "AbpClaimTypes", |
|||
type: "nvarchar(256)", |
|||
maxLength: 256, |
|||
nullable: false, |
|||
oldClrType: typeof(string), |
|||
oldMaxLength: 40, |
|||
oldNullable: true); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue