mirror of https://github.com/abpframework/eventhub
3 changed files with 3951 additions and 9 deletions
File diff suppressed because it is too large
@ -0,0 +1,243 @@ |
|||
using System; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace EventHub.Migrations |
|||
{ |
|||
/// <inheritdoc />
|
|||
public partial class Upgrade_Abp_Version_10_4 : Migration |
|||
{ |
|||
/// <inheritdoc />
|
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropIndex( |
|||
name: "IX_AbpPermissions_Name", |
|||
table: "AbpPermissions"); |
|||
|
|||
migrationBuilder.AddColumn<DateTimeOffset>( |
|||
name: "LastSignInTime", |
|||
table: "AbpUsers", |
|||
type: "timestamp with time zone", |
|||
nullable: true); |
|||
|
|||
migrationBuilder.AddColumn<bool>( |
|||
name: "Leaved", |
|||
table: "AbpUsers", |
|||
type: "boolean", |
|||
nullable: false, |
|||
defaultValue: false); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "DeviceInfo", |
|||
table: "AbpSessions", |
|||
type: "character varying(256)", |
|||
maxLength: 256, |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldType: "character varying(64)", |
|||
oldMaxLength: 64, |
|||
oldNullable: true); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "GroupName", |
|||
table: "AbpPermissions", |
|||
type: "character varying(128)", |
|||
maxLength: 128, |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldType: "character varying(128)", |
|||
oldMaxLength: 128); |
|||
|
|||
migrationBuilder.AddColumn<string>( |
|||
name: "ManagementPermissionName", |
|||
table: "AbpPermissions", |
|||
type: "character varying(128)", |
|||
maxLength: 128, |
|||
nullable: true); |
|||
|
|||
migrationBuilder.AddColumn<string>( |
|||
name: "ResourceName", |
|||
table: "AbpPermissions", |
|||
type: "character varying(256)", |
|||
maxLength: 256, |
|||
nullable: true); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "PropertyTypeFullName", |
|||
table: "AbpEntityPropertyChanges", |
|||
type: "character varying(512)", |
|||
maxLength: 512, |
|||
nullable: false, |
|||
oldClrType: typeof(string), |
|||
oldType: "character varying(64)", |
|||
oldMaxLength: 64); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "EntityTypeFullName", |
|||
table: "AbpEntityChanges", |
|||
type: "character varying(512)", |
|||
maxLength: 512, |
|||
nullable: false, |
|||
oldClrType: typeof(string), |
|||
oldType: "character varying(128)", |
|||
oldMaxLength: 128); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "AbpResourcePermissionGrants", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(type: "uuid", nullable: false), |
|||
TenantId = table.Column<Guid>(type: "uuid", nullable: true), |
|||
Name = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false), |
|||
ProviderName = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false), |
|||
ProviderKey = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false), |
|||
ResourceName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false), |
|||
ResourceKey = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_AbpResourcePermissionGrants", x => x.Id); |
|||
}); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "AbpUserPasskeys", |
|||
columns: table => new |
|||
{ |
|||
CredentialId = table.Column<byte[]>(type: "bytea", maxLength: 1024, nullable: false), |
|||
TenantId = table.Column<Guid>(type: "uuid", nullable: true), |
|||
UserId = table.Column<Guid>(type: "uuid", nullable: false), |
|||
Data = table.Column<string>(type: "jsonb", nullable: true) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_AbpUserPasskeys", x => x.CredentialId); |
|||
table.ForeignKey( |
|||
name: "FK_AbpUserPasskeys_AbpUsers_UserId", |
|||
column: x => x.UserId, |
|||
principalTable: "AbpUsers", |
|||
principalColumn: "Id", |
|||
onDelete: ReferentialAction.Cascade); |
|||
}); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "AbpUserPasswordHistories", |
|||
columns: table => new |
|||
{ |
|||
UserId = table.Column<Guid>(type: "uuid", nullable: false), |
|||
Password = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false), |
|||
TenantId = table.Column<Guid>(type: "uuid", nullable: true), |
|||
CreatedAt = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_AbpUserPasswordHistories", x => new { x.UserId, x.Password }); |
|||
table.ForeignKey( |
|||
name: "FK_AbpUserPasswordHistories_AbpUsers_UserId", |
|||
column: x => x.UserId, |
|||
principalTable: "AbpUsers", |
|||
principalColumn: "Id", |
|||
onDelete: ReferentialAction.Cascade); |
|||
}); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpPermissions_ResourceName_Name", |
|||
table: "AbpPermissions", |
|||
columns: new[] { "ResourceName", "Name" }, |
|||
unique: true); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpResourcePermissionGrants_TenantId_Name_ResourceName_Reso~", |
|||
table: "AbpResourcePermissionGrants", |
|||
columns: new[] { "TenantId", "Name", "ResourceName", "ResourceKey", "ProviderName", "ProviderKey" }, |
|||
unique: true); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpUserPasskeys_UserId", |
|||
table: "AbpUserPasskeys", |
|||
column: "UserId"); |
|||
} |
|||
|
|||
/// <inheritdoc />
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropTable( |
|||
name: "AbpResourcePermissionGrants"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "AbpUserPasskeys"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "AbpUserPasswordHistories"); |
|||
|
|||
migrationBuilder.DropIndex( |
|||
name: "IX_AbpPermissions_ResourceName_Name", |
|||
table: "AbpPermissions"); |
|||
|
|||
migrationBuilder.DropColumn( |
|||
name: "LastSignInTime", |
|||
table: "AbpUsers"); |
|||
|
|||
migrationBuilder.DropColumn( |
|||
name: "Leaved", |
|||
table: "AbpUsers"); |
|||
|
|||
migrationBuilder.DropColumn( |
|||
name: "ManagementPermissionName", |
|||
table: "AbpPermissions"); |
|||
|
|||
migrationBuilder.DropColumn( |
|||
name: "ResourceName", |
|||
table: "AbpPermissions"); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "DeviceInfo", |
|||
table: "AbpSessions", |
|||
type: "character varying(64)", |
|||
maxLength: 64, |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldType: "character varying(256)", |
|||
oldMaxLength: 256, |
|||
oldNullable: true); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "GroupName", |
|||
table: "AbpPermissions", |
|||
type: "character varying(128)", |
|||
maxLength: 128, |
|||
nullable: false, |
|||
defaultValue: "", |
|||
oldClrType: typeof(string), |
|||
oldType: "character varying(128)", |
|||
oldMaxLength: 128, |
|||
oldNullable: true); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "PropertyTypeFullName", |
|||
table: "AbpEntityPropertyChanges", |
|||
type: "character varying(64)", |
|||
maxLength: 64, |
|||
nullable: false, |
|||
oldClrType: typeof(string), |
|||
oldType: "character varying(512)", |
|||
oldMaxLength: 512); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "EntityTypeFullName", |
|||
table: "AbpEntityChanges", |
|||
type: "character varying(128)", |
|||
maxLength: 128, |
|||
nullable: false, |
|||
oldClrType: typeof(string), |
|||
oldType: "character varying(512)", |
|||
oldMaxLength: 512); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_AbpPermissions_Name", |
|||
table: "AbpPermissions", |
|||
column: "Name", |
|||
unique: true); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue