Browse Source

Add ABP 10.4 EF migration

pull/152/head
Engincan VESKE 3 months ago
parent
commit
622f4523e4
  1. 3539
      src/EventHub.EntityFrameworkCore/Migrations/20260618143857_Upgrade_Abp_Version_10_4.Designer.cs
  2. 243
      src/EventHub.EntityFrameworkCore/Migrations/20260618143857_Upgrade_Abp_Version_10_4.cs
  3. 178
      src/EventHub.EntityFrameworkCore/Migrations/EventHubDbContextModelSnapshot.cs

3539
src/EventHub.EntityFrameworkCore/Migrations/20260618143857_Upgrade_Abp_Version_10_4.Designer.cs

File diff suppressed because it is too large

243
src/EventHub.EntityFrameworkCore/Migrations/20260618143857_Upgrade_Abp_Version_10_4.cs

@ -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);
}
}
}

178
src/EventHub.EntityFrameworkCore/Migrations/EventHubDbContextModelSnapshot.cs

@ -19,7 +19,7 @@ namespace EventHub.Migrations
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.PostgreSql)
.HasAnnotation("ProductVersion", "9.0.5")
.HasAnnotation("ProductVersion", "10.0.9")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
@ -726,8 +726,8 @@ namespace EventHub.Migrations
b.Property<string>("EntityTypeFullName")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)")
.HasMaxLength(512)
.HasColumnType("character varying(512)")
.HasColumnName("EntityTypeFullName");
b.Property<string>("ExtraProperties")
@ -774,8 +774,8 @@ namespace EventHub.Migrations
b.Property<string>("PropertyTypeFullName")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasMaxLength(512)
.HasColumnType("character varying(512)")
.HasColumnName("PropertyTypeFullName");
b.Property<Guid?>("TenantId")
@ -1183,8 +1183,8 @@ namespace EventHub.Migrations
.HasColumnType("character varying(64)");
b.Property<string>("DeviceInfo")
.HasMaxLength(64)
.HasColumnType("character varying(64)");
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("ExtraProperties")
.HasColumnType("text")
@ -1304,6 +1304,15 @@ namespace EventHub.Migrations
b.Property<DateTimeOffset?>("LastPasswordChangeTime")
.HasColumnType("timestamp with time zone");
b.Property<DateTimeOffset?>("LastSignInTime")
.HasColumnType("timestamp with time zone");
b.Property<bool>("Leaved")
.ValueGeneratedOnAdd()
.HasColumnType("boolean")
.HasDefaultValue(false)
.HasColumnName("Leaved");
b.Property<bool>("LockoutEnabled")
.ValueGeneratedOnAdd()
.HasColumnType("boolean")
@ -1499,6 +1508,47 @@ namespace EventHub.Migrations
b.ToTable("AbpUserOrganizationUnits", (string)null);
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserPasskey", b =>
{
b.Property<byte[]>("CredentialId")
.HasMaxLength(1024)
.HasColumnType("bytea");
b.Property<Guid?>("TenantId")
.HasColumnType("uuid")
.HasColumnName("TenantId");
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.HasKey("CredentialId");
b.HasIndex("UserId");
b.ToTable("AbpUserPasskeys", (string)null);
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserPasswordHistory", b =>
{
b.Property<Guid>("UserId")
.HasColumnType("uuid");
b.Property<string>("Password")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<DateTimeOffset>("CreatedAt")
.HasColumnType("timestamp with time zone");
b.Property<Guid?>("TenantId")
.HasColumnType("uuid")
.HasColumnName("TenantId");
b.HasKey("UserId", "Password");
b.ToTable("AbpUserPasswordHistories", (string)null);
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b =>
{
b.Property<Guid>("UserId")
@ -2503,13 +2553,16 @@ namespace EventHub.Migrations
.HasColumnName("ExtraProperties");
b.Property<string>("GroupName")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<bool>("IsEnabled")
.HasColumnType("boolean");
b.Property<string>("ManagementPermissionName")
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<byte>("MultiTenancySide")
.HasColumnType("smallint");
@ -2526,6 +2579,10 @@ namespace EventHub.Migrations
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<string>("ResourceName")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("StateCheckers")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
@ -2534,7 +2591,7 @@ namespace EventHub.Migrations
b.HasIndex("GroupName");
b.HasIndex("Name")
b.HasIndex("ResourceName", "Name")
.IsUnique();
b.ToTable("AbpPermissions", (string)null);
@ -2601,6 +2658,49 @@ namespace EventHub.Migrations
b.ToTable("AbpPermissionGroups", (string)null);
});
modelBuilder.Entity("Volo.Abp.PermissionManagement.ResourcePermissionGrant", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uuid");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<string>("ProviderKey")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)");
b.Property<string>("ProviderName")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)");
b.Property<string>("ResourceKey")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("ResourceName")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<Guid?>("TenantId")
.HasColumnType("uuid")
.HasColumnName("TenantId");
b.HasKey("Id");
b.HasIndex("TenantId", "Name", "ResourceName", "ResourceKey", "ProviderName", "ProviderKey")
.IsUnique();
b.ToTable("AbpResourcePermissionGrants", (string)null);
});
modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b =>
{
b.Property<Guid>("Id")
@ -3076,6 +3176,62 @@ namespace EventHub.Migrations
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserPasskey", b =>
{
b.HasOne("Volo.Abp.Identity.IdentityUser", null)
.WithMany("Passkeys")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.OwnsOne("Volo.Abp.Identity.IdentityPasskeyData", "Data", b1 =>
{
b1.Property<byte[]>("IdentityUserPasskeyCredentialId");
b1.Property<byte[]>("AttestationObject");
b1.Property<byte[]>("ClientDataJson");
b1.Property<DateTimeOffset>("CreatedAt");
b1.Property<bool>("IsBackedUp");
b1.Property<bool>("IsBackupEligible");
b1.Property<bool>("IsUserVerified");
b1.Property<string>("Name");
b1.Property<byte[]>("PublicKey");
b1.Property<long>("SignCount");
b1.PrimitiveCollection<string>("Transports");
b1.HasKey("IdentityUserPasskeyCredentialId");
b1.ToTable("AbpUserPasskeys");
b1
.ToJson("Data")
.HasColumnType("jsonb");
b1.WithOwner()
.HasForeignKey("IdentityUserPasskeyCredentialId");
});
b.Navigation("Data");
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserPasswordHistory", b =>
{
b.HasOne("Volo.Abp.Identity.IdentityUser", null)
.WithMany("PasswordHistories")
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b =>
{
b.HasOne("Volo.Abp.Identity.IdentityRole", null)
@ -3315,6 +3471,10 @@ namespace EventHub.Migrations
b.Navigation("OrganizationUnits");
b.Navigation("Passkeys");
b.Navigation("PasswordHistories");
b.Navigation("Roles");
b.Navigation("Tokens");

Loading…
Cancel
Save