Browse Source

Merge pull request #170 from jflaga/fix/AbpPermissionGroups-error

Fix for the error 'relation "AbpPermissionGroups" does not exist'
pull/174/head
Galip Tolga Erdem 3 years ago
committed by GitHub
parent
commit
3a4767c6cd
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 551
      services/administration/src/EShopOnAbp.AdministrationService.EntityFrameworkCore/Migrations/20230509155128_Add-Permissions-And-PermissionGroups-Tables.Designer.cs
  2. 76
      services/administration/src/EShopOnAbp.AdministrationService.EntityFrameworkCore/Migrations/20230509155128_Add-Permissions-And-PermissionGroups-Tables.cs
  3. 81
      services/administration/src/EShopOnAbp.AdministrationService.EntityFrameworkCore/Migrations/AdministrationServiceDbContextModelSnapshot.cs

551
services/administration/src/EShopOnAbp.AdministrationService.EntityFrameworkCore/Migrations/20230509155128_Add-Permissions-And-PermissionGroups-Tables.Designer.cs

@ -0,0 +1,551 @@
// <auto-generated />
using System;
using EShopOnAbp.AdministrationService.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using Volo.Abp.EntityFrameworkCore;
#nullable disable
namespace EShopOnAbp.AdministrationService.Migrations
{
[DbContext(typeof(AdministrationServiceDbContext))]
[Migration("20230509155128_Add-Permissions-And-PermissionGroups-Tables")]
partial class AddPermissionsAndPermissionGroupsTables
{
/// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.PostgreSql)
.HasAnnotation("ProductVersion", "7.0.1")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uuid");
b.Property<string>("ApplicationName")
.HasMaxLength(96)
.HasColumnType("character varying(96)")
.HasColumnName("ApplicationName");
b.Property<string>("BrowserInfo")
.HasMaxLength(512)
.HasColumnType("character varying(512)")
.HasColumnName("BrowserInfo");
b.Property<string>("ClientId")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasColumnName("ClientId");
b.Property<string>("ClientIpAddress")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasColumnName("ClientIpAddress");
b.Property<string>("ClientName")
.HasMaxLength(128)
.HasColumnType("character varying(128)")
.HasColumnName("ClientName");
b.Property<string>("Comments")
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasColumnName("Comments");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("character varying(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<string>("CorrelationId")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasColumnName("CorrelationId");
b.Property<string>("Exceptions")
.HasColumnType("text");
b.Property<int>("ExecutionDuration")
.HasColumnType("integer")
.HasColumnName("ExecutionDuration");
b.Property<DateTime>("ExecutionTime")
.HasColumnType("timestamp without time zone");
b.Property<string>("ExtraProperties")
.HasColumnType("text")
.HasColumnName("ExtraProperties");
b.Property<string>("HttpMethod")
.HasMaxLength(16)
.HasColumnType("character varying(16)")
.HasColumnName("HttpMethod");
b.Property<int?>("HttpStatusCode")
.HasColumnType("integer")
.HasColumnName("HttpStatusCode");
b.Property<Guid?>("ImpersonatorTenantId")
.HasColumnType("uuid")
.HasColumnName("ImpersonatorTenantId");
b.Property<string>("ImpersonatorTenantName")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasColumnName("ImpersonatorTenantName");
b.Property<Guid?>("ImpersonatorUserId")
.HasColumnType("uuid")
.HasColumnName("ImpersonatorUserId");
b.Property<string>("ImpersonatorUserName")
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasColumnName("ImpersonatorUserName");
b.Property<Guid?>("TenantId")
.HasColumnType("uuid")
.HasColumnName("TenantId");
b.Property<string>("TenantName")
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasColumnName("TenantName");
b.Property<string>("Url")
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasColumnName("Url");
b.Property<Guid?>("UserId")
.HasColumnType("uuid")
.HasColumnName("UserId");
b.Property<string>("UserName")
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasColumnName("UserName");
b.HasKey("Id");
b.HasIndex("TenantId", "ExecutionTime");
b.HasIndex("TenantId", "UserId", "ExecutionTime");
b.ToTable("AbpAuditLogs", (string)null);
});
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uuid");
b.Property<Guid>("AuditLogId")
.HasColumnType("uuid")
.HasColumnName("AuditLogId");
b.Property<int>("ExecutionDuration")
.HasColumnType("integer")
.HasColumnName("ExecutionDuration");
b.Property<DateTime>("ExecutionTime")
.HasColumnType("timestamp without time zone")
.HasColumnName("ExecutionTime");
b.Property<string>("ExtraProperties")
.HasColumnType("text")
.HasColumnName("ExtraProperties");
b.Property<string>("MethodName")
.HasMaxLength(128)
.HasColumnType("character varying(128)")
.HasColumnName("MethodName");
b.Property<string>("Parameters")
.HasMaxLength(2000)
.HasColumnType("character varying(2000)")
.HasColumnName("Parameters");
b.Property<string>("ServiceName")
.HasMaxLength(256)
.HasColumnType("character varying(256)")
.HasColumnName("ServiceName");
b.Property<Guid?>("TenantId")
.HasColumnType("uuid")
.HasColumnName("TenantId");
b.HasKey("Id");
b.HasIndex("AuditLogId");
b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime");
b.ToTable("AbpAuditLogActions", (string)null);
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uuid");
b.Property<Guid>("AuditLogId")
.HasColumnType("uuid")
.HasColumnName("AuditLogId");
b.Property<DateTime>("ChangeTime")
.HasColumnType("timestamp without time zone")
.HasColumnName("ChangeTime");
b.Property<byte>("ChangeType")
.HasColumnType("smallint")
.HasColumnName("ChangeType");
b.Property<string>("EntityId")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)")
.HasColumnName("EntityId");
b.Property<Guid?>("EntityTenantId")
.HasColumnType("uuid");
b.Property<string>("EntityTypeFullName")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)")
.HasColumnName("EntityTypeFullName");
b.Property<string>("ExtraProperties")
.HasColumnType("text")
.HasColumnName("ExtraProperties");
b.Property<Guid?>("TenantId")
.HasColumnType("uuid")
.HasColumnName("TenantId");
b.HasKey("Id");
b.HasIndex("AuditLogId");
b.HasIndex("TenantId", "EntityTypeFullName", "EntityId");
b.ToTable("AbpEntityChanges", (string)null);
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uuid");
b.Property<Guid>("EntityChangeId")
.HasColumnType("uuid");
b.Property<string>("NewValue")
.HasMaxLength(512)
.HasColumnType("character varying(512)")
.HasColumnName("NewValue");
b.Property<string>("OriginalValue")
.HasMaxLength(512)
.HasColumnType("character varying(512)")
.HasColumnName("OriginalValue");
b.Property<string>("PropertyName")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)")
.HasColumnName("PropertyName");
b.Property<string>("PropertyTypeFullName")
.IsRequired()
.HasMaxLength(64)
.HasColumnType("character varying(64)")
.HasColumnName("PropertyTypeFullName");
b.Property<Guid?>("TenantId")
.HasColumnType("uuid")
.HasColumnName("TenantId");
b.HasKey("Id");
b.HasIndex("EntityChangeId");
b.ToTable("AbpEntityPropertyChanges", (string)null);
});
modelBuilder.Entity("Volo.Abp.BlobStoring.Database.DatabaseBlob", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uuid");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("character varying(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<Guid>("ContainerId")
.HasColumnType("uuid");
b.Property<byte[]>("Content")
.HasMaxLength(2147483647)
.HasColumnType("bytea");
b.Property<string>("ExtraProperties")
.HasColumnType("text")
.HasColumnName("ExtraProperties");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<Guid?>("TenantId")
.HasColumnType("uuid")
.HasColumnName("TenantId");
b.HasKey("Id");
b.HasIndex("ContainerId");
b.HasIndex("TenantId", "ContainerId", "Name");
b.ToTable("AbpBlobs", (string)null);
});
modelBuilder.Entity("Volo.Abp.BlobStoring.Database.DatabaseBlobContainer", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uuid");
b.Property<string>("ConcurrencyStamp")
.IsConcurrencyToken()
.HasMaxLength(40)
.HasColumnType("character varying(40)")
.HasColumnName("ConcurrencyStamp");
b.Property<string>("ExtraProperties")
.HasColumnType("text")
.HasColumnName("ExtraProperties");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<Guid?>("TenantId")
.HasColumnType("uuid")
.HasColumnName("TenantId");
b.HasKey("Id");
b.HasIndex("TenantId", "Name");
b.ToTable("AbpBlobContainers", (string)null);
});
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uuid");
b.Property<string>("DisplayName")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("ExtraProperties")
.HasColumnType("text")
.HasColumnName("ExtraProperties");
b.Property<string>("GroupName")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<bool>("IsEnabled")
.HasColumnType("boolean");
b.Property<byte>("MultiTenancySide")
.HasColumnType("smallint");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<string>("ParentName")
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<string>("Providers")
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<string>("StateCheckers")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.HasKey("Id");
b.HasIndex("GroupName");
b.HasIndex("Name")
.IsUnique();
b.ToTable("AbpPermissions", (string)null);
});
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b =>
{
b.Property<Guid>("Id")
.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<Guid?>("TenantId")
.HasColumnType("uuid")
.HasColumnName("TenantId");
b.HasKey("Id");
b.HasIndex("TenantId", "Name", "ProviderName", "ProviderKey")
.IsUnique();
b.ToTable("AbpPermissionGrants", (string)null);
});
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uuid");
b.Property<string>("DisplayName")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("ExtraProperties")
.HasColumnType("text")
.HasColumnName("ExtraProperties");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.HasKey("Id");
b.HasIndex("Name")
.IsUnique();
b.ToTable("AbpPermissionGroups", (string)null);
});
modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uuid");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<string>("ProviderKey")
.HasMaxLength(64)
.HasColumnType("character varying(64)");
b.Property<string>("ProviderName")
.HasMaxLength(64)
.HasColumnType("character varying(64)");
b.Property<string>("Value")
.IsRequired()
.HasMaxLength(2048)
.HasColumnType("character varying(2048)");
b.HasKey("Id");
b.HasIndex("Name", "ProviderName", "ProviderKey")
.IsUnique();
b.ToTable("AbpSettings", (string)null);
});
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b =>
{
b.HasOne("Volo.Abp.AuditLogging.AuditLog", null)
.WithMany("Actions")
.HasForeignKey("AuditLogId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b =>
{
b.HasOne("Volo.Abp.AuditLogging.AuditLog", null)
.WithMany("EntityChanges")
.HasForeignKey("AuditLogId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b =>
{
b.HasOne("Volo.Abp.AuditLogging.EntityChange", null)
.WithMany("PropertyChanges")
.HasForeignKey("EntityChangeId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.BlobStoring.Database.DatabaseBlob", b =>
{
b.HasOne("Volo.Abp.BlobStoring.Database.DatabaseBlobContainer", null)
.WithMany()
.HasForeignKey("ContainerId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b =>
{
b.Navigation("Actions");
b.Navigation("EntityChanges");
});
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b =>
{
b.Navigation("PropertyChanges");
});
#pragma warning restore 612, 618
}
}
}

76
services/administration/src/EShopOnAbp.AdministrationService.EntityFrameworkCore/Migrations/20230509155128_Add-Permissions-And-PermissionGroups-Tables.cs

@ -0,0 +1,76 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace EShopOnAbp.AdministrationService.Migrations
{
/// <inheritdoc />
public partial class AddPermissionsAndPermissionGroupsTables : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AbpPermissionGroups",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
Name = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
DisplayName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
ExtraProperties = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpPermissionGroups", x => x.Id);
});
migrationBuilder.CreateTable(
name: "AbpPermissions",
columns: table => new
{
Id = table.Column<Guid>(type: "uuid", nullable: false),
GroupName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
Name = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: false),
ParentName = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true),
DisplayName = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false),
IsEnabled = table.Column<bool>(type: "boolean", nullable: false),
MultiTenancySide = table.Column<byte>(type: "smallint", nullable: false),
Providers = table.Column<string>(type: "character varying(128)", maxLength: 128, nullable: true),
StateCheckers = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: true),
ExtraProperties = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AbpPermissions", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_AbpPermissionGroups_Name",
table: "AbpPermissionGroups",
column: "Name",
unique: true);
migrationBuilder.CreateIndex(
name: "IX_AbpPermissions_GroupName",
table: "AbpPermissions",
column: "GroupName");
migrationBuilder.CreateIndex(
name: "IX_AbpPermissions_Name",
table: "AbpPermissions",
column: "Name",
unique: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AbpPermissionGroups");
migrationBuilder.DropTable(
name: "AbpPermissions");
}
}
}

81
services/administration/src/EShopOnAbp.AdministrationService.EntityFrameworkCore/Migrations/AdministrationServiceDbContextModelSnapshot.cs

@ -19,7 +19,7 @@ namespace EShopOnAbp.AdministrationService.Migrations
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.PostgreSql)
.HasAnnotation("ProductVersion", "6.0.1")
.HasAnnotation("ProductVersion", "7.0.1")
.HasAnnotation("Relational:MaxIdentifierLength", 63);
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
@ -353,6 +353,58 @@ namespace EShopOnAbp.AdministrationService.Migrations
b.ToTable("AbpBlobContainers", (string)null);
});
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionDefinitionRecord", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uuid");
b.Property<string>("DisplayName")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("ExtraProperties")
.HasColumnType("text")
.HasColumnName("ExtraProperties");
b.Property<string>("GroupName")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<bool>("IsEnabled")
.HasColumnType("boolean");
b.Property<byte>("MultiTenancySide")
.HasColumnType("smallint");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<string>("ParentName")
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<string>("Providers")
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.Property<string>("StateCheckers")
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.HasKey("Id");
b.HasIndex("GroupName");
b.HasIndex("Name")
.IsUnique();
b.ToTable("AbpPermissions", (string)null);
});
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b =>
{
b.Property<Guid>("Id")
@ -385,6 +437,33 @@ namespace EShopOnAbp.AdministrationService.Migrations
b.ToTable("AbpPermissionGrants", (string)null);
});
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGroupDefinitionRecord", b =>
{
b.Property<Guid>("Id")
.HasColumnType("uuid");
b.Property<string>("DisplayName")
.IsRequired()
.HasMaxLength(256)
.HasColumnType("character varying(256)");
b.Property<string>("ExtraProperties")
.HasColumnType("text")
.HasColumnName("ExtraProperties");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("character varying(128)");
b.HasKey("Id");
b.HasIndex("Name")
.IsUnique();
b.ToTable("AbpPermissionGroups", (string)null);
});
modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b =>
{
b.Property<Guid>("Id")

Loading…
Cancel
Save