From e46d385d5a8adc1a21283e3213288f3dcfb5e95b Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Thu, 6 Oct 2022 10:52:48 +0300 Subject: [PATCH] Updated CmsKitService for v6.0 --- .../CmskitServiceDbContext.cs | 3 + .../20221006075206_Abp_6_0_Update.Designer.cs | 30 ++++ .../20221006075206_Abp_6_0_Update.cs | 108 ++++++++++++ .../CmskitServiceDbContextModelSnapshot.cs | 160 +----------------- 4 files changed, 142 insertions(+), 159 deletions(-) create mode 100644 services/cmskit/src/EShopOnAbp.CmskitService.EntityFrameworkCore/Migrations/20221006075206_Abp_6_0_Update.Designer.cs create mode 100644 services/cmskit/src/EShopOnAbp.CmskitService.EntityFrameworkCore/Migrations/20221006075206_Abp_6_0_Update.cs diff --git a/services/cmskit/src/EShopOnAbp.CmskitService.EntityFrameworkCore/EntityFrameworkCore/CmskitServiceDbContext.cs b/services/cmskit/src/EShopOnAbp.CmskitService.EntityFrameworkCore/EntityFrameworkCore/CmskitServiceDbContext.cs index 81d61a82..cab8a6fd 100644 --- a/services/cmskit/src/EShopOnAbp.CmskitService.EntityFrameworkCore/EntityFrameworkCore/CmskitServiceDbContext.cs +++ b/services/cmskit/src/EShopOnAbp.CmskitService.EntityFrameworkCore/EntityFrameworkCore/CmskitServiceDbContext.cs @@ -4,6 +4,7 @@ using Volo.Abp.EntityFrameworkCore; using Volo.CmsKit.Blogs; using Volo.CmsKit.Comments; using Volo.CmsKit.EntityFrameworkCore; +using Volo.CmsKit.GlobalResources; using Volo.CmsKit.MediaDescriptors; using Volo.CmsKit.Menus; using Volo.CmsKit.Pages; @@ -40,10 +41,12 @@ public class CmskitServiceDbContext : AbpDbContext, ICms public DbSet Blogs { get; set; } public DbSet BlogPosts { get; set; } + public DbSet BlogFeatures { get; set; } public DbSet MediaDescriptors { get; set; } public DbSet MenuItems { get; set; } + public DbSet GlobalResources { get; set; } protected override void OnModelCreating(ModelBuilder modelBuilder) { diff --git a/services/cmskit/src/EShopOnAbp.CmskitService.EntityFrameworkCore/Migrations/20221006075206_Abp_6_0_Update.Designer.cs b/services/cmskit/src/EShopOnAbp.CmskitService.EntityFrameworkCore/Migrations/20221006075206_Abp_6_0_Update.Designer.cs new file mode 100644 index 00000000..b411eae0 --- /dev/null +++ b/services/cmskit/src/EShopOnAbp.CmskitService.EntityFrameworkCore/Migrations/20221006075206_Abp_6_0_Update.Designer.cs @@ -0,0 +1,30 @@ +// +using EShopOnAbp.CmskitService.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.CmskitService.Migrations +{ + [DbContext(typeof(CmskitServiceDbContext))] + [Migration("20221006075206_Abp_6_0_Update")] + partial class Abp_6_0_Update + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.PostgreSql) + .HasAnnotation("ProductVersion", "6.0.5") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); +#pragma warning restore 612, 618 + } + } +} diff --git a/services/cmskit/src/EShopOnAbp.CmskitService.EntityFrameworkCore/Migrations/20221006075206_Abp_6_0_Update.cs b/services/cmskit/src/EShopOnAbp.CmskitService.EntityFrameworkCore/Migrations/20221006075206_Abp_6_0_Update.cs new file mode 100644 index 00000000..e4f0cbb5 --- /dev/null +++ b/services/cmskit/src/EShopOnAbp.CmskitService.EntityFrameworkCore/Migrations/20221006075206_Abp_6_0_Update.cs @@ -0,0 +1,108 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace EShopOnAbp.CmskitService.Migrations +{ + public partial class Abp_6_0_Update : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "CmsComments"); + + migrationBuilder.DropTable( + name: "CmsRatings"); + + migrationBuilder.DropTable( + name: "CmsUsers"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "CmsComments", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: false), + EntityId = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + EntityType = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + ExtraProperties = table.Column(type: "text", nullable: true), + RepliedCommentId = table.Column(type: "uuid", nullable: true), + TenantId = table.Column(type: "uuid", nullable: true), + Text = table.Column(type: "character varying(512)", maxLength: 512, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_CmsComments", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "CmsRatings", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + CreationTime = table.Column(type: "timestamp without time zone", nullable: false), + CreatorId = table.Column(type: "uuid", nullable: false), + EntityId = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + EntityType = table.Column(type: "character varying(64)", maxLength: 64, nullable: false), + StarCount = table.Column(type: "smallint", nullable: false), + TenantId = table.Column(type: "uuid", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_CmsRatings", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "CmsUsers", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + ConcurrencyStamp = table.Column(type: "character varying(40)", maxLength: 40, nullable: true), + Email = table.Column(type: "character varying(256)", maxLength: 256, nullable: false), + EmailConfirmed = table.Column(type: "boolean", nullable: false, defaultValue: false), + ExtraProperties = table.Column(type: "text", nullable: true), + Name = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + PhoneNumber = table.Column(type: "character varying(16)", maxLength: 16, nullable: true), + PhoneNumberConfirmed = table.Column(type: "boolean", nullable: false, defaultValue: false), + Surname = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + TenantId = table.Column(type: "uuid", nullable: true), + UserName = table.Column(type: "character varying(256)", maxLength: 256, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_CmsUsers", x => x.Id); + }); + + migrationBuilder.CreateIndex( + name: "IX_CmsComments_TenantId_EntityType_EntityId", + table: "CmsComments", + columns: new[] { "TenantId", "EntityType", "EntityId" }); + + migrationBuilder.CreateIndex( + name: "IX_CmsComments_TenantId_RepliedCommentId", + table: "CmsComments", + columns: new[] { "TenantId", "RepliedCommentId" }); + + migrationBuilder.CreateIndex( + name: "IX_CmsRatings_TenantId_EntityType_EntityId_CreatorId", + table: "CmsRatings", + columns: new[] { "TenantId", "EntityType", "EntityId", "CreatorId" }); + + migrationBuilder.CreateIndex( + name: "IX_CmsUsers_TenantId_Email", + table: "CmsUsers", + columns: new[] { "TenantId", "Email" }); + + migrationBuilder.CreateIndex( + name: "IX_CmsUsers_TenantId_UserName", + table: "CmsUsers", + columns: new[] { "TenantId", "UserName" }); + } + } +} diff --git a/services/cmskit/src/EShopOnAbp.CmskitService.EntityFrameworkCore/Migrations/CmskitServiceDbContextModelSnapshot.cs b/services/cmskit/src/EShopOnAbp.CmskitService.EntityFrameworkCore/Migrations/CmskitServiceDbContextModelSnapshot.cs index c672cea8..bd4f3e6c 100644 --- a/services/cmskit/src/EShopOnAbp.CmskitService.EntityFrameworkCore/Migrations/CmskitServiceDbContextModelSnapshot.cs +++ b/services/cmskit/src/EShopOnAbp.CmskitService.EntityFrameworkCore/Migrations/CmskitServiceDbContextModelSnapshot.cs @@ -1,5 +1,4 @@ // -using System; using EShopOnAbp.CmskitService.EntityFrameworkCore; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; @@ -19,167 +18,10 @@ namespace EShopOnAbp.CmskitService.Migrations #pragma warning disable 612, 618 modelBuilder .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.PostgreSql) - .HasAnnotation("ProductVersion", "6.0.1") + .HasAnnotation("ProductVersion", "6.0.5") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - - modelBuilder.Entity("Volo.CmsKit.Comments.Comment", b => - { - b.Property("Id") - .HasColumnType("uuid"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("ConcurrencyStamp"); - - b.Property("CreationTime") - .HasColumnType("timestamp without time zone") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("CreatorId"); - - b.Property("EntityId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("EntityType") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("ExtraProperties") - .HasColumnType("text") - .HasColumnName("ExtraProperties"); - - b.Property("RepliedCommentId") - .HasColumnType("uuid"); - - b.Property("TenantId") - .HasColumnType("uuid") - .HasColumnName("TenantId"); - - b.Property("Text") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("character varying(512)"); - - b.HasKey("Id"); - - b.HasIndex("TenantId", "RepliedCommentId"); - - b.HasIndex("TenantId", "EntityType", "EntityId"); - - b.ToTable("CmsComments", (string)null); - }); - - modelBuilder.Entity("Volo.CmsKit.Ratings.Rating", b => - { - b.Property("Id") - .HasColumnType("uuid"); - - b.Property("CreationTime") - .HasColumnType("timestamp without time zone") - .HasColumnName("CreationTime"); - - b.Property("CreatorId") - .HasColumnType("uuid") - .HasColumnName("CreatorId"); - - b.Property("EntityId") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("EntityType") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("character varying(64)"); - - b.Property("StarCount") - .HasColumnType("smallint"); - - b.Property("TenantId") - .HasColumnType("uuid"); - - b.HasKey("Id"); - - b.HasIndex("TenantId", "EntityType", "EntityId", "CreatorId"); - - b.ToTable("CmsRatings", (string)null); - }); - - modelBuilder.Entity("Volo.CmsKit.Users.CmsUser", b => - { - b.Property("Id") - .HasColumnType("uuid"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasMaxLength(40) - .HasColumnType("character varying(40)") - .HasColumnName("ConcurrencyStamp"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("Email"); - - b.Property("EmailConfirmed") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false) - .HasColumnName("EmailConfirmed"); - - b.Property("ExtraProperties") - .HasColumnType("text") - .HasColumnName("ExtraProperties"); - - b.Property("Name") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("Name"); - - b.Property("PhoneNumber") - .HasMaxLength(16) - .HasColumnType("character varying(16)") - .HasColumnName("PhoneNumber"); - - b.Property("PhoneNumberConfirmed") - .ValueGeneratedOnAdd() - .HasColumnType("boolean") - .HasDefaultValue(false) - .HasColumnName("PhoneNumberConfirmed"); - - b.Property("Surname") - .HasMaxLength(64) - .HasColumnType("character varying(64)") - .HasColumnName("Surname"); - - b.Property("TenantId") - .HasColumnType("uuid") - .HasColumnName("TenantId"); - - b.Property("UserName") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("character varying(256)") - .HasColumnName("UserName"); - - b.HasKey("Id"); - - b.HasIndex("TenantId", "Email"); - - b.HasIndex("TenantId", "UserName"); - - b.ToTable("CmsUsers", (string)null); - }); #pragma warning restore 612, 618 } }