diff --git a/AbpODataDemo-Core-vNext/aspnet-core/src/AbpODataDemo.Core/AbpODataDemo.Core.csproj b/AbpODataDemo-Core-vNext/aspnet-core/src/AbpODataDemo.Core/AbpODataDemo.Core.csproj index 9c77db9..6e91a09 100644 --- a/AbpODataDemo-Core-vNext/aspnet-core/src/AbpODataDemo.Core/AbpODataDemo.Core.csproj +++ b/AbpODataDemo-Core-vNext/aspnet-core/src/AbpODataDemo.Core/AbpODataDemo.Core.csproj @@ -15,8 +15,8 @@ - - - + + + diff --git a/AbpODataDemo-Core-vNext/aspnet-core/src/AbpODataDemo.EntityFrameworkCore/AbpODataDemo.EntityFrameworkCore.csproj b/AbpODataDemo-Core-vNext/aspnet-core/src/AbpODataDemo.EntityFrameworkCore/AbpODataDemo.EntityFrameworkCore.csproj index 2e99edc..05566a6 100644 --- a/AbpODataDemo-Core-vNext/aspnet-core/src/AbpODataDemo.EntityFrameworkCore/AbpODataDemo.EntityFrameworkCore.csproj +++ b/AbpODataDemo-Core-vNext/aspnet-core/src/AbpODataDemo.EntityFrameworkCore/AbpODataDemo.EntityFrameworkCore.csproj @@ -8,17 +8,12 @@ true - - - - - - - + + all runtime; build; native; contentfiles; analyzers - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/AbpODataDemo-Core-vNext/aspnet-core/src/AbpODataDemo.EntityFrameworkCore/Migrations/20201015053907_Initial.Designer.cs b/AbpODataDemo-Core-vNext/aspnet-core/src/AbpODataDemo.EntityFrameworkCore/Migrations/20201021134318_Initial.Designer.cs similarity index 92% rename from AbpODataDemo-Core-vNext/aspnet-core/src/AbpODataDemo.EntityFrameworkCore/Migrations/20201015053907_Initial.Designer.cs rename to AbpODataDemo-Core-vNext/aspnet-core/src/AbpODataDemo.EntityFrameworkCore/Migrations/20201021134318_Initial.Designer.cs index a983f65..5bba702 100644 --- a/AbpODataDemo-Core-vNext/aspnet-core/src/AbpODataDemo.EntityFrameworkCore/Migrations/20201015053907_Initial.Designer.cs +++ b/AbpODataDemo-Core-vNext/aspnet-core/src/AbpODataDemo.EntityFrameworkCore/Migrations/20201021134318_Initial.Designer.cs @@ -10,14 +10,14 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; namespace AbpODataDemo.Migrations { [DbContext(typeof(AbpODataDemoDbContext))] - [Migration("20201015053907_Initial")] + [Migration("20201021134318_Initial")] partial class Initial { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "3.1.1") + .HasAnnotation("ProductVersion", "3.1.9") .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); @@ -613,6 +613,112 @@ namespace AbpODataDemo.Migrations b.ToTable("AbpSettings"); }); + modelBuilder.Entity("Abp.DynamicEntityProperties.DynamicEntityProperty", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("DynamicPropertyId") + .HasColumnType("int"); + + b.Property("EntityFullName") + .HasColumnType("nvarchar(450)"); + + b.Property("TenantId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("DynamicPropertyId"); + + b.HasIndex("EntityFullName", "DynamicPropertyId", "TenantId") + .IsUnique() + .HasFilter("[EntityFullName] IS NOT NULL AND [TenantId] IS NOT NULL"); + + b.ToTable("AbpDynamicEntityProperties"); + }); + + modelBuilder.Entity("Abp.DynamicEntityProperties.DynamicEntityPropertyValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("DynamicEntityPropertyId") + .HasColumnType("int"); + + b.Property("EntityId") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("DynamicEntityPropertyId"); + + b.ToTable("AbpDynamicEntityPropertyValues"); + }); + + modelBuilder.Entity("Abp.DynamicEntityProperties.DynamicProperty", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("InputType") + .HasColumnType("nvarchar(max)"); + + b.Property("Permission") + .HasColumnType("nvarchar(max)"); + + b.Property("PropertyName") + .HasColumnType("nvarchar(450)"); + + b.Property("TenantId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("PropertyName", "TenantId") + .IsUnique() + .HasFilter("[PropertyName] IS NOT NULL AND [TenantId] IS NOT NULL"); + + b.ToTable("AbpDynamicProperties"); + }); + + modelBuilder.Entity("Abp.DynamicEntityProperties.DynamicPropertyValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("DynamicPropertyId") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("DynamicPropertyId"); + + b.ToTable("AbpDynamicPropertyValues"); + }); + modelBuilder.Entity("Abp.EntityHistory.EntityChange", b => { b.Property("Id") @@ -1645,6 +1751,33 @@ namespace AbpODataDemo.Migrations .HasForeignKey("UserId"); }); + modelBuilder.Entity("Abp.DynamicEntityProperties.DynamicEntityProperty", b => + { + b.HasOne("Abp.DynamicEntityProperties.DynamicProperty", "DynamicProperty") + .WithMany() + .HasForeignKey("DynamicPropertyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Abp.DynamicEntityProperties.DynamicEntityPropertyValue", b => + { + b.HasOne("Abp.DynamicEntityProperties.DynamicEntityProperty", "DynamicEntityProperty") + .WithMany() + .HasForeignKey("DynamicEntityPropertyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Abp.DynamicEntityProperties.DynamicPropertyValue", b => + { + b.HasOne("Abp.DynamicEntityProperties.DynamicProperty", "DynamicProperty") + .WithMany("DynamicPropertyValues") + .HasForeignKey("DynamicPropertyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + modelBuilder.Entity("Abp.EntityHistory.EntityChange", b => { b.HasOne("Abp.EntityHistory.EntityChangeSet", null) diff --git a/AbpODataDemo-Core-vNext/aspnet-core/src/AbpODataDemo.EntityFrameworkCore/Migrations/20201015053907_Initial.cs b/AbpODataDemo-Core-vNext/aspnet-core/src/AbpODataDemo.EntityFrameworkCore/Migrations/20201021134318_Initial.cs similarity index 91% rename from AbpODataDemo-Core-vNext/aspnet-core/src/AbpODataDemo.EntityFrameworkCore/Migrations/20201015053907_Initial.cs rename to AbpODataDemo-Core-vNext/aspnet-core/src/AbpODataDemo.EntityFrameworkCore/Migrations/20201021134318_Initial.cs index 5ff288c..d00b2f9 100644 --- a/AbpODataDemo-Core-vNext/aspnet-core/src/AbpODataDemo.EntityFrameworkCore/Migrations/20201015053907_Initial.cs +++ b/AbpODataDemo-Core-vNext/aspnet-core/src/AbpODataDemo.EntityFrameworkCore/Migrations/20201021134318_Initial.cs @@ -55,6 +55,22 @@ namespace AbpODataDemo.Migrations table.PrimaryKey("PK_AbpBackgroundJobs", x => x.Id); }); + migrationBuilder.CreateTable( + name: "AbpDynamicProperties", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + PropertyName = table.Column(nullable: true), + InputType = table.Column(nullable: true), + Permission = table.Column(nullable: true), + TenantId = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpDynamicProperties", x => x.Id); + }); + migrationBuilder.CreateTable( name: "AbpEditions", columns: table => new @@ -446,6 +462,48 @@ namespace AbpODataDemo.Migrations table.PrimaryKey("PK_Persons", x => x.Id); }); + migrationBuilder.CreateTable( + name: "AbpDynamicEntityProperties", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + EntityFullName = table.Column(nullable: true), + DynamicPropertyId = table.Column(nullable: false), + TenantId = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpDynamicEntityProperties", x => x.Id); + table.ForeignKey( + name: "FK_AbpDynamicEntityProperties_AbpDynamicProperties_DynamicPropertyId", + column: x => x.DynamicPropertyId, + principalTable: "AbpDynamicProperties", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "AbpDynamicPropertyValues", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Value = table.Column(nullable: false), + TenantId = table.Column(nullable: true), + DynamicPropertyId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpDynamicPropertyValues", x => x.Id); + table.ForeignKey( + name: "FK_AbpDynamicPropertyValues_AbpDynamicProperties_DynamicPropertyId", + column: x => x.DynamicPropertyId, + principalTable: "AbpDynamicProperties", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( name: "AbpFeatures", columns: table => new @@ -754,6 +812,28 @@ namespace AbpODataDemo.Migrations onDelete: ReferentialAction.Cascade); }); + migrationBuilder.CreateTable( + name: "AbpDynamicEntityPropertyValues", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("SqlServer:Identity", "1, 1"), + Value = table.Column(nullable: false), + EntityId = table.Column(nullable: true), + DynamicEntityPropertyId = table.Column(nullable: false), + TenantId = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_AbpDynamicEntityPropertyValues", x => x.Id); + table.ForeignKey( + name: "FK_AbpDynamicEntityPropertyValues_AbpDynamicEntityProperties_DynamicEntityPropertyId", + column: x => x.DynamicEntityPropertyId, + principalTable: "AbpDynamicEntityProperties", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + migrationBuilder.CreateTable( name: "AbpEntityPropertyChanges", columns: table => new @@ -854,6 +934,35 @@ namespace AbpODataDemo.Migrations table: "AbpBackgroundJobs", columns: new[] { "IsAbandoned", "NextTryTime" }); + migrationBuilder.CreateIndex( + name: "IX_AbpDynamicEntityProperties_DynamicPropertyId", + table: "AbpDynamicEntityProperties", + column: "DynamicPropertyId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpDynamicEntityProperties_EntityFullName_DynamicPropertyId_TenantId", + table: "AbpDynamicEntityProperties", + columns: new[] { "EntityFullName", "DynamicPropertyId", "TenantId" }, + unique: true, + filter: "[EntityFullName] IS NOT NULL AND [TenantId] IS NOT NULL"); + + migrationBuilder.CreateIndex( + name: "IX_AbpDynamicEntityPropertyValues_DynamicEntityPropertyId", + table: "AbpDynamicEntityPropertyValues", + column: "DynamicEntityPropertyId"); + + migrationBuilder.CreateIndex( + name: "IX_AbpDynamicProperties_PropertyName_TenantId", + table: "AbpDynamicProperties", + columns: new[] { "PropertyName", "TenantId" }, + unique: true, + filter: "[PropertyName] IS NOT NULL AND [TenantId] IS NOT NULL"); + + migrationBuilder.CreateIndex( + name: "IX_AbpDynamicPropertyValues_DynamicPropertyId", + table: "AbpDynamicPropertyValues", + column: "DynamicPropertyId"); + migrationBuilder.CreateIndex( name: "IX_AbpEntityChanges_EntityChangeSetId", table: "AbpEntityChanges", @@ -1164,6 +1273,12 @@ namespace AbpODataDemo.Migrations migrationBuilder.DropTable( name: "AbpBackgroundJobs"); + migrationBuilder.DropTable( + name: "AbpDynamicEntityPropertyValues"); + + migrationBuilder.DropTable( + name: "AbpDynamicPropertyValues"); + migrationBuilder.DropTable( name: "AbpEntityPropertyChanges"); @@ -1236,6 +1351,9 @@ namespace AbpODataDemo.Migrations migrationBuilder.DropTable( name: "Phones"); + migrationBuilder.DropTable( + name: "AbpDynamicEntityProperties"); + migrationBuilder.DropTable( name: "AbpEntityChanges"); @@ -1251,6 +1369,9 @@ namespace AbpODataDemo.Migrations migrationBuilder.DropTable( name: "Persons"); + migrationBuilder.DropTable( + name: "AbpDynamicProperties"); + migrationBuilder.DropTable( name: "AbpEntityChangeSets"); diff --git a/AbpODataDemo-Core-vNext/aspnet-core/src/AbpODataDemo.EntityFrameworkCore/Migrations/AbpODataDemoDbContextModelSnapshot.cs b/AbpODataDemo-Core-vNext/aspnet-core/src/AbpODataDemo.EntityFrameworkCore/Migrations/AbpODataDemoDbContextModelSnapshot.cs index 3263e0b..c7bb85c 100644 --- a/AbpODataDemo-Core-vNext/aspnet-core/src/AbpODataDemo.EntityFrameworkCore/Migrations/AbpODataDemoDbContextModelSnapshot.cs +++ b/AbpODataDemo-Core-vNext/aspnet-core/src/AbpODataDemo.EntityFrameworkCore/Migrations/AbpODataDemoDbContextModelSnapshot.cs @@ -15,7 +15,7 @@ namespace AbpODataDemo.Migrations { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "3.1.1") + .HasAnnotation("ProductVersion", "3.1.9") .HasAnnotation("Relational:MaxIdentifierLength", 128) .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); @@ -611,6 +611,112 @@ namespace AbpODataDemo.Migrations b.ToTable("AbpSettings"); }); + modelBuilder.Entity("Abp.DynamicEntityProperties.DynamicEntityProperty", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("DynamicPropertyId") + .HasColumnType("int"); + + b.Property("EntityFullName") + .HasColumnType("nvarchar(450)"); + + b.Property("TenantId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("DynamicPropertyId"); + + b.HasIndex("EntityFullName", "DynamicPropertyId", "TenantId") + .IsUnique() + .HasFilter("[EntityFullName] IS NOT NULL AND [TenantId] IS NOT NULL"); + + b.ToTable("AbpDynamicEntityProperties"); + }); + + modelBuilder.Entity("Abp.DynamicEntityProperties.DynamicEntityPropertyValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("DynamicEntityPropertyId") + .HasColumnType("int"); + + b.Property("EntityId") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("DynamicEntityPropertyId"); + + b.ToTable("AbpDynamicEntityPropertyValues"); + }); + + modelBuilder.Entity("Abp.DynamicEntityProperties.DynamicProperty", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("InputType") + .HasColumnType("nvarchar(max)"); + + b.Property("Permission") + .HasColumnType("nvarchar(max)"); + + b.Property("PropertyName") + .HasColumnType("nvarchar(450)"); + + b.Property("TenantId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("PropertyName", "TenantId") + .IsUnique() + .HasFilter("[PropertyName] IS NOT NULL AND [TenantId] IS NOT NULL"); + + b.ToTable("AbpDynamicProperties"); + }); + + modelBuilder.Entity("Abp.DynamicEntityProperties.DynamicPropertyValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + b.Property("DynamicPropertyId") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnType("int"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("DynamicPropertyId"); + + b.ToTable("AbpDynamicPropertyValues"); + }); + modelBuilder.Entity("Abp.EntityHistory.EntityChange", b => { b.Property("Id") @@ -1643,6 +1749,33 @@ namespace AbpODataDemo.Migrations .HasForeignKey("UserId"); }); + modelBuilder.Entity("Abp.DynamicEntityProperties.DynamicEntityProperty", b => + { + b.HasOne("Abp.DynamicEntityProperties.DynamicProperty", "DynamicProperty") + .WithMany() + .HasForeignKey("DynamicPropertyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Abp.DynamicEntityProperties.DynamicEntityPropertyValue", b => + { + b.HasOne("Abp.DynamicEntityProperties.DynamicEntityProperty", "DynamicEntityProperty") + .WithMany() + .HasForeignKey("DynamicEntityPropertyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Abp.DynamicEntityProperties.DynamicPropertyValue", b => + { + b.HasOne("Abp.DynamicEntityProperties.DynamicProperty", "DynamicProperty") + .WithMany("DynamicPropertyValues") + .HasForeignKey("DynamicPropertyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + modelBuilder.Entity("Abp.EntityHistory.EntityChange", b => { b.HasOne("Abp.EntityHistory.EntityChangeSet", null) diff --git a/AbpODataDemo-Core-vNext/aspnet-core/src/AbpODataDemo.Migrator/AbpODataDemo.Migrator.csproj b/AbpODataDemo-Core-vNext/aspnet-core/src/AbpODataDemo.Migrator/AbpODataDemo.Migrator.csproj index cb95dcd..c445192 100644 --- a/AbpODataDemo-Core-vNext/aspnet-core/src/AbpODataDemo.Migrator/AbpODataDemo.Migrator.csproj +++ b/AbpODataDemo-Core-vNext/aspnet-core/src/AbpODataDemo.Migrator/AbpODataDemo.Migrator.csproj @@ -15,7 +15,7 @@ - + diff --git a/AbpODataDemo-Core-vNext/aspnet-core/src/AbpODataDemo.Web.Core/AbpODataDemo.Web.Core.csproj b/AbpODataDemo-Core-vNext/aspnet-core/src/AbpODataDemo.Web.Core/AbpODataDemo.Web.Core.csproj index d32652b..8ef9687 100644 --- a/AbpODataDemo-Core-vNext/aspnet-core/src/AbpODataDemo.Web.Core/AbpODataDemo.Web.Core.csproj +++ b/AbpODataDemo-Core-vNext/aspnet-core/src/AbpODataDemo.Web.Core/AbpODataDemo.Web.Core.csproj @@ -22,10 +22,10 @@ - - - - - + + + + + diff --git a/AbpODataDemo-Core-vNext/aspnet-core/src/AbpODataDemo.Web.Host/AbpODataDemo.Web.Host.csproj b/AbpODataDemo-Core-vNext/aspnet-core/src/AbpODataDemo.Web.Host/AbpODataDemo.Web.Host.csproj index 1f095b4..ab5153f 100644 --- a/AbpODataDemo-Core-vNext/aspnet-core/src/AbpODataDemo.Web.Host/AbpODataDemo.Web.Host.csproj +++ b/AbpODataDemo-Core-vNext/aspnet-core/src/AbpODataDemo.Web.Host/AbpODataDemo.Web.Host.csproj @@ -31,8 +31,8 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/AbpODataDemo-Core-vNext/aspnet-core/test/AbpODataDemo.Tests/AbpODataDemo.Tests.csproj b/AbpODataDemo-Core-vNext/aspnet-core/test/AbpODataDemo.Tests/AbpODataDemo.Tests.csproj index b40b82b..f16ac9b 100644 --- a/AbpODataDemo-Core-vNext/aspnet-core/test/AbpODataDemo.Tests/AbpODataDemo.Tests.csproj +++ b/AbpODataDemo-Core-vNext/aspnet-core/test/AbpODataDemo.Tests/AbpODataDemo.Tests.csproj @@ -15,18 +15,18 @@ - - + + - + all runtime; build; native; contentfiles; analyzers - - - + + +