From 81c007236c590aa427c0beca3502455969f32e9a Mon Sep 17 00:00:00 2001 From: ValDekh Date: Thu, 3 Aug 2023 12:38:54 +0300 Subject: [PATCH 1/8] Add-Migrations --- Streetcode/StreetCode.Client | 2 +- .../Sources/StreetcodeCategoryContent.cs | 2 +- ...egoryContent_Text_to_5000_simb.Designer.cs | 1568 +++++++++++++++++ ...etcodeCategoryContent_Text_to_5000_simb.cs | 37 + .../StreetcodeDbContextModelSnapshot.cs | 4 +- Streetcode/Streetcode.WebApi/appsettings.json | 3 +- 6 files changed, 1611 insertions(+), 5 deletions(-) create mode 100644 Streetcode/Streetcode.DAL/Persistence/Migrations/20230803093425_Change_StreetcodeCategoryContent_Text_to_5000_simb.Designer.cs create mode 100644 Streetcode/Streetcode.DAL/Persistence/Migrations/20230803093425_Change_StreetcodeCategoryContent_Text_to_5000_simb.cs diff --git a/Streetcode/StreetCode.Client b/Streetcode/StreetCode.Client index 31167a2ec..73140a1f7 160000 --- a/Streetcode/StreetCode.Client +++ b/Streetcode/StreetCode.Client @@ -1 +1 @@ -Subproject commit 31167a2ec1cfc732ca3189a64fa2d6702b3f4bba +Subproject commit 73140a1f7a653d6b9781bc45f2f8c665f70b6601 diff --git a/Streetcode/Streetcode.DAL/Entities/Sources/StreetcodeCategoryContent.cs b/Streetcode/Streetcode.DAL/Entities/Sources/StreetcodeCategoryContent.cs index 42f49eec9..f2f12f6f1 100644 --- a/Streetcode/Streetcode.DAL/Entities/Sources/StreetcodeCategoryContent.cs +++ b/Streetcode/Streetcode.DAL/Entities/Sources/StreetcodeCategoryContent.cs @@ -8,7 +8,7 @@ namespace Streetcode.DAL.Entities.Sources; public class StreetcodeCategoryContent { [Required] - [MaxLength(1000)] + [MaxLength(5000)] public string? Text { get; set; } [Required] diff --git a/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803093425_Change_StreetcodeCategoryContent_Text_to_5000_simb.Designer.cs b/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803093425_Change_StreetcodeCategoryContent_Text_to_5000_simb.Designer.cs new file mode 100644 index 000000000..9df37a1d0 --- /dev/null +++ b/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803093425_Change_StreetcodeCategoryContent_Text_to_5000_simb.Designer.cs @@ -0,0 +1,1568 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Streetcode.DAL.Persistence; + +#nullable disable + +namespace Streetcode.DAL.Persistence.Migrations +{ + [DbContext(typeof(StreetcodeDbContext))] + [Migration("20230803093425_Change_StreetcodeCategoryContent_Text_to_5000_simb")] + partial class Change_StreetcodeCategoryContent_Text_to_5000_simb + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .UseCollation("SQL_Ukrainian_CP1251_CI_AS") + .HasAnnotation("ProductVersion", "6.0.11") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); + + modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Coordinate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("CoordinateType") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Latitude") + .HasColumnType("decimal(18,4)"); + + b.Property("Longtitude") + .HasColumnType("decimal(18,4)"); + + b.HasKey("Id"); + + b.ToTable("coordinates", "add_content"); + + b.HasDiscriminator("CoordinateType").HasValue("coordinate_base"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.StreetcodeTagIndex", b => + { + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.Property("TagId") + .HasColumnType("int"); + + b.Property("Index") + .HasColumnType("int"); + + b.Property("IsVisible") + .HasColumnType("bit"); + + b.HasKey("StreetcodeId", "TagId"); + + b.HasIndex("TagId"); + + b.ToTable("streetcode_tag_index", "add_content"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Subtitle", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.Property("SubtitleText") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.HasKey("Id"); + + b.HasIndex("StreetcodeId"); + + b.ToTable("subtitles", "add_content"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Tag", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Title") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("tags", "add_content"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Analytics.StatisticRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Address") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("Count") + .HasColumnType("int"); + + b.Property("QrId") + .HasColumnType("int"); + + b.Property("StreetcodeCoordinateId") + .HasColumnType("int"); + + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("StreetcodeCoordinateId") + .IsUnique(); + + b.HasIndex("StreetcodeId"); + + b.ToTable("qr_coordinates", "coordinates"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Feedback.Response", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Name") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("responses", "feedback"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Media.Audio", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("BlobName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("MimeType") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("Title") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("Id"); + + b.ToTable("audios", "media"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.Art", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Description") + .HasMaxLength(400) + .HasColumnType("nvarchar(400)"); + + b.Property("ImageId") + .HasColumnType("int"); + + b.Property("Title") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.HasKey("Id"); + + b.HasIndex("ImageId") + .IsUnique(); + + b.ToTable("arts", "media"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.Image", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("BlobName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("MimeType") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.HasKey("Id"); + + b.ToTable("images", "media"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.ImageDetails", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Alt") + .HasMaxLength(300) + .HasColumnType("nvarchar(300)"); + + b.Property("ImageId") + .HasColumnType("int"); + + b.Property("Title") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("Id"); + + b.HasIndex("ImageId") + .IsUnique(); + + b.ToTable("image_details", "media"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.StreetcodeImage", b => + { + b.Property("ImageId") + .HasColumnType("int"); + + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.HasKey("ImageId", "StreetcodeId"); + + b.HasIndex("StreetcodeId"); + + b.ToTable("streetcode_image", "streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Media.Video", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.Property("Title") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Url") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("StreetcodeId"); + + b.ToTable("videos", "media"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.News.News", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("ImageId") + .HasColumnType("int"); + + b.Property("Text") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("URL") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("Id"); + + b.HasIndex("ImageId") + .IsUnique() + .HasFilter("[ImageId] IS NOT NULL"); + + b.HasIndex("URL") + .IsUnique(); + + b.ToTable("news", "news"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Partners.Partner", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Description") + .HasMaxLength(600) + .HasColumnType("nvarchar(600)"); + + b.Property("IsKeyPartner") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("IsVisibleEverywhere") + .HasColumnType("bit"); + + b.Property("LogoId") + .HasColumnType("int"); + + b.Property("TargetUrl") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("UrlTitle") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("LogoId") + .IsUnique(); + + b.ToTable("partners", "partners"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Partners.PartnerSourceLink", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("LogoType") + .HasColumnType("tinyint"); + + b.Property("PartnerId") + .HasColumnType("int"); + + b.Property("TargetUrl") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("PartnerId"); + + b.ToTable("partner_source_links", "partners"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Partners.StreetcodePartner", b => + { + b.Property("PartnerId") + .HasColumnType("int"); + + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.HasKey("PartnerId", "StreetcodeId"); + + b.HasIndex("StreetcodeId"); + + b.ToTable("streetcode_partners", "streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Sources.SourceLinkCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("ImageId") + .HasColumnType("int"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("Id"); + + b.HasIndex("ImageId"); + + b.ToTable("source_link_categories", "sources"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Sources.StreetcodeCategoryContent", b => + { + b.Property("SourceLinkCategoryId") + .HasColumnType("int"); + + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.Property("Text") + .IsRequired() + .HasMaxLength(5000) + .HasColumnType("nvarchar(max)"); + + b.HasKey("SourceLinkCategoryId", "StreetcodeId"); + + b.HasIndex("StreetcodeId"); + + b.ToTable("streetcode_source_link_categories", "sources"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.RelatedFigure", b => + { + b.Property("ObserverId") + .HasColumnType("int"); + + b.Property("TargetId") + .HasColumnType("int"); + + b.HasKey("ObserverId", "TargetId"); + + b.HasIndex("TargetId"); + + b.ToTable("related_figures", "streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.StreetcodeArt", b => + { + b.Property("ArtId") + .HasColumnType("int"); + + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.Property("Index") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(1); + + b.HasKey("ArtId", "StreetcodeId"); + + b.HasIndex("StreetcodeId"); + + b.HasIndex("ArtId", "StreetcodeId"); + + b.ToTable("streetcode_art", "streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Alias") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("AudioId") + .HasColumnType("int"); + + b.Property("CreatedAt") + .ValueGeneratedOnAdd() + .HasColumnType("datetime2") + .HasDefaultValueSql("GETDATE()"); + + b.Property("DateString") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("EventEndOrPersonDeathDate") + .HasColumnType("datetime2"); + + b.Property("EventStartOrPersonBirthDate") + .HasColumnType("datetime2"); + + b.Property("Index") + .HasColumnType("int"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("StreetcodeType") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Teaser") + .HasMaxLength(650) + .HasColumnType("nvarchar(650)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("TransliterationUrl") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("UpdatedAt") + .ValueGeneratedOnAdd() + .HasColumnType("datetime2") + .HasDefaultValueSql("GETDATE()"); + + b.Property("ViewCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.HasKey("Id"); + + b.HasIndex("AudioId") + .IsUnique() + .HasFilter("[AudioId] IS NOT NULL"); + + b.HasIndex("Index") + .IsUnique(); + + b.HasIndex("TransliterationUrl") + .IsUnique(); + + b.ToTable("streetcodes", "streetcode"); + + b.HasDiscriminator("StreetcodeType").HasValue("streetcode-base"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.TextContent.Fact", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("FactContent") + .IsRequired() + .HasMaxLength(600) + .HasColumnType("nvarchar(600)"); + + b.Property("ImageId") + .HasColumnType("int"); + + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("Id"); + + b.HasIndex("ImageId"); + + b.HasIndex("StreetcodeId"); + + b.ToTable("facts", "streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.TextContent.RelatedTerm", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("TermId") + .HasColumnType("int"); + + b.Property("Word") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("TermId"); + + b.ToTable("related_terms", "streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.TextContent.Term", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Description") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("terms", "streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.TextContent.Text", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("AdditionalText") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.Property("TextContent") + .IsRequired() + .HasMaxLength(15000) + .HasColumnType("nvarchar(max)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(300) + .HasColumnType("nvarchar(300)"); + + b.HasKey("Id"); + + b.HasIndex("StreetcodeId") + .IsUnique(); + + b.ToTable("texts", "streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Team.Positions", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Position") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("positions", "team"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Team.TeamMember", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Description") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ImageId") + .HasColumnType("int"); + + b.Property("IsMain") + .HasColumnType("bit"); + + b.Property("LastName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("ImageId") + .IsUnique(); + + b.ToTable("team_members", "team"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Team.TeamMemberLink", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("LogoType") + .HasColumnType("tinyint"); + + b.Property("TargetUrl") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("TeamMemberId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("TeamMemberId"); + + b.ToTable("team_member_links", "team"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Team.TeamMemberPositions", b => + { + b.Property("TeamMemberId") + .HasColumnType("int"); + + b.Property("PositionsId") + .HasColumnType("int"); + + b.HasKey("TeamMemberId", "PositionsId"); + + b.HasIndex("PositionsId"); + + b.ToTable("team_member_positions", "team"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Timeline.HistoricalContext", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Title") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("historical_contexts", "timeline"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Timeline.HistoricalContextTimeline", b => + { + b.Property("TimelineId") + .HasColumnType("int"); + + b.Property("HistoricalContextId") + .HasColumnType("int"); + + b.HasKey("TimelineId", "HistoricalContextId"); + + b.HasIndex("HistoricalContextId"); + + b.ToTable("HistoricalContextsTimelines"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Timeline.TimelineItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Date") + .HasColumnType("datetime2"); + + b.Property("DateViewPattern") + .HasColumnType("int"); + + b.Property("Description") + .HasMaxLength(600) + .HasColumnType("nvarchar(600)"); + + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("Id"); + + b.HasIndex("StreetcodeId"); + + b.ToTable("timeline_items", "timeline"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Toponyms.StreetcodeToponym", b => + { + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.Property("ToponymId") + .HasColumnType("int"); + + b.HasKey("StreetcodeId", "ToponymId"); + + b.HasIndex("ToponymId"); + + b.ToTable("streetcode_toponym", "streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Toponyms.Toponym", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("AdminRegionNew") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("AdminRegionOld") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("Community") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("Gromada") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("Oblast") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("StreetName") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("StreetType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("toponyms", "toponyms"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Transactions.TransactionLink", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.Property("Url") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("UrlTitle") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("StreetcodeId") + .IsUnique(); + + b.ToTable("transaction_links", "transactions"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Users.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Login") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Password") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("Role") + .HasColumnType("int"); + + b.Property("Surname") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Users", "Users"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Types.StreetcodeCoordinate", b => + { + b.HasBaseType("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Coordinate"); + + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.HasIndex("StreetcodeId"); + + b.ToTable("coordinates", "add_content"); + + b.HasDiscriminator().HasValue("coordinate_streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Types.ToponymCoordinate", b => + { + b.HasBaseType("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Coordinate"); + + b.Property("ToponymId") + .HasColumnType("int"); + + b.HasIndex("ToponymId") + .IsUnique() + .HasFilter("[ToponymId] IS NOT NULL"); + + b.ToTable("coordinates", "add_content"); + + b.HasDiscriminator().HasValue("coordinate_toponym"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.Types.EventStreetcode", b => + { + b.HasBaseType("Streetcode.DAL.Entities.Streetcode.StreetcodeContent"); + + b.ToTable("streetcodes", "streetcode"); + + b.HasDiscriminator().HasValue("streetcode-event"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.Types.PersonStreetcode", b => + { + b.HasBaseType("Streetcode.DAL.Entities.Streetcode.StreetcodeContent"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Rank") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.ToTable("streetcodes", "streetcode"); + + b.HasDiscriminator().HasValue("streetcode-person"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.StreetcodeTagIndex", b => + { + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithMany("StreetcodeTagIndices") + .HasForeignKey("StreetcodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Streetcode.DAL.Entities.AdditionalContent.Tag", "Tag") + .WithMany("StreetcodeTagIndices") + .HasForeignKey("TagId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Streetcode"); + + b.Navigation("Tag"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Subtitle", b => + { + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithMany("Subtitles") + .HasForeignKey("StreetcodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Analytics.StatisticRecord", b => + { + b.HasOne("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Types.StreetcodeCoordinate", "StreetcodeCoordinate") + .WithOne("StatisticRecord") + .HasForeignKey("Streetcode.DAL.Entities.Analytics.StatisticRecord", "StreetcodeCoordinateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithMany("StatisticRecords") + .HasForeignKey("StreetcodeId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.Navigation("Streetcode"); + + b.Navigation("StreetcodeCoordinate"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.Art", b => + { + b.HasOne("Streetcode.DAL.Entities.Media.Images.Image", "Image") + .WithOne("Art") + .HasForeignKey("Streetcode.DAL.Entities.Media.Images.Art", "ImageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Image"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.ImageDetails", b => + { + b.HasOne("Streetcode.DAL.Entities.Media.Images.Image", "Image") + .WithOne("ImageDetails") + .HasForeignKey("Streetcode.DAL.Entities.Media.Images.ImageDetails", "ImageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Image"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.StreetcodeImage", b => + { + b.HasOne("Streetcode.DAL.Entities.Media.Images.Image", "Image") + .WithMany() + .HasForeignKey("ImageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithMany() + .HasForeignKey("StreetcodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Image"); + + b.Navigation("Streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Media.Video", b => + { + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithMany("Videos") + .HasForeignKey("StreetcodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.News.News", b => + { + b.HasOne("Streetcode.DAL.Entities.Media.Images.Image", "Image") + .WithOne("News") + .HasForeignKey("Streetcode.DAL.Entities.News.News", "ImageId"); + + b.Navigation("Image"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Partners.Partner", b => + { + b.HasOne("Streetcode.DAL.Entities.Media.Images.Image", "Logo") + .WithOne("Partner") + .HasForeignKey("Streetcode.DAL.Entities.Partners.Partner", "LogoId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Logo"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Partners.PartnerSourceLink", b => + { + b.HasOne("Streetcode.DAL.Entities.Partners.Partner", "Partner") + .WithMany("PartnerSourceLinks") + .HasForeignKey("PartnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Partner"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Partners.StreetcodePartner", b => + { + b.HasOne("Streetcode.DAL.Entities.Partners.Partner", "Partner") + .WithMany() + .HasForeignKey("PartnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithMany() + .HasForeignKey("StreetcodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Partner"); + + b.Navigation("Streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Sources.SourceLinkCategory", b => + { + b.HasOne("Streetcode.DAL.Entities.Media.Images.Image", "Image") + .WithMany("SourceLinkCategories") + .HasForeignKey("ImageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Image"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Sources.StreetcodeCategoryContent", b => + { + b.HasOne("Streetcode.DAL.Entities.Sources.SourceLinkCategory", "SourceLinkCategory") + .WithMany("StreetcodeCategoryContents") + .HasForeignKey("SourceLinkCategoryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithMany("StreetcodeCategoryContents") + .HasForeignKey("StreetcodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("SourceLinkCategory"); + + b.Navigation("Streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.RelatedFigure", b => + { + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Observer") + .WithMany("Observers") + .HasForeignKey("ObserverId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Target") + .WithMany("Targets") + .HasForeignKey("TargetId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Observer"); + + b.Navigation("Target"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.StreetcodeArt", b => + { + b.HasOne("Streetcode.DAL.Entities.Media.Images.Art", "Art") + .WithMany("StreetcodeArts") + .HasForeignKey("ArtId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithMany("StreetcodeArts") + .HasForeignKey("StreetcodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Art"); + + b.Navigation("Streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", b => + { + b.HasOne("Streetcode.DAL.Entities.Media.Audio", "Audio") + .WithOne("Streetcode") + .HasForeignKey("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "AudioId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("Audio"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.TextContent.Fact", b => + { + b.HasOne("Streetcode.DAL.Entities.Media.Images.Image", "Image") + .WithMany("Facts") + .HasForeignKey("ImageId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithMany("Facts") + .HasForeignKey("StreetcodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Image"); + + b.Navigation("Streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.TextContent.RelatedTerm", b => + { + b.HasOne("Streetcode.DAL.Entities.Streetcode.TextContent.Term", "Term") + .WithMany("RelatedTerms") + .HasForeignKey("TermId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Term"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.TextContent.Text", b => + { + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithOne("Text") + .HasForeignKey("Streetcode.DAL.Entities.Streetcode.TextContent.Text", "StreetcodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Team.TeamMember", b => + { + b.HasOne("Streetcode.DAL.Entities.Media.Images.Image", "Image") + .WithOne("TeamMember") + .HasForeignKey("Streetcode.DAL.Entities.Team.TeamMember", "ImageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Image"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Team.TeamMemberLink", b => + { + b.HasOne("Streetcode.DAL.Entities.Team.TeamMember", "TeamMember") + .WithMany("TeamMemberLinks") + .HasForeignKey("TeamMemberId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("TeamMember"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Team.TeamMemberPositions", b => + { + b.HasOne("Streetcode.DAL.Entities.Team.Positions", "Positions") + .WithMany() + .HasForeignKey("PositionsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Streetcode.DAL.Entities.Team.TeamMember", "TeamMember") + .WithMany() + .HasForeignKey("TeamMemberId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Positions"); + + b.Navigation("TeamMember"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Timeline.HistoricalContextTimeline", b => + { + b.HasOne("Streetcode.DAL.Entities.Timeline.HistoricalContext", "HistoricalContext") + .WithMany("HistoricalContextTimelines") + .HasForeignKey("HistoricalContextId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Streetcode.DAL.Entities.Timeline.TimelineItem", "Timeline") + .WithMany("HistoricalContextTimelines") + .HasForeignKey("TimelineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("HistoricalContext"); + + b.Navigation("Timeline"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Timeline.TimelineItem", b => + { + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithMany("TimelineItems") + .HasForeignKey("StreetcodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Toponyms.StreetcodeToponym", b => + { + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithMany() + .HasForeignKey("StreetcodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Streetcode.DAL.Entities.Toponyms.Toponym", "Toponym") + .WithMany() + .HasForeignKey("ToponymId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Streetcode"); + + b.Navigation("Toponym"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Transactions.TransactionLink", b => + { + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithOne("TransactionLink") + .HasForeignKey("Streetcode.DAL.Entities.Transactions.TransactionLink", "StreetcodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Types.StreetcodeCoordinate", b => + { + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithMany("Coordinates") + .HasForeignKey("StreetcodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Types.ToponymCoordinate", b => + { + b.HasOne("Streetcode.DAL.Entities.Toponyms.Toponym", "Toponym") + .WithOne("Coordinate") + .HasForeignKey("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Types.ToponymCoordinate", "ToponymId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Toponym"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Tag", b => + { + b.Navigation("StreetcodeTagIndices"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Media.Audio", b => + { + b.Navigation("Streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.Art", b => + { + b.Navigation("StreetcodeArts"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.Image", b => + { + b.Navigation("Art"); + + b.Navigation("Facts"); + + b.Navigation("ImageDetails"); + + b.Navigation("News"); + + b.Navigation("Partner"); + + b.Navigation("SourceLinkCategories"); + + b.Navigation("TeamMember"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Partners.Partner", b => + { + b.Navigation("PartnerSourceLinks"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Sources.SourceLinkCategory", b => + { + b.Navigation("StreetcodeCategoryContents"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", b => + { + b.Navigation("Coordinates"); + + b.Navigation("Facts"); + + b.Navigation("Observers"); + + b.Navigation("StatisticRecords"); + + b.Navigation("StreetcodeArts"); + + b.Navigation("StreetcodeCategoryContents"); + + b.Navigation("StreetcodeTagIndices"); + + b.Navigation("Subtitles"); + + b.Navigation("Targets"); + + b.Navigation("Text"); + + b.Navigation("TimelineItems"); + + b.Navigation("TransactionLink"); + + b.Navigation("Videos"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.TextContent.Term", b => + { + b.Navigation("RelatedTerms"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Team.TeamMember", b => + { + b.Navigation("TeamMemberLinks"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Timeline.HistoricalContext", b => + { + b.Navigation("HistoricalContextTimelines"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Timeline.TimelineItem", b => + { + b.Navigation("HistoricalContextTimelines"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Toponyms.Toponym", b => + { + b.Navigation("Coordinate") + .IsRequired(); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Types.StreetcodeCoordinate", b => + { + b.Navigation("StatisticRecord") + .IsRequired(); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803093425_Change_StreetcodeCategoryContent_Text_to_5000_simb.cs b/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803093425_Change_StreetcodeCategoryContent_Text_to_5000_simb.cs new file mode 100644 index 000000000..c4c5070e0 --- /dev/null +++ b/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803093425_Change_StreetcodeCategoryContent_Text_to_5000_simb.cs @@ -0,0 +1,37 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Streetcode.DAL.Persistence.Migrations +{ + public partial class Change_StreetcodeCategoryContent_Text_to_5000_simb : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "Text", + schema: "sources", + table: "streetcode_source_link_categories", + type: "nvarchar(max)", + maxLength: 5000, + nullable: false, + oldClrType: typeof(string), + oldType: "nvarchar(1000)", + oldMaxLength: 1000); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "Text", + schema: "sources", + table: "streetcode_source_link_categories", + type: "nvarchar(1000)", + maxLength: 1000, + nullable: false, + oldClrType: typeof(string), + oldType: "nvarchar(max)", + oldMaxLength: 5000); + } + } +} diff --git a/Streetcode/Streetcode.DAL/Persistence/Migrations/StreetcodeDbContextModelSnapshot.cs b/Streetcode/Streetcode.DAL/Persistence/Migrations/StreetcodeDbContextModelSnapshot.cs index 84f1c0e34..a301272e6 100644 --- a/Streetcode/Streetcode.DAL/Persistence/Migrations/StreetcodeDbContextModelSnapshot.cs +++ b/Streetcode/Streetcode.DAL/Persistence/Migrations/StreetcodeDbContextModelSnapshot.cs @@ -476,8 +476,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("Text") .IsRequired() - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); + .HasMaxLength(5000) + .HasColumnType("nvarchar(max)"); b.HasKey("SourceLinkCategoryId", "StreetcodeId"); diff --git a/Streetcode/Streetcode.WebApi/appsettings.json b/Streetcode/Streetcode.WebApi/appsettings.json index 069898083..1d48cfd52 100644 --- a/Streetcode/Streetcode.WebApi/appsettings.json +++ b/Streetcode/Streetcode.WebApi/appsettings.json @@ -1,6 +1,7 @@ { "ConnectionStrings": { - "DefaultConnection": "Server=127.0.0.1;Database=StreetcodeDb;User Id=sa;Password=Admin@1234;MultipleActiveResultSets=true" + //"DefaultConnection": "Server=127.0.0.1;Database=StreetcodeDb;User Id=sa;Password=Admin@1234;MultipleActiveResultSets=true" + "DefaultConnection": "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=StreetcodeDb;Integrated Security=True" }, "EmailConfiguration": { "From": "streetcodefeedback@gmail.com", From c98b909ba279996f830b67faab1a3c78a2200c57 Mon Sep 17 00:00:00 2001 From: ValDekh Date: Thu, 3 Aug 2023 16:36:48 +0300 Subject: [PATCH 2/8] Add new migr --- .../Sources/StreetcodeCategoryContent.cs | 2 +- ...egoryContent_Text_to_4000_simb.Designer.cs | 1568 +++++++++++++++++ ...etcodeCategoryContent_Text_to_4000_simb.cs | 37 + .../StreetcodeDbContextModelSnapshot.cs | 4 +- 4 files changed, 1608 insertions(+), 3 deletions(-) create mode 100644 Streetcode/Streetcode.DAL/Persistence/Migrations/20230803125439_Change_StreetcodeCategoryContent_Text_to_4000_simb.Designer.cs create mode 100644 Streetcode/Streetcode.DAL/Persistence/Migrations/20230803125439_Change_StreetcodeCategoryContent_Text_to_4000_simb.cs diff --git a/Streetcode/Streetcode.DAL/Entities/Sources/StreetcodeCategoryContent.cs b/Streetcode/Streetcode.DAL/Entities/Sources/StreetcodeCategoryContent.cs index f2f12f6f1..c13200d58 100644 --- a/Streetcode/Streetcode.DAL/Entities/Sources/StreetcodeCategoryContent.cs +++ b/Streetcode/Streetcode.DAL/Entities/Sources/StreetcodeCategoryContent.cs @@ -8,7 +8,7 @@ namespace Streetcode.DAL.Entities.Sources; public class StreetcodeCategoryContent { [Required] - [MaxLength(5000)] + [MaxLength(4000)] public string? Text { get; set; } [Required] diff --git a/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803125439_Change_StreetcodeCategoryContent_Text_to_4000_simb.Designer.cs b/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803125439_Change_StreetcodeCategoryContent_Text_to_4000_simb.Designer.cs new file mode 100644 index 000000000..503009398 --- /dev/null +++ b/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803125439_Change_StreetcodeCategoryContent_Text_to_4000_simb.Designer.cs @@ -0,0 +1,1568 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Streetcode.DAL.Persistence; + +#nullable disable + +namespace Streetcode.DAL.Persistence.Migrations +{ + [DbContext(typeof(StreetcodeDbContext))] + [Migration("20230803125439_Change_StreetcodeCategoryContent_Text_to_4000_simb")] + partial class Change_StreetcodeCategoryContent_Text_to_4000_simb + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .UseCollation("SQL_Ukrainian_CP1251_CI_AS") + .HasAnnotation("ProductVersion", "6.0.11") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); + + modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Coordinate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("CoordinateType") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Latitude") + .HasColumnType("decimal(18,4)"); + + b.Property("Longtitude") + .HasColumnType("decimal(18,4)"); + + b.HasKey("Id"); + + b.ToTable("coordinates", "add_content"); + + b.HasDiscriminator("CoordinateType").HasValue("coordinate_base"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.StreetcodeTagIndex", b => + { + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.Property("TagId") + .HasColumnType("int"); + + b.Property("Index") + .HasColumnType("int"); + + b.Property("IsVisible") + .HasColumnType("bit"); + + b.HasKey("StreetcodeId", "TagId"); + + b.HasIndex("TagId"); + + b.ToTable("streetcode_tag_index", "add_content"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Subtitle", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.Property("SubtitleText") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.HasKey("Id"); + + b.HasIndex("StreetcodeId"); + + b.ToTable("subtitles", "add_content"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Tag", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Title") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("tags", "add_content"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Analytics.StatisticRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Address") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("Count") + .HasColumnType("int"); + + b.Property("QrId") + .HasColumnType("int"); + + b.Property("StreetcodeCoordinateId") + .HasColumnType("int"); + + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("StreetcodeCoordinateId") + .IsUnique(); + + b.HasIndex("StreetcodeId"); + + b.ToTable("qr_coordinates", "coordinates"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Feedback.Response", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Name") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("responses", "feedback"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Media.Audio", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("BlobName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("MimeType") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("Title") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("Id"); + + b.ToTable("audios", "media"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.Art", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Description") + .HasMaxLength(400) + .HasColumnType("nvarchar(400)"); + + b.Property("ImageId") + .HasColumnType("int"); + + b.Property("Title") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.HasKey("Id"); + + b.HasIndex("ImageId") + .IsUnique(); + + b.ToTable("arts", "media"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.Image", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("BlobName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("MimeType") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.HasKey("Id"); + + b.ToTable("images", "media"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.ImageDetails", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Alt") + .HasMaxLength(300) + .HasColumnType("nvarchar(300)"); + + b.Property("ImageId") + .HasColumnType("int"); + + b.Property("Title") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("Id"); + + b.HasIndex("ImageId") + .IsUnique(); + + b.ToTable("image_details", "media"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.StreetcodeImage", b => + { + b.Property("ImageId") + .HasColumnType("int"); + + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.HasKey("ImageId", "StreetcodeId"); + + b.HasIndex("StreetcodeId"); + + b.ToTable("streetcode_image", "streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Media.Video", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.Property("Title") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Url") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("StreetcodeId"); + + b.ToTable("videos", "media"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.News.News", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("ImageId") + .HasColumnType("int"); + + b.Property("Text") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("URL") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("Id"); + + b.HasIndex("ImageId") + .IsUnique() + .HasFilter("[ImageId] IS NOT NULL"); + + b.HasIndex("URL") + .IsUnique(); + + b.ToTable("news", "news"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Partners.Partner", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Description") + .HasMaxLength(600) + .HasColumnType("nvarchar(600)"); + + b.Property("IsKeyPartner") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("IsVisibleEverywhere") + .HasColumnType("bit"); + + b.Property("LogoId") + .HasColumnType("int"); + + b.Property("TargetUrl") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("UrlTitle") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("LogoId") + .IsUnique(); + + b.ToTable("partners", "partners"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Partners.PartnerSourceLink", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("LogoType") + .HasColumnType("tinyint"); + + b.Property("PartnerId") + .HasColumnType("int"); + + b.Property("TargetUrl") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("PartnerId"); + + b.ToTable("partner_source_links", "partners"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Partners.StreetcodePartner", b => + { + b.Property("PartnerId") + .HasColumnType("int"); + + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.HasKey("PartnerId", "StreetcodeId"); + + b.HasIndex("StreetcodeId"); + + b.ToTable("streetcode_partners", "streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Sources.SourceLinkCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("ImageId") + .HasColumnType("int"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("Id"); + + b.HasIndex("ImageId"); + + b.ToTable("source_link_categories", "sources"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Sources.StreetcodeCategoryContent", b => + { + b.Property("SourceLinkCategoryId") + .HasColumnType("int"); + + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.Property("Text") + .IsRequired() + .HasMaxLength(4000) + .HasColumnType("nvarchar(4000)"); + + b.HasKey("SourceLinkCategoryId", "StreetcodeId"); + + b.HasIndex("StreetcodeId"); + + b.ToTable("streetcode_source_link_categories", "sources"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.RelatedFigure", b => + { + b.Property("ObserverId") + .HasColumnType("int"); + + b.Property("TargetId") + .HasColumnType("int"); + + b.HasKey("ObserverId", "TargetId"); + + b.HasIndex("TargetId"); + + b.ToTable("related_figures", "streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.StreetcodeArt", b => + { + b.Property("ArtId") + .HasColumnType("int"); + + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.Property("Index") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(1); + + b.HasKey("ArtId", "StreetcodeId"); + + b.HasIndex("StreetcodeId"); + + b.HasIndex("ArtId", "StreetcodeId"); + + b.ToTable("streetcode_art", "streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Alias") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("AudioId") + .HasColumnType("int"); + + b.Property("CreatedAt") + .ValueGeneratedOnAdd() + .HasColumnType("datetime2") + .HasDefaultValueSql("GETDATE()"); + + b.Property("DateString") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("EventEndOrPersonDeathDate") + .HasColumnType("datetime2"); + + b.Property("EventStartOrPersonBirthDate") + .HasColumnType("datetime2"); + + b.Property("Index") + .HasColumnType("int"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("StreetcodeType") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Teaser") + .HasMaxLength(650) + .HasColumnType("nvarchar(650)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("TransliterationUrl") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("UpdatedAt") + .ValueGeneratedOnAdd() + .HasColumnType("datetime2") + .HasDefaultValueSql("GETDATE()"); + + b.Property("ViewCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.HasKey("Id"); + + b.HasIndex("AudioId") + .IsUnique() + .HasFilter("[AudioId] IS NOT NULL"); + + b.HasIndex("Index") + .IsUnique(); + + b.HasIndex("TransliterationUrl") + .IsUnique(); + + b.ToTable("streetcodes", "streetcode"); + + b.HasDiscriminator("StreetcodeType").HasValue("streetcode-base"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.TextContent.Fact", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("FactContent") + .IsRequired() + .HasMaxLength(600) + .HasColumnType("nvarchar(600)"); + + b.Property("ImageId") + .HasColumnType("int"); + + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("Id"); + + b.HasIndex("ImageId"); + + b.HasIndex("StreetcodeId"); + + b.ToTable("facts", "streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.TextContent.RelatedTerm", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("TermId") + .HasColumnType("int"); + + b.Property("Word") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("TermId"); + + b.ToTable("related_terms", "streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.TextContent.Term", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Description") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("terms", "streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.TextContent.Text", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("AdditionalText") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.Property("TextContent") + .IsRequired() + .HasMaxLength(15000) + .HasColumnType("nvarchar(max)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(300) + .HasColumnType("nvarchar(300)"); + + b.HasKey("Id"); + + b.HasIndex("StreetcodeId") + .IsUnique(); + + b.ToTable("texts", "streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Team.Positions", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Position") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("positions", "team"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Team.TeamMember", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Description") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ImageId") + .HasColumnType("int"); + + b.Property("IsMain") + .HasColumnType("bit"); + + b.Property("LastName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("ImageId") + .IsUnique(); + + b.ToTable("team_members", "team"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Team.TeamMemberLink", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("LogoType") + .HasColumnType("tinyint"); + + b.Property("TargetUrl") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("TeamMemberId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("TeamMemberId"); + + b.ToTable("team_member_links", "team"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Team.TeamMemberPositions", b => + { + b.Property("TeamMemberId") + .HasColumnType("int"); + + b.Property("PositionsId") + .HasColumnType("int"); + + b.HasKey("TeamMemberId", "PositionsId"); + + b.HasIndex("PositionsId"); + + b.ToTable("team_member_positions", "team"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Timeline.HistoricalContext", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Title") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("historical_contexts", "timeline"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Timeline.HistoricalContextTimeline", b => + { + b.Property("TimelineId") + .HasColumnType("int"); + + b.Property("HistoricalContextId") + .HasColumnType("int"); + + b.HasKey("TimelineId", "HistoricalContextId"); + + b.HasIndex("HistoricalContextId"); + + b.ToTable("HistoricalContextsTimelines"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Timeline.TimelineItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Date") + .HasColumnType("datetime2"); + + b.Property("DateViewPattern") + .HasColumnType("int"); + + b.Property("Description") + .HasMaxLength(600) + .HasColumnType("nvarchar(600)"); + + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("Id"); + + b.HasIndex("StreetcodeId"); + + b.ToTable("timeline_items", "timeline"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Toponyms.StreetcodeToponym", b => + { + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.Property("ToponymId") + .HasColumnType("int"); + + b.HasKey("StreetcodeId", "ToponymId"); + + b.HasIndex("ToponymId"); + + b.ToTable("streetcode_toponym", "streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Toponyms.Toponym", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("AdminRegionNew") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("AdminRegionOld") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("Community") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("Gromada") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("Oblast") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("StreetName") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("StreetType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("toponyms", "toponyms"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Transactions.TransactionLink", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.Property("Url") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("UrlTitle") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("StreetcodeId") + .IsUnique(); + + b.ToTable("transaction_links", "transactions"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Users.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Login") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Password") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("Role") + .HasColumnType("int"); + + b.Property("Surname") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Users", "Users"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Types.StreetcodeCoordinate", b => + { + b.HasBaseType("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Coordinate"); + + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.HasIndex("StreetcodeId"); + + b.ToTable("coordinates", "add_content"); + + b.HasDiscriminator().HasValue("coordinate_streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Types.ToponymCoordinate", b => + { + b.HasBaseType("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Coordinate"); + + b.Property("ToponymId") + .HasColumnType("int"); + + b.HasIndex("ToponymId") + .IsUnique() + .HasFilter("[ToponymId] IS NOT NULL"); + + b.ToTable("coordinates", "add_content"); + + b.HasDiscriminator().HasValue("coordinate_toponym"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.Types.EventStreetcode", b => + { + b.HasBaseType("Streetcode.DAL.Entities.Streetcode.StreetcodeContent"); + + b.ToTable("streetcodes", "streetcode"); + + b.HasDiscriminator().HasValue("streetcode-event"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.Types.PersonStreetcode", b => + { + b.HasBaseType("Streetcode.DAL.Entities.Streetcode.StreetcodeContent"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Rank") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.ToTable("streetcodes", "streetcode"); + + b.HasDiscriminator().HasValue("streetcode-person"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.StreetcodeTagIndex", b => + { + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithMany("StreetcodeTagIndices") + .HasForeignKey("StreetcodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Streetcode.DAL.Entities.AdditionalContent.Tag", "Tag") + .WithMany("StreetcodeTagIndices") + .HasForeignKey("TagId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Streetcode"); + + b.Navigation("Tag"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Subtitle", b => + { + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithMany("Subtitles") + .HasForeignKey("StreetcodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Analytics.StatisticRecord", b => + { + b.HasOne("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Types.StreetcodeCoordinate", "StreetcodeCoordinate") + .WithOne("StatisticRecord") + .HasForeignKey("Streetcode.DAL.Entities.Analytics.StatisticRecord", "StreetcodeCoordinateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithMany("StatisticRecords") + .HasForeignKey("StreetcodeId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.Navigation("Streetcode"); + + b.Navigation("StreetcodeCoordinate"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.Art", b => + { + b.HasOne("Streetcode.DAL.Entities.Media.Images.Image", "Image") + .WithOne("Art") + .HasForeignKey("Streetcode.DAL.Entities.Media.Images.Art", "ImageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Image"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.ImageDetails", b => + { + b.HasOne("Streetcode.DAL.Entities.Media.Images.Image", "Image") + .WithOne("ImageDetails") + .HasForeignKey("Streetcode.DAL.Entities.Media.Images.ImageDetails", "ImageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Image"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.StreetcodeImage", b => + { + b.HasOne("Streetcode.DAL.Entities.Media.Images.Image", "Image") + .WithMany() + .HasForeignKey("ImageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithMany() + .HasForeignKey("StreetcodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Image"); + + b.Navigation("Streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Media.Video", b => + { + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithMany("Videos") + .HasForeignKey("StreetcodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.News.News", b => + { + b.HasOne("Streetcode.DAL.Entities.Media.Images.Image", "Image") + .WithOne("News") + .HasForeignKey("Streetcode.DAL.Entities.News.News", "ImageId"); + + b.Navigation("Image"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Partners.Partner", b => + { + b.HasOne("Streetcode.DAL.Entities.Media.Images.Image", "Logo") + .WithOne("Partner") + .HasForeignKey("Streetcode.DAL.Entities.Partners.Partner", "LogoId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Logo"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Partners.PartnerSourceLink", b => + { + b.HasOne("Streetcode.DAL.Entities.Partners.Partner", "Partner") + .WithMany("PartnerSourceLinks") + .HasForeignKey("PartnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Partner"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Partners.StreetcodePartner", b => + { + b.HasOne("Streetcode.DAL.Entities.Partners.Partner", "Partner") + .WithMany() + .HasForeignKey("PartnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithMany() + .HasForeignKey("StreetcodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Partner"); + + b.Navigation("Streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Sources.SourceLinkCategory", b => + { + b.HasOne("Streetcode.DAL.Entities.Media.Images.Image", "Image") + .WithMany("SourceLinkCategories") + .HasForeignKey("ImageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Image"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Sources.StreetcodeCategoryContent", b => + { + b.HasOne("Streetcode.DAL.Entities.Sources.SourceLinkCategory", "SourceLinkCategory") + .WithMany("StreetcodeCategoryContents") + .HasForeignKey("SourceLinkCategoryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithMany("StreetcodeCategoryContents") + .HasForeignKey("StreetcodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("SourceLinkCategory"); + + b.Navigation("Streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.RelatedFigure", b => + { + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Observer") + .WithMany("Observers") + .HasForeignKey("ObserverId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Target") + .WithMany("Targets") + .HasForeignKey("TargetId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Observer"); + + b.Navigation("Target"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.StreetcodeArt", b => + { + b.HasOne("Streetcode.DAL.Entities.Media.Images.Art", "Art") + .WithMany("StreetcodeArts") + .HasForeignKey("ArtId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithMany("StreetcodeArts") + .HasForeignKey("StreetcodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Art"); + + b.Navigation("Streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", b => + { + b.HasOne("Streetcode.DAL.Entities.Media.Audio", "Audio") + .WithOne("Streetcode") + .HasForeignKey("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "AudioId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("Audio"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.TextContent.Fact", b => + { + b.HasOne("Streetcode.DAL.Entities.Media.Images.Image", "Image") + .WithMany("Facts") + .HasForeignKey("ImageId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithMany("Facts") + .HasForeignKey("StreetcodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Image"); + + b.Navigation("Streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.TextContent.RelatedTerm", b => + { + b.HasOne("Streetcode.DAL.Entities.Streetcode.TextContent.Term", "Term") + .WithMany("RelatedTerms") + .HasForeignKey("TermId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Term"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.TextContent.Text", b => + { + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithOne("Text") + .HasForeignKey("Streetcode.DAL.Entities.Streetcode.TextContent.Text", "StreetcodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Team.TeamMember", b => + { + b.HasOne("Streetcode.DAL.Entities.Media.Images.Image", "Image") + .WithOne("TeamMember") + .HasForeignKey("Streetcode.DAL.Entities.Team.TeamMember", "ImageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Image"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Team.TeamMemberLink", b => + { + b.HasOne("Streetcode.DAL.Entities.Team.TeamMember", "TeamMember") + .WithMany("TeamMemberLinks") + .HasForeignKey("TeamMemberId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("TeamMember"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Team.TeamMemberPositions", b => + { + b.HasOne("Streetcode.DAL.Entities.Team.Positions", "Positions") + .WithMany() + .HasForeignKey("PositionsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Streetcode.DAL.Entities.Team.TeamMember", "TeamMember") + .WithMany() + .HasForeignKey("TeamMemberId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Positions"); + + b.Navigation("TeamMember"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Timeline.HistoricalContextTimeline", b => + { + b.HasOne("Streetcode.DAL.Entities.Timeline.HistoricalContext", "HistoricalContext") + .WithMany("HistoricalContextTimelines") + .HasForeignKey("HistoricalContextId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Streetcode.DAL.Entities.Timeline.TimelineItem", "Timeline") + .WithMany("HistoricalContextTimelines") + .HasForeignKey("TimelineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("HistoricalContext"); + + b.Navigation("Timeline"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Timeline.TimelineItem", b => + { + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithMany("TimelineItems") + .HasForeignKey("StreetcodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Toponyms.StreetcodeToponym", b => + { + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithMany() + .HasForeignKey("StreetcodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Streetcode.DAL.Entities.Toponyms.Toponym", "Toponym") + .WithMany() + .HasForeignKey("ToponymId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Streetcode"); + + b.Navigation("Toponym"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Transactions.TransactionLink", b => + { + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithOne("TransactionLink") + .HasForeignKey("Streetcode.DAL.Entities.Transactions.TransactionLink", "StreetcodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Types.StreetcodeCoordinate", b => + { + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithMany("Coordinates") + .HasForeignKey("StreetcodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Types.ToponymCoordinate", b => + { + b.HasOne("Streetcode.DAL.Entities.Toponyms.Toponym", "Toponym") + .WithOne("Coordinate") + .HasForeignKey("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Types.ToponymCoordinate", "ToponymId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Toponym"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Tag", b => + { + b.Navigation("StreetcodeTagIndices"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Media.Audio", b => + { + b.Navigation("Streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.Art", b => + { + b.Navigation("StreetcodeArts"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.Image", b => + { + b.Navigation("Art"); + + b.Navigation("Facts"); + + b.Navigation("ImageDetails"); + + b.Navigation("News"); + + b.Navigation("Partner"); + + b.Navigation("SourceLinkCategories"); + + b.Navigation("TeamMember"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Partners.Partner", b => + { + b.Navigation("PartnerSourceLinks"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Sources.SourceLinkCategory", b => + { + b.Navigation("StreetcodeCategoryContents"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", b => + { + b.Navigation("Coordinates"); + + b.Navigation("Facts"); + + b.Navigation("Observers"); + + b.Navigation("StatisticRecords"); + + b.Navigation("StreetcodeArts"); + + b.Navigation("StreetcodeCategoryContents"); + + b.Navigation("StreetcodeTagIndices"); + + b.Navigation("Subtitles"); + + b.Navigation("Targets"); + + b.Navigation("Text"); + + b.Navigation("TimelineItems"); + + b.Navigation("TransactionLink"); + + b.Navigation("Videos"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.TextContent.Term", b => + { + b.Navigation("RelatedTerms"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Team.TeamMember", b => + { + b.Navigation("TeamMemberLinks"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Timeline.HistoricalContext", b => + { + b.Navigation("HistoricalContextTimelines"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Timeline.TimelineItem", b => + { + b.Navigation("HistoricalContextTimelines"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Toponyms.Toponym", b => + { + b.Navigation("Coordinate") + .IsRequired(); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Types.StreetcodeCoordinate", b => + { + b.Navigation("StatisticRecord") + .IsRequired(); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803125439_Change_StreetcodeCategoryContent_Text_to_4000_simb.cs b/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803125439_Change_StreetcodeCategoryContent_Text_to_4000_simb.cs new file mode 100644 index 000000000..ab02e260e --- /dev/null +++ b/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803125439_Change_StreetcodeCategoryContent_Text_to_4000_simb.cs @@ -0,0 +1,37 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Streetcode.DAL.Persistence.Migrations +{ + public partial class Change_StreetcodeCategoryContent_Text_to_4000_simb : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "Text", + schema: "sources", + table: "streetcode_source_link_categories", + type: "nvarchar(4000)", + maxLength: 4000, + nullable: false, + oldClrType: typeof(string), + oldType: "nvarchar(max)", + oldMaxLength: 5000); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "Text", + schema: "sources", + table: "streetcode_source_link_categories", + type: "nvarchar(max)", + maxLength: 5000, + nullable: false, + oldClrType: typeof(string), + oldType: "nvarchar(4000)", + oldMaxLength: 4000); + } + } +} diff --git a/Streetcode/Streetcode.DAL/Persistence/Migrations/StreetcodeDbContextModelSnapshot.cs b/Streetcode/Streetcode.DAL/Persistence/Migrations/StreetcodeDbContextModelSnapshot.cs index a301272e6..bef7c0959 100644 --- a/Streetcode/Streetcode.DAL/Persistence/Migrations/StreetcodeDbContextModelSnapshot.cs +++ b/Streetcode/Streetcode.DAL/Persistence/Migrations/StreetcodeDbContextModelSnapshot.cs @@ -476,8 +476,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("Text") .IsRequired() - .HasMaxLength(5000) - .HasColumnType("nvarchar(max)"); + .HasMaxLength(4000) + .HasColumnType("nvarchar(4000)"); b.HasKey("SourceLinkCategoryId", "StreetcodeId"); From 66532e398ced69e3f61100e4dcdd6159903f342d Mon Sep 17 00:00:00 2001 From: ValDekh Date: Thu, 3 Aug 2023 23:44:54 +0300 Subject: [PATCH 3/8] Add 7000 migration and in text (entity and DTO) --- .../Sources/StreetcodeCategoryContentDTO.cs | 2 +- .../Sources/StreetcodeCategoryContent.cs | 2 +- ...egoryContent_Text_to_7000_simb.Designer.cs | 1568 +++++++++++++++++ ...etcodeCategoryContent_Text_to_7000_simb.cs | 37 + .../StreetcodeDbContextModelSnapshot.cs | 4 +- .../Streetcode.WebApi/appsettings.Local.json | 3 +- 6 files changed, 1611 insertions(+), 5 deletions(-) create mode 100644 Streetcode/Streetcode.DAL/Persistence/Migrations/20230803195721_Change_StreetcodeCategoryContent_Text_to_7000_simb.Designer.cs create mode 100644 Streetcode/Streetcode.DAL/Persistence/Migrations/20230803195721_Change_StreetcodeCategoryContent_Text_to_7000_simb.cs diff --git a/Streetcode/Streetcode.BLL/DTO/Sources/StreetcodeCategoryContentDTO.cs b/Streetcode/Streetcode.BLL/DTO/Sources/StreetcodeCategoryContentDTO.cs index 7b1bcf168..179b5160a 100644 --- a/Streetcode/Streetcode.BLL/DTO/Sources/StreetcodeCategoryContentDTO.cs +++ b/Streetcode/Streetcode.BLL/DTO/Sources/StreetcodeCategoryContentDTO.cs @@ -10,7 +10,7 @@ namespace Streetcode.BLL.DTO.Sources public class StreetcodeCategoryContentDTO { [Required] - [MaxLength(1000)] + [MaxLength(7000)] public string Text { get; set; } [Required] diff --git a/Streetcode/Streetcode.DAL/Entities/Sources/StreetcodeCategoryContent.cs b/Streetcode/Streetcode.DAL/Entities/Sources/StreetcodeCategoryContent.cs index c13200d58..9cf165cc4 100644 --- a/Streetcode/Streetcode.DAL/Entities/Sources/StreetcodeCategoryContent.cs +++ b/Streetcode/Streetcode.DAL/Entities/Sources/StreetcodeCategoryContent.cs @@ -8,7 +8,7 @@ namespace Streetcode.DAL.Entities.Sources; public class StreetcodeCategoryContent { [Required] - [MaxLength(4000)] + [MaxLength(7000)] public string? Text { get; set; } [Required] diff --git a/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803195721_Change_StreetcodeCategoryContent_Text_to_7000_simb.Designer.cs b/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803195721_Change_StreetcodeCategoryContent_Text_to_7000_simb.Designer.cs new file mode 100644 index 000000000..48b419121 --- /dev/null +++ b/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803195721_Change_StreetcodeCategoryContent_Text_to_7000_simb.Designer.cs @@ -0,0 +1,1568 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Streetcode.DAL.Persistence; + +#nullable disable + +namespace Streetcode.DAL.Persistence.Migrations +{ + [DbContext(typeof(StreetcodeDbContext))] + [Migration("20230803195721_Change_StreetcodeCategoryContent_Text_to_7000_simb")] + partial class Change_StreetcodeCategoryContent_Text_to_7000_simb + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .UseCollation("SQL_Ukrainian_CP1251_CI_AS") + .HasAnnotation("ProductVersion", "6.0.11") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); + + modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Coordinate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("CoordinateType") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Latitude") + .HasColumnType("decimal(18,4)"); + + b.Property("Longtitude") + .HasColumnType("decimal(18,4)"); + + b.HasKey("Id"); + + b.ToTable("coordinates", "add_content"); + + b.HasDiscriminator("CoordinateType").HasValue("coordinate_base"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.StreetcodeTagIndex", b => + { + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.Property("TagId") + .HasColumnType("int"); + + b.Property("Index") + .HasColumnType("int"); + + b.Property("IsVisible") + .HasColumnType("bit"); + + b.HasKey("StreetcodeId", "TagId"); + + b.HasIndex("TagId"); + + b.ToTable("streetcode_tag_index", "add_content"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Subtitle", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.Property("SubtitleText") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.HasKey("Id"); + + b.HasIndex("StreetcodeId"); + + b.ToTable("subtitles", "add_content"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Tag", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Title") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("tags", "add_content"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Analytics.StatisticRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Address") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("Count") + .HasColumnType("int"); + + b.Property("QrId") + .HasColumnType("int"); + + b.Property("StreetcodeCoordinateId") + .HasColumnType("int"); + + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("StreetcodeCoordinateId") + .IsUnique(); + + b.HasIndex("StreetcodeId"); + + b.ToTable("qr_coordinates", "coordinates"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Feedback.Response", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Description") + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Name") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("responses", "feedback"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Media.Audio", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("BlobName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("MimeType") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.Property("Title") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("Id"); + + b.ToTable("audios", "media"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.Art", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Description") + .HasMaxLength(400) + .HasColumnType("nvarchar(400)"); + + b.Property("ImageId") + .HasColumnType("int"); + + b.Property("Title") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.HasKey("Id"); + + b.HasIndex("ImageId") + .IsUnique(); + + b.ToTable("arts", "media"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.Image", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("BlobName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("MimeType") + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); + + b.HasKey("Id"); + + b.ToTable("images", "media"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.ImageDetails", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Alt") + .HasMaxLength(300) + .HasColumnType("nvarchar(300)"); + + b.Property("ImageId") + .HasColumnType("int"); + + b.Property("Title") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("Id"); + + b.HasIndex("ImageId") + .IsUnique(); + + b.ToTable("image_details", "media"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.StreetcodeImage", b => + { + b.Property("ImageId") + .HasColumnType("int"); + + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.HasKey("ImageId", "StreetcodeId"); + + b.HasIndex("StreetcodeId"); + + b.ToTable("streetcode_image", "streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Media.Video", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.Property("Title") + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("Url") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("StreetcodeId"); + + b.ToTable("videos", "media"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.News.News", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("CreationDate") + .HasColumnType("datetime2"); + + b.Property("ImageId") + .HasColumnType("int"); + + b.Property("Text") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("URL") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("Id"); + + b.HasIndex("ImageId") + .IsUnique() + .HasFilter("[ImageId] IS NOT NULL"); + + b.HasIndex("URL") + .IsUnique(); + + b.ToTable("news", "news"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Partners.Partner", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Description") + .HasMaxLength(600) + .HasColumnType("nvarchar(600)"); + + b.Property("IsKeyPartner") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("IsVisibleEverywhere") + .HasColumnType("bit"); + + b.Property("LogoId") + .HasColumnType("int"); + + b.Property("TargetUrl") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("UrlTitle") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("LogoId") + .IsUnique(); + + b.ToTable("partners", "partners"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Partners.PartnerSourceLink", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("LogoType") + .HasColumnType("tinyint"); + + b.Property("PartnerId") + .HasColumnType("int"); + + b.Property("TargetUrl") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("PartnerId"); + + b.ToTable("partner_source_links", "partners"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Partners.StreetcodePartner", b => + { + b.Property("PartnerId") + .HasColumnType("int"); + + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.HasKey("PartnerId", "StreetcodeId"); + + b.HasIndex("StreetcodeId"); + + b.ToTable("streetcode_partners", "streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Sources.SourceLinkCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("ImageId") + .HasColumnType("int"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("Id"); + + b.HasIndex("ImageId"); + + b.ToTable("source_link_categories", "sources"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Sources.StreetcodeCategoryContent", b => + { + b.Property("SourceLinkCategoryId") + .HasColumnType("int"); + + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.Property("Text") + .IsRequired() + .HasMaxLength(7000) + .HasColumnType("nvarchar(max)"); + + b.HasKey("SourceLinkCategoryId", "StreetcodeId"); + + b.HasIndex("StreetcodeId"); + + b.ToTable("streetcode_source_link_categories", "sources"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.RelatedFigure", b => + { + b.Property("ObserverId") + .HasColumnType("int"); + + b.Property("TargetId") + .HasColumnType("int"); + + b.HasKey("ObserverId", "TargetId"); + + b.HasIndex("TargetId"); + + b.ToTable("related_figures", "streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.StreetcodeArt", b => + { + b.Property("ArtId") + .HasColumnType("int"); + + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.Property("Index") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(1); + + b.HasKey("ArtId", "StreetcodeId"); + + b.HasIndex("StreetcodeId"); + + b.HasIndex("ArtId", "StreetcodeId"); + + b.ToTable("streetcode_art", "streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Alias") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("AudioId") + .HasColumnType("int"); + + b.Property("CreatedAt") + .ValueGeneratedOnAdd() + .HasColumnType("datetime2") + .HasDefaultValueSql("GETDATE()"); + + b.Property("DateString") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("EventEndOrPersonDeathDate") + .HasColumnType("datetime2"); + + b.Property("EventStartOrPersonBirthDate") + .HasColumnType("datetime2"); + + b.Property("Index") + .HasColumnType("int"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("StreetcodeType") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Teaser") + .HasMaxLength(650) + .HasColumnType("nvarchar(650)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("TransliterationUrl") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("UpdatedAt") + .ValueGeneratedOnAdd() + .HasColumnType("datetime2") + .HasDefaultValueSql("GETDATE()"); + + b.Property("ViewCount") + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); + + b.HasKey("Id"); + + b.HasIndex("AudioId") + .IsUnique() + .HasFilter("[AudioId] IS NOT NULL"); + + b.HasIndex("Index") + .IsUnique(); + + b.HasIndex("TransliterationUrl") + .IsUnique(); + + b.ToTable("streetcodes", "streetcode"); + + b.HasDiscriminator("StreetcodeType").HasValue("streetcode-base"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.TextContent.Fact", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("FactContent") + .IsRequired() + .HasMaxLength(600) + .HasColumnType("nvarchar(600)"); + + b.Property("ImageId") + .HasColumnType("int"); + + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("Id"); + + b.HasIndex("ImageId"); + + b.HasIndex("StreetcodeId"); + + b.ToTable("facts", "streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.TextContent.RelatedTerm", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("TermId") + .HasColumnType("int"); + + b.Property("Word") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("TermId"); + + b.ToTable("related_terms", "streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.TextContent.Term", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Description") + .IsRequired() + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("terms", "streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.TextContent.Text", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("AdditionalText") + .HasMaxLength(500) + .HasColumnType("nvarchar(500)"); + + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.Property("TextContent") + .IsRequired() + .HasMaxLength(15000) + .HasColumnType("nvarchar(max)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(300) + .HasColumnType("nvarchar(300)"); + + b.HasKey("Id"); + + b.HasIndex("StreetcodeId") + .IsUnique(); + + b.ToTable("texts", "streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Team.Positions", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Position") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("positions", "team"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Team.TeamMember", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Description") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("ImageId") + .HasColumnType("int"); + + b.Property("IsMain") + .HasColumnType("bit"); + + b.Property("LastName") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("ImageId") + .IsUnique(); + + b.ToTable("team_members", "team"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Team.TeamMemberLink", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("LogoType") + .HasColumnType("tinyint"); + + b.Property("TargetUrl") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("TeamMemberId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("TeamMemberId"); + + b.ToTable("team_member_links", "team"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Team.TeamMemberPositions", b => + { + b.Property("TeamMemberId") + .HasColumnType("int"); + + b.Property("PositionsId") + .HasColumnType("int"); + + b.HasKey("TeamMemberId", "PositionsId"); + + b.HasIndex("PositionsId"); + + b.ToTable("team_member_positions", "team"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Timeline.HistoricalContext", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Title") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("historical_contexts", "timeline"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Timeline.HistoricalContextTimeline", b => + { + b.Property("TimelineId") + .HasColumnType("int"); + + b.Property("HistoricalContextId") + .HasColumnType("int"); + + b.HasKey("TimelineId", "HistoricalContextId"); + + b.HasIndex("HistoricalContextId"); + + b.ToTable("HistoricalContextsTimelines"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Timeline.TimelineItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Date") + .HasColumnType("datetime2"); + + b.Property("DateViewPattern") + .HasColumnType("int"); + + b.Property("Description") + .HasMaxLength(600) + .HasColumnType("nvarchar(600)"); + + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.HasKey("Id"); + + b.HasIndex("StreetcodeId"); + + b.ToTable("timeline_items", "timeline"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Toponyms.StreetcodeToponym", b => + { + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.Property("ToponymId") + .HasColumnType("int"); + + b.HasKey("StreetcodeId", "ToponymId"); + + b.HasIndex("ToponymId"); + + b.ToTable("streetcode_toponym", "streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Toponyms.Toponym", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("AdminRegionNew") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("AdminRegionOld") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("Community") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("Gromada") + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("Oblast") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); + + b.Property("StreetName") + .IsRequired() + .HasMaxLength(150) + .HasColumnType("nvarchar(150)"); + + b.Property("StreetType") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("toponyms", "toponyms"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Transactions.TransactionLink", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.Property("Url") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("UrlTitle") + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("StreetcodeId") + .IsUnique(); + + b.ToTable("transaction_links", "transactions"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Users.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Login") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Password") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("Role") + .HasColumnType("int"); + + b.Property("Surname") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.HasKey("Id"); + + b.ToTable("Users", "Users"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Types.StreetcodeCoordinate", b => + { + b.HasBaseType("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Coordinate"); + + b.Property("StreetcodeId") + .HasColumnType("int"); + + b.HasIndex("StreetcodeId"); + + b.ToTable("coordinates", "add_content"); + + b.HasDiscriminator().HasValue("coordinate_streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Types.ToponymCoordinate", b => + { + b.HasBaseType("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Coordinate"); + + b.Property("ToponymId") + .HasColumnType("int"); + + b.HasIndex("ToponymId") + .IsUnique() + .HasFilter("[ToponymId] IS NOT NULL"); + + b.ToTable("coordinates", "add_content"); + + b.HasDiscriminator().HasValue("coordinate_toponym"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.Types.EventStreetcode", b => + { + b.HasBaseType("Streetcode.DAL.Entities.Streetcode.StreetcodeContent"); + + b.ToTable("streetcodes", "streetcode"); + + b.HasDiscriminator().HasValue("streetcode-event"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.Types.PersonStreetcode", b => + { + b.HasBaseType("Streetcode.DAL.Entities.Streetcode.StreetcodeContent"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("Rank") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.ToTable("streetcodes", "streetcode"); + + b.HasDiscriminator().HasValue("streetcode-person"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.StreetcodeTagIndex", b => + { + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithMany("StreetcodeTagIndices") + .HasForeignKey("StreetcodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Streetcode.DAL.Entities.AdditionalContent.Tag", "Tag") + .WithMany("StreetcodeTagIndices") + .HasForeignKey("TagId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Streetcode"); + + b.Navigation("Tag"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Subtitle", b => + { + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithMany("Subtitles") + .HasForeignKey("StreetcodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Analytics.StatisticRecord", b => + { + b.HasOne("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Types.StreetcodeCoordinate", "StreetcodeCoordinate") + .WithOne("StatisticRecord") + .HasForeignKey("Streetcode.DAL.Entities.Analytics.StatisticRecord", "StreetcodeCoordinateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithMany("StatisticRecords") + .HasForeignKey("StreetcodeId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.Navigation("Streetcode"); + + b.Navigation("StreetcodeCoordinate"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.Art", b => + { + b.HasOne("Streetcode.DAL.Entities.Media.Images.Image", "Image") + .WithOne("Art") + .HasForeignKey("Streetcode.DAL.Entities.Media.Images.Art", "ImageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Image"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.ImageDetails", b => + { + b.HasOne("Streetcode.DAL.Entities.Media.Images.Image", "Image") + .WithOne("ImageDetails") + .HasForeignKey("Streetcode.DAL.Entities.Media.Images.ImageDetails", "ImageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Image"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.StreetcodeImage", b => + { + b.HasOne("Streetcode.DAL.Entities.Media.Images.Image", "Image") + .WithMany() + .HasForeignKey("ImageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithMany() + .HasForeignKey("StreetcodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Image"); + + b.Navigation("Streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Media.Video", b => + { + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithMany("Videos") + .HasForeignKey("StreetcodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.News.News", b => + { + b.HasOne("Streetcode.DAL.Entities.Media.Images.Image", "Image") + .WithOne("News") + .HasForeignKey("Streetcode.DAL.Entities.News.News", "ImageId"); + + b.Navigation("Image"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Partners.Partner", b => + { + b.HasOne("Streetcode.DAL.Entities.Media.Images.Image", "Logo") + .WithOne("Partner") + .HasForeignKey("Streetcode.DAL.Entities.Partners.Partner", "LogoId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Logo"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Partners.PartnerSourceLink", b => + { + b.HasOne("Streetcode.DAL.Entities.Partners.Partner", "Partner") + .WithMany("PartnerSourceLinks") + .HasForeignKey("PartnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Partner"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Partners.StreetcodePartner", b => + { + b.HasOne("Streetcode.DAL.Entities.Partners.Partner", "Partner") + .WithMany() + .HasForeignKey("PartnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithMany() + .HasForeignKey("StreetcodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Partner"); + + b.Navigation("Streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Sources.SourceLinkCategory", b => + { + b.HasOne("Streetcode.DAL.Entities.Media.Images.Image", "Image") + .WithMany("SourceLinkCategories") + .HasForeignKey("ImageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Image"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Sources.StreetcodeCategoryContent", b => + { + b.HasOne("Streetcode.DAL.Entities.Sources.SourceLinkCategory", "SourceLinkCategory") + .WithMany("StreetcodeCategoryContents") + .HasForeignKey("SourceLinkCategoryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithMany("StreetcodeCategoryContents") + .HasForeignKey("StreetcodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("SourceLinkCategory"); + + b.Navigation("Streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.RelatedFigure", b => + { + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Observer") + .WithMany("Observers") + .HasForeignKey("ObserverId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Target") + .WithMany("Targets") + .HasForeignKey("TargetId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Observer"); + + b.Navigation("Target"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.StreetcodeArt", b => + { + b.HasOne("Streetcode.DAL.Entities.Media.Images.Art", "Art") + .WithMany("StreetcodeArts") + .HasForeignKey("ArtId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithMany("StreetcodeArts") + .HasForeignKey("StreetcodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Art"); + + b.Navigation("Streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", b => + { + b.HasOne("Streetcode.DAL.Entities.Media.Audio", "Audio") + .WithOne("Streetcode") + .HasForeignKey("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "AudioId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("Audio"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.TextContent.Fact", b => + { + b.HasOne("Streetcode.DAL.Entities.Media.Images.Image", "Image") + .WithMany("Facts") + .HasForeignKey("ImageId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithMany("Facts") + .HasForeignKey("StreetcodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Image"); + + b.Navigation("Streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.TextContent.RelatedTerm", b => + { + b.HasOne("Streetcode.DAL.Entities.Streetcode.TextContent.Term", "Term") + .WithMany("RelatedTerms") + .HasForeignKey("TermId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Term"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.TextContent.Text", b => + { + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithOne("Text") + .HasForeignKey("Streetcode.DAL.Entities.Streetcode.TextContent.Text", "StreetcodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Team.TeamMember", b => + { + b.HasOne("Streetcode.DAL.Entities.Media.Images.Image", "Image") + .WithOne("TeamMember") + .HasForeignKey("Streetcode.DAL.Entities.Team.TeamMember", "ImageId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Image"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Team.TeamMemberLink", b => + { + b.HasOne("Streetcode.DAL.Entities.Team.TeamMember", "TeamMember") + .WithMany("TeamMemberLinks") + .HasForeignKey("TeamMemberId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("TeamMember"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Team.TeamMemberPositions", b => + { + b.HasOne("Streetcode.DAL.Entities.Team.Positions", "Positions") + .WithMany() + .HasForeignKey("PositionsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Streetcode.DAL.Entities.Team.TeamMember", "TeamMember") + .WithMany() + .HasForeignKey("TeamMemberId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Positions"); + + b.Navigation("TeamMember"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Timeline.HistoricalContextTimeline", b => + { + b.HasOne("Streetcode.DAL.Entities.Timeline.HistoricalContext", "HistoricalContext") + .WithMany("HistoricalContextTimelines") + .HasForeignKey("HistoricalContextId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Streetcode.DAL.Entities.Timeline.TimelineItem", "Timeline") + .WithMany("HistoricalContextTimelines") + .HasForeignKey("TimelineId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("HistoricalContext"); + + b.Navigation("Timeline"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Timeline.TimelineItem", b => + { + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithMany("TimelineItems") + .HasForeignKey("StreetcodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Toponyms.StreetcodeToponym", b => + { + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithMany() + .HasForeignKey("StreetcodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Streetcode.DAL.Entities.Toponyms.Toponym", "Toponym") + .WithMany() + .HasForeignKey("ToponymId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Streetcode"); + + b.Navigation("Toponym"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Transactions.TransactionLink", b => + { + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithOne("TransactionLink") + .HasForeignKey("Streetcode.DAL.Entities.Transactions.TransactionLink", "StreetcodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Types.StreetcodeCoordinate", b => + { + b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") + .WithMany("Coordinates") + .HasForeignKey("StreetcodeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Types.ToponymCoordinate", b => + { + b.HasOne("Streetcode.DAL.Entities.Toponyms.Toponym", "Toponym") + .WithOne("Coordinate") + .HasForeignKey("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Types.ToponymCoordinate", "ToponymId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Toponym"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Tag", b => + { + b.Navigation("StreetcodeTagIndices"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Media.Audio", b => + { + b.Navigation("Streetcode"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.Art", b => + { + b.Navigation("StreetcodeArts"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.Image", b => + { + b.Navigation("Art"); + + b.Navigation("Facts"); + + b.Navigation("ImageDetails"); + + b.Navigation("News"); + + b.Navigation("Partner"); + + b.Navigation("SourceLinkCategories"); + + b.Navigation("TeamMember"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Partners.Partner", b => + { + b.Navigation("PartnerSourceLinks"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Sources.SourceLinkCategory", b => + { + b.Navigation("StreetcodeCategoryContents"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", b => + { + b.Navigation("Coordinates"); + + b.Navigation("Facts"); + + b.Navigation("Observers"); + + b.Navigation("StatisticRecords"); + + b.Navigation("StreetcodeArts"); + + b.Navigation("StreetcodeCategoryContents"); + + b.Navigation("StreetcodeTagIndices"); + + b.Navigation("Subtitles"); + + b.Navigation("Targets"); + + b.Navigation("Text"); + + b.Navigation("TimelineItems"); + + b.Navigation("TransactionLink"); + + b.Navigation("Videos"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.TextContent.Term", b => + { + b.Navigation("RelatedTerms"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Team.TeamMember", b => + { + b.Navigation("TeamMemberLinks"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Timeline.HistoricalContext", b => + { + b.Navigation("HistoricalContextTimelines"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Timeline.TimelineItem", b => + { + b.Navigation("HistoricalContextTimelines"); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.Toponyms.Toponym", b => + { + b.Navigation("Coordinate") + .IsRequired(); + }); + + modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Types.StreetcodeCoordinate", b => + { + b.Navigation("StatisticRecord") + .IsRequired(); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803195721_Change_StreetcodeCategoryContent_Text_to_7000_simb.cs b/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803195721_Change_StreetcodeCategoryContent_Text_to_7000_simb.cs new file mode 100644 index 000000000..750236a55 --- /dev/null +++ b/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803195721_Change_StreetcodeCategoryContent_Text_to_7000_simb.cs @@ -0,0 +1,37 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Streetcode.DAL.Persistence.Migrations +{ + public partial class Change_StreetcodeCategoryContent_Text_to_7000_simb : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "Text", + schema: "sources", + table: "streetcode_source_link_categories", + type: "nvarchar(max)", + maxLength: 7000, + nullable: false, + oldClrType: typeof(string), + oldType: "nvarchar(4000)", + oldMaxLength: 4000); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "Text", + schema: "sources", + table: "streetcode_source_link_categories", + type: "nvarchar(4000)", + maxLength: 4000, + nullable: false, + oldClrType: typeof(string), + oldType: "nvarchar(max)", + oldMaxLength: 7000); + } + } +} diff --git a/Streetcode/Streetcode.DAL/Persistence/Migrations/StreetcodeDbContextModelSnapshot.cs b/Streetcode/Streetcode.DAL/Persistence/Migrations/StreetcodeDbContextModelSnapshot.cs index bef7c0959..bcf166dee 100644 --- a/Streetcode/Streetcode.DAL/Persistence/Migrations/StreetcodeDbContextModelSnapshot.cs +++ b/Streetcode/Streetcode.DAL/Persistence/Migrations/StreetcodeDbContextModelSnapshot.cs @@ -476,8 +476,8 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("Text") .IsRequired() - .HasMaxLength(4000) - .HasColumnType("nvarchar(4000)"); + .HasMaxLength(7000) + .HasColumnType("nvarchar(max)"); b.HasKey("SourceLinkCategoryId", "StreetcodeId"); diff --git a/Streetcode/Streetcode.WebApi/appsettings.Local.json b/Streetcode/Streetcode.WebApi/appsettings.Local.json index 72176d960..2cbc87149 100644 --- a/Streetcode/Streetcode.WebApi/appsettings.Local.json +++ b/Streetcode/Streetcode.WebApi/appsettings.Local.json @@ -1,6 +1,7 @@ { "ConnectionStrings": { - "DefaultConnection": "Server=localhost;Database=StreetcodeDb;User Id=sa;Password=Admin@1234;MultipleActiveResultSets=true" + //"DefaultConnection": "Server=127.0.0.1;Database=StreetcodeDb;User Id=sa;Password=Admin@1234;MultipleActiveResultSets=true" + "DefaultConnection": "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=StreetcodeDb;Integrated Security=True" }, "CORS": { "AllowedOrigins": [ "http://localhost:3000" ], From 4068c16bce71a04d133ea871d7fb4c2d082a51ea Mon Sep 17 00:00:00 2001 From: ValDekh Date: Fri, 4 Aug 2023 00:18:53 +0300 Subject: [PATCH 4/8] create script for migration --- ...egoryContent_Text_to_5000_simb.Designer.cs | 1568 ----------------- ...egoryContent_Text_to_4000_simb.Designer.cs | 1568 ----------------- ...etcodeCategoryContent_Text_to_4000_simb.cs | 37 - ...etcodeCategoryContent_Text_to_7000_simb.cs | 37 - ...goryContent_Text_to_7000_simb.Designer.cs} | 2 +- ...tcodeCategoryContent_Text_to_7000_simb.cs} | 6 +- .../ScriptsMigration/DDL_last_mig.sql | 586 ++++++ 7 files changed, 590 insertions(+), 3214 deletions(-) delete mode 100644 Streetcode/Streetcode.DAL/Persistence/Migrations/20230803093425_Change_StreetcodeCategoryContent_Text_to_5000_simb.Designer.cs delete mode 100644 Streetcode/Streetcode.DAL/Persistence/Migrations/20230803125439_Change_StreetcodeCategoryContent_Text_to_4000_simb.Designer.cs delete mode 100644 Streetcode/Streetcode.DAL/Persistence/Migrations/20230803125439_Change_StreetcodeCategoryContent_Text_to_4000_simb.cs delete mode 100644 Streetcode/Streetcode.DAL/Persistence/Migrations/20230803195721_Change_StreetcodeCategoryContent_Text_to_7000_simb.cs rename Streetcode/Streetcode.DAL/Persistence/Migrations/{20230803195721_Change_StreetcodeCategoryContent_Text_to_7000_simb.Designer.cs => 20230803205114_Change_StreetcodeCategoryContent_Text_to_7000_simb.Designer.cs} (99%) rename Streetcode/Streetcode.DAL/Persistence/Migrations/{20230803093425_Change_StreetcodeCategoryContent_Text_to_5000_simb.cs => 20230803205114_Change_StreetcodeCategoryContent_Text_to_7000_simb.cs} (92%) create mode 100644 Streetcode/Streetcode.DAL/Persistence/ScriptsMigration/DDL_last_mig.sql diff --git a/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803093425_Change_StreetcodeCategoryContent_Text_to_5000_simb.Designer.cs b/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803093425_Change_StreetcodeCategoryContent_Text_to_5000_simb.Designer.cs deleted file mode 100644 index 9df37a1d0..000000000 --- a/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803093425_Change_StreetcodeCategoryContent_Text_to_5000_simb.Designer.cs +++ /dev/null @@ -1,1568 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Streetcode.DAL.Persistence; - -#nullable disable - -namespace Streetcode.DAL.Persistence.Migrations -{ - [DbContext(typeof(StreetcodeDbContext))] - [Migration("20230803093425_Change_StreetcodeCategoryContent_Text_to_5000_simb")] - partial class Change_StreetcodeCategoryContent_Text_to_5000_simb - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .UseCollation("SQL_Ukrainian_CP1251_CI_AS") - .HasAnnotation("ProductVersion", "6.0.11") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - - modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Coordinate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CoordinateType") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Latitude") - .HasColumnType("decimal(18,4)"); - - b.Property("Longtitude") - .HasColumnType("decimal(18,4)"); - - b.HasKey("Id"); - - b.ToTable("coordinates", "add_content"); - - b.HasDiscriminator("CoordinateType").HasValue("coordinate_base"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.StreetcodeTagIndex", b => - { - b.Property("StreetcodeId") - .HasColumnType("int"); - - b.Property("TagId") - .HasColumnType("int"); - - b.Property("Index") - .HasColumnType("int"); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.HasKey("StreetcodeId", "TagId"); - - b.HasIndex("TagId"); - - b.ToTable("streetcode_tag_index", "add_content"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Subtitle", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("StreetcodeId") - .HasColumnType("int"); - - b.Property("SubtitleText") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.HasKey("Id"); - - b.HasIndex("StreetcodeId"); - - b.ToTable("subtitles", "add_content"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Tag", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Title") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("Id"); - - b.ToTable("tags", "add_content"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Analytics.StatisticRecord", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Address") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Count") - .HasColumnType("int"); - - b.Property("QrId") - .HasColumnType("int"); - - b.Property("StreetcodeCoordinateId") - .HasColumnType("int"); - - b.Property("StreetcodeId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("StreetcodeCoordinateId") - .IsUnique(); - - b.HasIndex("StreetcodeId"); - - b.ToTable("qr_coordinates", "coordinates"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Feedback.Response", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Name") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("Id"); - - b.ToTable("responses", "feedback"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Media.Audio", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("BlobName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("MimeType") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.Property("Title") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("audios", "media"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.Art", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Description") - .HasMaxLength(400) - .HasColumnType("nvarchar(400)"); - - b.Property("ImageId") - .HasColumnType("int"); - - b.Property("Title") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.HasKey("Id"); - - b.HasIndex("ImageId") - .IsUnique(); - - b.ToTable("arts", "media"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.Image", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("BlobName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("MimeType") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.HasKey("Id"); - - b.ToTable("images", "media"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.ImageDetails", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Alt") - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.Property("ImageId") - .HasColumnType("int"); - - b.Property("Title") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.HasIndex("ImageId") - .IsUnique(); - - b.ToTable("image_details", "media"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.StreetcodeImage", b => - { - b.Property("ImageId") - .HasColumnType("int"); - - b.Property("StreetcodeId") - .HasColumnType("int"); - - b.HasKey("ImageId", "StreetcodeId"); - - b.HasIndex("StreetcodeId"); - - b.ToTable("streetcode_image", "streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Media.Video", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("StreetcodeId") - .HasColumnType("int"); - - b.Property("Title") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Url") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("StreetcodeId"); - - b.ToTable("videos", "media"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.News.News", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreationDate") - .HasColumnType("datetime2"); - - b.Property("ImageId") - .HasColumnType("int"); - - b.Property("Text") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("URL") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.HasIndex("ImageId") - .IsUnique() - .HasFilter("[ImageId] IS NOT NULL"); - - b.HasIndex("URL") - .IsUnique(); - - b.ToTable("news", "news"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Partners.Partner", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Description") - .HasMaxLength(600) - .HasColumnType("nvarchar(600)"); - - b.Property("IsKeyPartner") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleEverywhere") - .HasColumnType("bit"); - - b.Property("LogoId") - .HasColumnType("int"); - - b.Property("TargetUrl") - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.Property("UrlTitle") - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("LogoId") - .IsUnique(); - - b.ToTable("partners", "partners"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Partners.PartnerSourceLink", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("LogoType") - .HasColumnType("tinyint"); - - b.Property("PartnerId") - .HasColumnType("int"); - - b.Property("TargetUrl") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("PartnerId"); - - b.ToTable("partner_source_links", "partners"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Partners.StreetcodePartner", b => - { - b.Property("PartnerId") - .HasColumnType("int"); - - b.Property("StreetcodeId") - .HasColumnType("int"); - - b.HasKey("PartnerId", "StreetcodeId"); - - b.HasIndex("StreetcodeId"); - - b.ToTable("streetcode_partners", "streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Sources.SourceLinkCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ImageId") - .HasColumnType("int"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.HasIndex("ImageId"); - - b.ToTable("source_link_categories", "sources"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Sources.StreetcodeCategoryContent", b => - { - b.Property("SourceLinkCategoryId") - .HasColumnType("int"); - - b.Property("StreetcodeId") - .HasColumnType("int"); - - b.Property("Text") - .IsRequired() - .HasMaxLength(5000) - .HasColumnType("nvarchar(max)"); - - b.HasKey("SourceLinkCategoryId", "StreetcodeId"); - - b.HasIndex("StreetcodeId"); - - b.ToTable("streetcode_source_link_categories", "sources"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.RelatedFigure", b => - { - b.Property("ObserverId") - .HasColumnType("int"); - - b.Property("TargetId") - .HasColumnType("int"); - - b.HasKey("ObserverId", "TargetId"); - - b.HasIndex("TargetId"); - - b.ToTable("related_figures", "streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.StreetcodeArt", b => - { - b.Property("ArtId") - .HasColumnType("int"); - - b.Property("StreetcodeId") - .HasColumnType("int"); - - b.Property("Index") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(1); - - b.HasKey("ArtId", "StreetcodeId"); - - b.HasIndex("StreetcodeId"); - - b.HasIndex("ArtId", "StreetcodeId"); - - b.ToTable("streetcode_art", "streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Alias") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("AudioId") - .HasColumnType("int"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime2") - .HasDefaultValueSql("GETDATE()"); - - b.Property("DateString") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("EventEndOrPersonDeathDate") - .HasColumnType("datetime2"); - - b.Property("EventStartOrPersonBirthDate") - .HasColumnType("datetime2"); - - b.Property("Index") - .HasColumnType("int"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("StreetcodeType") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Teaser") - .HasMaxLength(650) - .HasColumnType("nvarchar(650)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("TransliterationUrl") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime2") - .HasDefaultValueSql("GETDATE()"); - - b.Property("ViewCount") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.HasKey("Id"); - - b.HasIndex("AudioId") - .IsUnique() - .HasFilter("[AudioId] IS NOT NULL"); - - b.HasIndex("Index") - .IsUnique(); - - b.HasIndex("TransliterationUrl") - .IsUnique(); - - b.ToTable("streetcodes", "streetcode"); - - b.HasDiscriminator("StreetcodeType").HasValue("streetcode-base"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.TextContent.Fact", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("FactContent") - .IsRequired() - .HasMaxLength(600) - .HasColumnType("nvarchar(600)"); - - b.Property("ImageId") - .HasColumnType("int"); - - b.Property("StreetcodeId") - .HasColumnType("int"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.HasIndex("ImageId"); - - b.HasIndex("StreetcodeId"); - - b.ToTable("facts", "streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.TextContent.RelatedTerm", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("TermId") - .HasColumnType("int"); - - b.Property("Word") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("Id"); - - b.HasIndex("TermId"); - - b.ToTable("related_terms", "streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.TextContent.Term", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Description") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("Id"); - - b.ToTable("terms", "streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.TextContent.Text", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AdditionalText") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("StreetcodeId") - .HasColumnType("int"); - - b.Property("TextContent") - .IsRequired() - .HasMaxLength(15000) - .HasColumnType("nvarchar(max)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.HasKey("Id"); - - b.HasIndex("StreetcodeId") - .IsUnique(); - - b.ToTable("texts", "streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Team.Positions", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Position") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("Id"); - - b.ToTable("positions", "team"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Team.TeamMember", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Description") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ImageId") - .HasColumnType("int"); - - b.Property("IsMain") - .HasColumnType("bit"); - - b.Property("LastName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("Id"); - - b.HasIndex("ImageId") - .IsUnique(); - - b.ToTable("team_members", "team"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Team.TeamMemberLink", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("LogoType") - .HasColumnType("tinyint"); - - b.Property("TargetUrl") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.Property("TeamMemberId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TeamMemberId"); - - b.ToTable("team_member_links", "team"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Team.TeamMemberPositions", b => - { - b.Property("TeamMemberId") - .HasColumnType("int"); - - b.Property("PositionsId") - .HasColumnType("int"); - - b.HasKey("TeamMemberId", "PositionsId"); - - b.HasIndex("PositionsId"); - - b.ToTable("team_member_positions", "team"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Timeline.HistoricalContext", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Title") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("Id"); - - b.ToTable("historical_contexts", "timeline"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Timeline.HistoricalContextTimeline", b => - { - b.Property("TimelineId") - .HasColumnType("int"); - - b.Property("HistoricalContextId") - .HasColumnType("int"); - - b.HasKey("TimelineId", "HistoricalContextId"); - - b.HasIndex("HistoricalContextId"); - - b.ToTable("HistoricalContextsTimelines"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Timeline.TimelineItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Date") - .HasColumnType("datetime2"); - - b.Property("DateViewPattern") - .HasColumnType("int"); - - b.Property("Description") - .HasMaxLength(600) - .HasColumnType("nvarchar(600)"); - - b.Property("StreetcodeId") - .HasColumnType("int"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.HasIndex("StreetcodeId"); - - b.ToTable("timeline_items", "timeline"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Toponyms.StreetcodeToponym", b => - { - b.Property("StreetcodeId") - .HasColumnType("int"); - - b.Property("ToponymId") - .HasColumnType("int"); - - b.HasKey("StreetcodeId", "ToponymId"); - - b.HasIndex("ToponymId"); - - b.ToTable("streetcode_toponym", "streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Toponyms.Toponym", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AdminRegionNew") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("AdminRegionOld") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Community") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Gromada") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Oblast") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("StreetName") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("StreetType") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("Id"); - - b.ToTable("toponyms", "toponyms"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Transactions.TransactionLink", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("StreetcodeId") - .HasColumnType("int"); - - b.Property("Url") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.Property("UrlTitle") - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("StreetcodeId") - .IsUnique(); - - b.ToTable("transaction_links", "transactions"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Users.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Email") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Login") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Password") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("Role") - .HasColumnType("int"); - - b.Property("Surname") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("Id"); - - b.ToTable("Users", "Users"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Types.StreetcodeCoordinate", b => - { - b.HasBaseType("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Coordinate"); - - b.Property("StreetcodeId") - .HasColumnType("int"); - - b.HasIndex("StreetcodeId"); - - b.ToTable("coordinates", "add_content"); - - b.HasDiscriminator().HasValue("coordinate_streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Types.ToponymCoordinate", b => - { - b.HasBaseType("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Coordinate"); - - b.Property("ToponymId") - .HasColumnType("int"); - - b.HasIndex("ToponymId") - .IsUnique() - .HasFilter("[ToponymId] IS NOT NULL"); - - b.ToTable("coordinates", "add_content"); - - b.HasDiscriminator().HasValue("coordinate_toponym"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.Types.EventStreetcode", b => - { - b.HasBaseType("Streetcode.DAL.Entities.Streetcode.StreetcodeContent"); - - b.ToTable("streetcodes", "streetcode"); - - b.HasDiscriminator().HasValue("streetcode-event"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.Types.PersonStreetcode", b => - { - b.HasBaseType("Streetcode.DAL.Entities.Streetcode.StreetcodeContent"); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Rank") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.ToTable("streetcodes", "streetcode"); - - b.HasDiscriminator().HasValue("streetcode-person"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.StreetcodeTagIndex", b => - { - b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") - .WithMany("StreetcodeTagIndices") - .HasForeignKey("StreetcodeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Streetcode.DAL.Entities.AdditionalContent.Tag", "Tag") - .WithMany("StreetcodeTagIndices") - .HasForeignKey("TagId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Streetcode"); - - b.Navigation("Tag"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Subtitle", b => - { - b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") - .WithMany("Subtitles") - .HasForeignKey("StreetcodeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Analytics.StatisticRecord", b => - { - b.HasOne("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Types.StreetcodeCoordinate", "StreetcodeCoordinate") - .WithOne("StatisticRecord") - .HasForeignKey("Streetcode.DAL.Entities.Analytics.StatisticRecord", "StreetcodeCoordinateId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") - .WithMany("StatisticRecords") - .HasForeignKey("StreetcodeId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Streetcode"); - - b.Navigation("StreetcodeCoordinate"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.Art", b => - { - b.HasOne("Streetcode.DAL.Entities.Media.Images.Image", "Image") - .WithOne("Art") - .HasForeignKey("Streetcode.DAL.Entities.Media.Images.Art", "ImageId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Image"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.ImageDetails", b => - { - b.HasOne("Streetcode.DAL.Entities.Media.Images.Image", "Image") - .WithOne("ImageDetails") - .HasForeignKey("Streetcode.DAL.Entities.Media.Images.ImageDetails", "ImageId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Image"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.StreetcodeImage", b => - { - b.HasOne("Streetcode.DAL.Entities.Media.Images.Image", "Image") - .WithMany() - .HasForeignKey("ImageId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") - .WithMany() - .HasForeignKey("StreetcodeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Image"); - - b.Navigation("Streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Media.Video", b => - { - b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") - .WithMany("Videos") - .HasForeignKey("StreetcodeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.News.News", b => - { - b.HasOne("Streetcode.DAL.Entities.Media.Images.Image", "Image") - .WithOne("News") - .HasForeignKey("Streetcode.DAL.Entities.News.News", "ImageId"); - - b.Navigation("Image"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Partners.Partner", b => - { - b.HasOne("Streetcode.DAL.Entities.Media.Images.Image", "Logo") - .WithOne("Partner") - .HasForeignKey("Streetcode.DAL.Entities.Partners.Partner", "LogoId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Logo"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Partners.PartnerSourceLink", b => - { - b.HasOne("Streetcode.DAL.Entities.Partners.Partner", "Partner") - .WithMany("PartnerSourceLinks") - .HasForeignKey("PartnerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Partner"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Partners.StreetcodePartner", b => - { - b.HasOne("Streetcode.DAL.Entities.Partners.Partner", "Partner") - .WithMany() - .HasForeignKey("PartnerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") - .WithMany() - .HasForeignKey("StreetcodeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Partner"); - - b.Navigation("Streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Sources.SourceLinkCategory", b => - { - b.HasOne("Streetcode.DAL.Entities.Media.Images.Image", "Image") - .WithMany("SourceLinkCategories") - .HasForeignKey("ImageId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Image"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Sources.StreetcodeCategoryContent", b => - { - b.HasOne("Streetcode.DAL.Entities.Sources.SourceLinkCategory", "SourceLinkCategory") - .WithMany("StreetcodeCategoryContents") - .HasForeignKey("SourceLinkCategoryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") - .WithMany("StreetcodeCategoryContents") - .HasForeignKey("StreetcodeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SourceLinkCategory"); - - b.Navigation("Streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.RelatedFigure", b => - { - b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Observer") - .WithMany("Observers") - .HasForeignKey("ObserverId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Target") - .WithMany("Targets") - .HasForeignKey("TargetId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Observer"); - - b.Navigation("Target"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.StreetcodeArt", b => - { - b.HasOne("Streetcode.DAL.Entities.Media.Images.Art", "Art") - .WithMany("StreetcodeArts") - .HasForeignKey("ArtId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") - .WithMany("StreetcodeArts") - .HasForeignKey("StreetcodeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Art"); - - b.Navigation("Streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", b => - { - b.HasOne("Streetcode.DAL.Entities.Media.Audio", "Audio") - .WithOne("Streetcode") - .HasForeignKey("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "AudioId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("Audio"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.TextContent.Fact", b => - { - b.HasOne("Streetcode.DAL.Entities.Media.Images.Image", "Image") - .WithMany("Facts") - .HasForeignKey("ImageId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") - .WithMany("Facts") - .HasForeignKey("StreetcodeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Image"); - - b.Navigation("Streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.TextContent.RelatedTerm", b => - { - b.HasOne("Streetcode.DAL.Entities.Streetcode.TextContent.Term", "Term") - .WithMany("RelatedTerms") - .HasForeignKey("TermId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Term"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.TextContent.Text", b => - { - b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") - .WithOne("Text") - .HasForeignKey("Streetcode.DAL.Entities.Streetcode.TextContent.Text", "StreetcodeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Team.TeamMember", b => - { - b.HasOne("Streetcode.DAL.Entities.Media.Images.Image", "Image") - .WithOne("TeamMember") - .HasForeignKey("Streetcode.DAL.Entities.Team.TeamMember", "ImageId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Image"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Team.TeamMemberLink", b => - { - b.HasOne("Streetcode.DAL.Entities.Team.TeamMember", "TeamMember") - .WithMany("TeamMemberLinks") - .HasForeignKey("TeamMemberId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("TeamMember"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Team.TeamMemberPositions", b => - { - b.HasOne("Streetcode.DAL.Entities.Team.Positions", "Positions") - .WithMany() - .HasForeignKey("PositionsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Streetcode.DAL.Entities.Team.TeamMember", "TeamMember") - .WithMany() - .HasForeignKey("TeamMemberId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Positions"); - - b.Navigation("TeamMember"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Timeline.HistoricalContextTimeline", b => - { - b.HasOne("Streetcode.DAL.Entities.Timeline.HistoricalContext", "HistoricalContext") - .WithMany("HistoricalContextTimelines") - .HasForeignKey("HistoricalContextId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Streetcode.DAL.Entities.Timeline.TimelineItem", "Timeline") - .WithMany("HistoricalContextTimelines") - .HasForeignKey("TimelineId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("HistoricalContext"); - - b.Navigation("Timeline"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Timeline.TimelineItem", b => - { - b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") - .WithMany("TimelineItems") - .HasForeignKey("StreetcodeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Toponyms.StreetcodeToponym", b => - { - b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") - .WithMany() - .HasForeignKey("StreetcodeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Streetcode.DAL.Entities.Toponyms.Toponym", "Toponym") - .WithMany() - .HasForeignKey("ToponymId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Streetcode"); - - b.Navigation("Toponym"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Transactions.TransactionLink", b => - { - b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") - .WithOne("TransactionLink") - .HasForeignKey("Streetcode.DAL.Entities.Transactions.TransactionLink", "StreetcodeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Types.StreetcodeCoordinate", b => - { - b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") - .WithMany("Coordinates") - .HasForeignKey("StreetcodeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Types.ToponymCoordinate", b => - { - b.HasOne("Streetcode.DAL.Entities.Toponyms.Toponym", "Toponym") - .WithOne("Coordinate") - .HasForeignKey("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Types.ToponymCoordinate", "ToponymId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Toponym"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Tag", b => - { - b.Navigation("StreetcodeTagIndices"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Media.Audio", b => - { - b.Navigation("Streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.Art", b => - { - b.Navigation("StreetcodeArts"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.Image", b => - { - b.Navigation("Art"); - - b.Navigation("Facts"); - - b.Navigation("ImageDetails"); - - b.Navigation("News"); - - b.Navigation("Partner"); - - b.Navigation("SourceLinkCategories"); - - b.Navigation("TeamMember"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Partners.Partner", b => - { - b.Navigation("PartnerSourceLinks"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Sources.SourceLinkCategory", b => - { - b.Navigation("StreetcodeCategoryContents"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", b => - { - b.Navigation("Coordinates"); - - b.Navigation("Facts"); - - b.Navigation("Observers"); - - b.Navigation("StatisticRecords"); - - b.Navigation("StreetcodeArts"); - - b.Navigation("StreetcodeCategoryContents"); - - b.Navigation("StreetcodeTagIndices"); - - b.Navigation("Subtitles"); - - b.Navigation("Targets"); - - b.Navigation("Text"); - - b.Navigation("TimelineItems"); - - b.Navigation("TransactionLink"); - - b.Navigation("Videos"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.TextContent.Term", b => - { - b.Navigation("RelatedTerms"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Team.TeamMember", b => - { - b.Navigation("TeamMemberLinks"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Timeline.HistoricalContext", b => - { - b.Navigation("HistoricalContextTimelines"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Timeline.TimelineItem", b => - { - b.Navigation("HistoricalContextTimelines"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Toponyms.Toponym", b => - { - b.Navigation("Coordinate") - .IsRequired(); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Types.StreetcodeCoordinate", b => - { - b.Navigation("StatisticRecord") - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803125439_Change_StreetcodeCategoryContent_Text_to_4000_simb.Designer.cs b/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803125439_Change_StreetcodeCategoryContent_Text_to_4000_simb.Designer.cs deleted file mode 100644 index 503009398..000000000 --- a/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803125439_Change_StreetcodeCategoryContent_Text_to_4000_simb.Designer.cs +++ /dev/null @@ -1,1568 +0,0 @@ -// -using System; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Streetcode.DAL.Persistence; - -#nullable disable - -namespace Streetcode.DAL.Persistence.Migrations -{ - [DbContext(typeof(StreetcodeDbContext))] - [Migration("20230803125439_Change_StreetcodeCategoryContent_Text_to_4000_simb")] - partial class Change_StreetcodeCategoryContent_Text_to_4000_simb - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .UseCollation("SQL_Ukrainian_CP1251_CI_AS") - .HasAnnotation("ProductVersion", "6.0.11") - .HasAnnotation("Relational:MaxIdentifierLength", 128); - - SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); - - modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Coordinate", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CoordinateType") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Latitude") - .HasColumnType("decimal(18,4)"); - - b.Property("Longtitude") - .HasColumnType("decimal(18,4)"); - - b.HasKey("Id"); - - b.ToTable("coordinates", "add_content"); - - b.HasDiscriminator("CoordinateType").HasValue("coordinate_base"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.StreetcodeTagIndex", b => - { - b.Property("StreetcodeId") - .HasColumnType("int"); - - b.Property("TagId") - .HasColumnType("int"); - - b.Property("Index") - .HasColumnType("int"); - - b.Property("IsVisible") - .HasColumnType("bit"); - - b.HasKey("StreetcodeId", "TagId"); - - b.HasIndex("TagId"); - - b.ToTable("streetcode_tag_index", "add_content"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Subtitle", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("StreetcodeId") - .HasColumnType("int"); - - b.Property("SubtitleText") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.HasKey("Id"); - - b.HasIndex("StreetcodeId"); - - b.ToTable("subtitles", "add_content"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Tag", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Title") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("Id"); - - b.ToTable("tags", "add_content"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Analytics.StatisticRecord", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Address") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Count") - .HasColumnType("int"); - - b.Property("QrId") - .HasColumnType("int"); - - b.Property("StreetcodeCoordinateId") - .HasColumnType("int"); - - b.Property("StreetcodeId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("StreetcodeCoordinateId") - .IsUnique(); - - b.HasIndex("StreetcodeId"); - - b.ToTable("qr_coordinates", "coordinates"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Feedback.Response", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Description") - .HasMaxLength(1000) - .HasColumnType("nvarchar(1000)"); - - b.Property("Email") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Name") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("Id"); - - b.ToTable("responses", "feedback"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Media.Audio", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("BlobName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("MimeType") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.Property("Title") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.ToTable("audios", "media"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.Art", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Description") - .HasMaxLength(400) - .HasColumnType("nvarchar(400)"); - - b.Property("ImageId") - .HasColumnType("int"); - - b.Property("Title") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.HasKey("Id"); - - b.HasIndex("ImageId") - .IsUnique(); - - b.ToTable("arts", "media"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.Image", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("BlobName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("MimeType") - .IsRequired() - .HasMaxLength(10) - .HasColumnType("nvarchar(10)"); - - b.HasKey("Id"); - - b.ToTable("images", "media"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.ImageDetails", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Alt") - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.Property("ImageId") - .HasColumnType("int"); - - b.Property("Title") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.HasIndex("ImageId") - .IsUnique(); - - b.ToTable("image_details", "media"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.StreetcodeImage", b => - { - b.Property("ImageId") - .HasColumnType("int"); - - b.Property("StreetcodeId") - .HasColumnType("int"); - - b.HasKey("ImageId", "StreetcodeId"); - - b.HasIndex("StreetcodeId"); - - b.ToTable("streetcode_image", "streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Media.Video", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("StreetcodeId") - .HasColumnType("int"); - - b.Property("Title") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Url") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("StreetcodeId"); - - b.ToTable("videos", "media"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.News.News", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("CreationDate") - .HasColumnType("datetime2"); - - b.Property("ImageId") - .HasColumnType("int"); - - b.Property("Text") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("URL") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.HasIndex("ImageId") - .IsUnique() - .HasFilter("[ImageId] IS NOT NULL"); - - b.HasIndex("URL") - .IsUnique(); - - b.ToTable("news", "news"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Partners.Partner", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Description") - .HasMaxLength(600) - .HasColumnType("nvarchar(600)"); - - b.Property("IsKeyPartner") - .ValueGeneratedOnAdd() - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("IsVisibleEverywhere") - .HasColumnType("bit"); - - b.Property("LogoId") - .HasColumnType("int"); - - b.Property("TargetUrl") - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.Property("UrlTitle") - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("LogoId") - .IsUnique(); - - b.ToTable("partners", "partners"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Partners.PartnerSourceLink", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("LogoType") - .HasColumnType("tinyint"); - - b.Property("PartnerId") - .HasColumnType("int"); - - b.Property("TargetUrl") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("PartnerId"); - - b.ToTable("partner_source_links", "partners"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Partners.StreetcodePartner", b => - { - b.Property("PartnerId") - .HasColumnType("int"); - - b.Property("StreetcodeId") - .HasColumnType("int"); - - b.HasKey("PartnerId", "StreetcodeId"); - - b.HasIndex("StreetcodeId"); - - b.ToTable("streetcode_partners", "streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Sources.SourceLinkCategory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("ImageId") - .HasColumnType("int"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.HasIndex("ImageId"); - - b.ToTable("source_link_categories", "sources"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Sources.StreetcodeCategoryContent", b => - { - b.Property("SourceLinkCategoryId") - .HasColumnType("int"); - - b.Property("StreetcodeId") - .HasColumnType("int"); - - b.Property("Text") - .IsRequired() - .HasMaxLength(4000) - .HasColumnType("nvarchar(4000)"); - - b.HasKey("SourceLinkCategoryId", "StreetcodeId"); - - b.HasIndex("StreetcodeId"); - - b.ToTable("streetcode_source_link_categories", "sources"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.RelatedFigure", b => - { - b.Property("ObserverId") - .HasColumnType("int"); - - b.Property("TargetId") - .HasColumnType("int"); - - b.HasKey("ObserverId", "TargetId"); - - b.HasIndex("TargetId"); - - b.ToTable("related_figures", "streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.StreetcodeArt", b => - { - b.Property("ArtId") - .HasColumnType("int"); - - b.Property("StreetcodeId") - .HasColumnType("int"); - - b.Property("Index") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(1); - - b.HasKey("ArtId", "StreetcodeId"); - - b.HasIndex("StreetcodeId"); - - b.HasIndex("ArtId", "StreetcodeId"); - - b.ToTable("streetcode_art", "streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Alias") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("AudioId") - .HasColumnType("int"); - - b.Property("CreatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime2") - .HasDefaultValueSql("GETDATE()"); - - b.Property("DateString") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("EventEndOrPersonDeathDate") - .HasColumnType("datetime2"); - - b.Property("EventStartOrPersonBirthDate") - .HasColumnType("datetime2"); - - b.Property("Index") - .HasColumnType("int"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("StreetcodeType") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Teaser") - .HasMaxLength(650) - .HasColumnType("nvarchar(650)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("TransliterationUrl") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("UpdatedAt") - .ValueGeneratedOnAdd() - .HasColumnType("datetime2") - .HasDefaultValueSql("GETDATE()"); - - b.Property("ViewCount") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(0); - - b.HasKey("Id"); - - b.HasIndex("AudioId") - .IsUnique() - .HasFilter("[AudioId] IS NOT NULL"); - - b.HasIndex("Index") - .IsUnique(); - - b.HasIndex("TransliterationUrl") - .IsUnique(); - - b.ToTable("streetcodes", "streetcode"); - - b.HasDiscriminator("StreetcodeType").HasValue("streetcode-base"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.TextContent.Fact", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("FactContent") - .IsRequired() - .HasMaxLength(600) - .HasColumnType("nvarchar(600)"); - - b.Property("ImageId") - .HasColumnType("int"); - - b.Property("StreetcodeId") - .HasColumnType("int"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.HasIndex("ImageId"); - - b.HasIndex("StreetcodeId"); - - b.ToTable("facts", "streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.TextContent.RelatedTerm", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("TermId") - .HasColumnType("int"); - - b.Property("Word") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("Id"); - - b.HasIndex("TermId"); - - b.ToTable("related_terms", "streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.TextContent.Term", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Description") - .IsRequired() - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("Id"); - - b.ToTable("terms", "streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.TextContent.Text", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AdditionalText") - .HasMaxLength(500) - .HasColumnType("nvarchar(500)"); - - b.Property("StreetcodeId") - .HasColumnType("int"); - - b.Property("TextContent") - .IsRequired() - .HasMaxLength(15000) - .HasColumnType("nvarchar(max)"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(300) - .HasColumnType("nvarchar(300)"); - - b.HasKey("Id"); - - b.HasIndex("StreetcodeId") - .IsUnique(); - - b.ToTable("texts", "streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Team.Positions", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Position") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("Id"); - - b.ToTable("positions", "team"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Team.TeamMember", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Description") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ImageId") - .HasColumnType("int"); - - b.Property("IsMain") - .HasColumnType("bit"); - - b.Property("LastName") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("Id"); - - b.HasIndex("ImageId") - .IsUnique(); - - b.ToTable("team_members", "team"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Team.TeamMemberLink", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("LogoType") - .HasColumnType("tinyint"); - - b.Property("TargetUrl") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.Property("TeamMemberId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TeamMemberId"); - - b.ToTable("team_member_links", "team"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Team.TeamMemberPositions", b => - { - b.Property("TeamMemberId") - .HasColumnType("int"); - - b.Property("PositionsId") - .HasColumnType("int"); - - b.HasKey("TeamMemberId", "PositionsId"); - - b.HasIndex("PositionsId"); - - b.ToTable("team_member_positions", "team"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Timeline.HistoricalContext", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Title") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("Id"); - - b.ToTable("historical_contexts", "timeline"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Timeline.HistoricalContextTimeline", b => - { - b.Property("TimelineId") - .HasColumnType("int"); - - b.Property("HistoricalContextId") - .HasColumnType("int"); - - b.HasKey("TimelineId", "HistoricalContextId"); - - b.HasIndex("HistoricalContextId"); - - b.ToTable("HistoricalContextsTimelines"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Timeline.TimelineItem", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Date") - .HasColumnType("datetime2"); - - b.Property("DateViewPattern") - .HasColumnType("int"); - - b.Property("Description") - .HasMaxLength(600) - .HasColumnType("nvarchar(600)"); - - b.Property("StreetcodeId") - .HasColumnType("int"); - - b.Property("Title") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.HasKey("Id"); - - b.HasIndex("StreetcodeId"); - - b.ToTable("timeline_items", "timeline"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Toponyms.StreetcodeToponym", b => - { - b.Property("StreetcodeId") - .HasColumnType("int"); - - b.Property("ToponymId") - .HasColumnType("int"); - - b.HasKey("StreetcodeId", "ToponymId"); - - b.HasIndex("ToponymId"); - - b.ToTable("streetcode_toponym", "streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Toponyms.Toponym", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("AdminRegionNew") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("AdminRegionOld") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Community") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Gromada") - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("Oblast") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("StreetName") - .IsRequired() - .HasMaxLength(150) - .HasColumnType("nvarchar(150)"); - - b.Property("StreetType") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("Id"); - - b.ToTable("toponyms", "toponyms"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Transactions.TransactionLink", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("StreetcodeId") - .HasColumnType("int"); - - b.Property("Url") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.Property("UrlTitle") - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b.HasKey("Id"); - - b.HasIndex("StreetcodeId") - .IsUnique(); - - b.ToTable("transaction_links", "transactions"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Users.User", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); - - b.Property("Email") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Login") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Password") - .IsRequired() - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("Role") - .HasColumnType("int"); - - b.Property("Surname") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.HasKey("Id"); - - b.ToTable("Users", "Users"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Types.StreetcodeCoordinate", b => - { - b.HasBaseType("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Coordinate"); - - b.Property("StreetcodeId") - .HasColumnType("int"); - - b.HasIndex("StreetcodeId"); - - b.ToTable("coordinates", "add_content"); - - b.HasDiscriminator().HasValue("coordinate_streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Types.ToponymCoordinate", b => - { - b.HasBaseType("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Coordinate"); - - b.Property("ToponymId") - .HasColumnType("int"); - - b.HasIndex("ToponymId") - .IsUnique() - .HasFilter("[ToponymId] IS NOT NULL"); - - b.ToTable("coordinates", "add_content"); - - b.HasDiscriminator().HasValue("coordinate_toponym"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.Types.EventStreetcode", b => - { - b.HasBaseType("Streetcode.DAL.Entities.Streetcode.StreetcodeContent"); - - b.ToTable("streetcodes", "streetcode"); - - b.HasDiscriminator().HasValue("streetcode-event"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.Types.PersonStreetcode", b => - { - b.HasBaseType("Streetcode.DAL.Entities.Streetcode.StreetcodeContent"); - - b.Property("FirstName") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("LastName") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Rank") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.ToTable("streetcodes", "streetcode"); - - b.HasDiscriminator().HasValue("streetcode-person"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.StreetcodeTagIndex", b => - { - b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") - .WithMany("StreetcodeTagIndices") - .HasForeignKey("StreetcodeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Streetcode.DAL.Entities.AdditionalContent.Tag", "Tag") - .WithMany("StreetcodeTagIndices") - .HasForeignKey("TagId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Streetcode"); - - b.Navigation("Tag"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Subtitle", b => - { - b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") - .WithMany("Subtitles") - .HasForeignKey("StreetcodeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Analytics.StatisticRecord", b => - { - b.HasOne("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Types.StreetcodeCoordinate", "StreetcodeCoordinate") - .WithOne("StatisticRecord") - .HasForeignKey("Streetcode.DAL.Entities.Analytics.StatisticRecord", "StreetcodeCoordinateId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") - .WithMany("StatisticRecords") - .HasForeignKey("StreetcodeId") - .OnDelete(DeleteBehavior.NoAction) - .IsRequired(); - - b.Navigation("Streetcode"); - - b.Navigation("StreetcodeCoordinate"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.Art", b => - { - b.HasOne("Streetcode.DAL.Entities.Media.Images.Image", "Image") - .WithOne("Art") - .HasForeignKey("Streetcode.DAL.Entities.Media.Images.Art", "ImageId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Image"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.ImageDetails", b => - { - b.HasOne("Streetcode.DAL.Entities.Media.Images.Image", "Image") - .WithOne("ImageDetails") - .HasForeignKey("Streetcode.DAL.Entities.Media.Images.ImageDetails", "ImageId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Image"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.StreetcodeImage", b => - { - b.HasOne("Streetcode.DAL.Entities.Media.Images.Image", "Image") - .WithMany() - .HasForeignKey("ImageId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") - .WithMany() - .HasForeignKey("StreetcodeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Image"); - - b.Navigation("Streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Media.Video", b => - { - b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") - .WithMany("Videos") - .HasForeignKey("StreetcodeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.News.News", b => - { - b.HasOne("Streetcode.DAL.Entities.Media.Images.Image", "Image") - .WithOne("News") - .HasForeignKey("Streetcode.DAL.Entities.News.News", "ImageId"); - - b.Navigation("Image"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Partners.Partner", b => - { - b.HasOne("Streetcode.DAL.Entities.Media.Images.Image", "Logo") - .WithOne("Partner") - .HasForeignKey("Streetcode.DAL.Entities.Partners.Partner", "LogoId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Logo"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Partners.PartnerSourceLink", b => - { - b.HasOne("Streetcode.DAL.Entities.Partners.Partner", "Partner") - .WithMany("PartnerSourceLinks") - .HasForeignKey("PartnerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Partner"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Partners.StreetcodePartner", b => - { - b.HasOne("Streetcode.DAL.Entities.Partners.Partner", "Partner") - .WithMany() - .HasForeignKey("PartnerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") - .WithMany() - .HasForeignKey("StreetcodeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Partner"); - - b.Navigation("Streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Sources.SourceLinkCategory", b => - { - b.HasOne("Streetcode.DAL.Entities.Media.Images.Image", "Image") - .WithMany("SourceLinkCategories") - .HasForeignKey("ImageId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Image"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Sources.StreetcodeCategoryContent", b => - { - b.HasOne("Streetcode.DAL.Entities.Sources.SourceLinkCategory", "SourceLinkCategory") - .WithMany("StreetcodeCategoryContents") - .HasForeignKey("SourceLinkCategoryId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") - .WithMany("StreetcodeCategoryContents") - .HasForeignKey("StreetcodeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("SourceLinkCategory"); - - b.Navigation("Streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.RelatedFigure", b => - { - b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Observer") - .WithMany("Observers") - .HasForeignKey("ObserverId") - .OnDelete(DeleteBehavior.Restrict) - .IsRequired(); - - b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Target") - .WithMany("Targets") - .HasForeignKey("TargetId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Observer"); - - b.Navigation("Target"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.StreetcodeArt", b => - { - b.HasOne("Streetcode.DAL.Entities.Media.Images.Art", "Art") - .WithMany("StreetcodeArts") - .HasForeignKey("ArtId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") - .WithMany("StreetcodeArts") - .HasForeignKey("StreetcodeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Art"); - - b.Navigation("Streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", b => - { - b.HasOne("Streetcode.DAL.Entities.Media.Audio", "Audio") - .WithOne("Streetcode") - .HasForeignKey("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "AudioId") - .OnDelete(DeleteBehavior.Cascade); - - b.Navigation("Audio"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.TextContent.Fact", b => - { - b.HasOne("Streetcode.DAL.Entities.Media.Images.Image", "Image") - .WithMany("Facts") - .HasForeignKey("ImageId") - .OnDelete(DeleteBehavior.Cascade); - - b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") - .WithMany("Facts") - .HasForeignKey("StreetcodeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Image"); - - b.Navigation("Streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.TextContent.RelatedTerm", b => - { - b.HasOne("Streetcode.DAL.Entities.Streetcode.TextContent.Term", "Term") - .WithMany("RelatedTerms") - .HasForeignKey("TermId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Term"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.TextContent.Text", b => - { - b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") - .WithOne("Text") - .HasForeignKey("Streetcode.DAL.Entities.Streetcode.TextContent.Text", "StreetcodeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Team.TeamMember", b => - { - b.HasOne("Streetcode.DAL.Entities.Media.Images.Image", "Image") - .WithOne("TeamMember") - .HasForeignKey("Streetcode.DAL.Entities.Team.TeamMember", "ImageId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Image"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Team.TeamMemberLink", b => - { - b.HasOne("Streetcode.DAL.Entities.Team.TeamMember", "TeamMember") - .WithMany("TeamMemberLinks") - .HasForeignKey("TeamMemberId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("TeamMember"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Team.TeamMemberPositions", b => - { - b.HasOne("Streetcode.DAL.Entities.Team.Positions", "Positions") - .WithMany() - .HasForeignKey("PositionsId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Streetcode.DAL.Entities.Team.TeamMember", "TeamMember") - .WithMany() - .HasForeignKey("TeamMemberId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Positions"); - - b.Navigation("TeamMember"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Timeline.HistoricalContextTimeline", b => - { - b.HasOne("Streetcode.DAL.Entities.Timeline.HistoricalContext", "HistoricalContext") - .WithMany("HistoricalContextTimelines") - .HasForeignKey("HistoricalContextId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Streetcode.DAL.Entities.Timeline.TimelineItem", "Timeline") - .WithMany("HistoricalContextTimelines") - .HasForeignKey("TimelineId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("HistoricalContext"); - - b.Navigation("Timeline"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Timeline.TimelineItem", b => - { - b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") - .WithMany("TimelineItems") - .HasForeignKey("StreetcodeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Toponyms.StreetcodeToponym", b => - { - b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") - .WithMany() - .HasForeignKey("StreetcodeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Streetcode.DAL.Entities.Toponyms.Toponym", "Toponym") - .WithMany() - .HasForeignKey("ToponymId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Streetcode"); - - b.Navigation("Toponym"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Transactions.TransactionLink", b => - { - b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") - .WithOne("TransactionLink") - .HasForeignKey("Streetcode.DAL.Entities.Transactions.TransactionLink", "StreetcodeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Types.StreetcodeCoordinate", b => - { - b.HasOne("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", "Streetcode") - .WithMany("Coordinates") - .HasForeignKey("StreetcodeId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Types.ToponymCoordinate", b => - { - b.HasOne("Streetcode.DAL.Entities.Toponyms.Toponym", "Toponym") - .WithOne("Coordinate") - .HasForeignKey("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Types.ToponymCoordinate", "ToponymId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Toponym"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Tag", b => - { - b.Navigation("StreetcodeTagIndices"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Media.Audio", b => - { - b.Navigation("Streetcode"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.Art", b => - { - b.Navigation("StreetcodeArts"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Media.Images.Image", b => - { - b.Navigation("Art"); - - b.Navigation("Facts"); - - b.Navigation("ImageDetails"); - - b.Navigation("News"); - - b.Navigation("Partner"); - - b.Navigation("SourceLinkCategories"); - - b.Navigation("TeamMember"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Partners.Partner", b => - { - b.Navigation("PartnerSourceLinks"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Sources.SourceLinkCategory", b => - { - b.Navigation("StreetcodeCategoryContents"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.StreetcodeContent", b => - { - b.Navigation("Coordinates"); - - b.Navigation("Facts"); - - b.Navigation("Observers"); - - b.Navigation("StatisticRecords"); - - b.Navigation("StreetcodeArts"); - - b.Navigation("StreetcodeCategoryContents"); - - b.Navigation("StreetcodeTagIndices"); - - b.Navigation("Subtitles"); - - b.Navigation("Targets"); - - b.Navigation("Text"); - - b.Navigation("TimelineItems"); - - b.Navigation("TransactionLink"); - - b.Navigation("Videos"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Streetcode.TextContent.Term", b => - { - b.Navigation("RelatedTerms"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Team.TeamMember", b => - { - b.Navigation("TeamMemberLinks"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Timeline.HistoricalContext", b => - { - b.Navigation("HistoricalContextTimelines"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Timeline.TimelineItem", b => - { - b.Navigation("HistoricalContextTimelines"); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.Toponyms.Toponym", b => - { - b.Navigation("Coordinate") - .IsRequired(); - }); - - modelBuilder.Entity("Streetcode.DAL.Entities.AdditionalContent.Coordinates.Types.StreetcodeCoordinate", b => - { - b.Navigation("StatisticRecord") - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803125439_Change_StreetcodeCategoryContent_Text_to_4000_simb.cs b/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803125439_Change_StreetcodeCategoryContent_Text_to_4000_simb.cs deleted file mode 100644 index ab02e260e..000000000 --- a/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803125439_Change_StreetcodeCategoryContent_Text_to_4000_simb.cs +++ /dev/null @@ -1,37 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Streetcode.DAL.Persistence.Migrations -{ - public partial class Change_StreetcodeCategoryContent_Text_to_4000_simb : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "Text", - schema: "sources", - table: "streetcode_source_link_categories", - type: "nvarchar(4000)", - maxLength: 4000, - nullable: false, - oldClrType: typeof(string), - oldType: "nvarchar(max)", - oldMaxLength: 5000); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "Text", - schema: "sources", - table: "streetcode_source_link_categories", - type: "nvarchar(max)", - maxLength: 5000, - nullable: false, - oldClrType: typeof(string), - oldType: "nvarchar(4000)", - oldMaxLength: 4000); - } - } -} diff --git a/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803195721_Change_StreetcodeCategoryContent_Text_to_7000_simb.cs b/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803195721_Change_StreetcodeCategoryContent_Text_to_7000_simb.cs deleted file mode 100644 index 750236a55..000000000 --- a/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803195721_Change_StreetcodeCategoryContent_Text_to_7000_simb.cs +++ /dev/null @@ -1,37 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Streetcode.DAL.Persistence.Migrations -{ - public partial class Change_StreetcodeCategoryContent_Text_to_7000_simb : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "Text", - schema: "sources", - table: "streetcode_source_link_categories", - type: "nvarchar(max)", - maxLength: 7000, - nullable: false, - oldClrType: typeof(string), - oldType: "nvarchar(4000)", - oldMaxLength: 4000); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "Text", - schema: "sources", - table: "streetcode_source_link_categories", - type: "nvarchar(4000)", - maxLength: 4000, - nullable: false, - oldClrType: typeof(string), - oldType: "nvarchar(max)", - oldMaxLength: 7000); - } - } -} diff --git a/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803195721_Change_StreetcodeCategoryContent_Text_to_7000_simb.Designer.cs b/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803205114_Change_StreetcodeCategoryContent_Text_to_7000_simb.Designer.cs similarity index 99% rename from Streetcode/Streetcode.DAL/Persistence/Migrations/20230803195721_Change_StreetcodeCategoryContent_Text_to_7000_simb.Designer.cs rename to Streetcode/Streetcode.DAL/Persistence/Migrations/20230803205114_Change_StreetcodeCategoryContent_Text_to_7000_simb.Designer.cs index 48b419121..1c0a9794e 100644 --- a/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803195721_Change_StreetcodeCategoryContent_Text_to_7000_simb.Designer.cs +++ b/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803205114_Change_StreetcodeCategoryContent_Text_to_7000_simb.Designer.cs @@ -12,7 +12,7 @@ namespace Streetcode.DAL.Persistence.Migrations { [DbContext(typeof(StreetcodeDbContext))] - [Migration("20230803195721_Change_StreetcodeCategoryContent_Text_to_7000_simb")] + [Migration("20230803205114_Change_StreetcodeCategoryContent_Text_to_7000_simb")] partial class Change_StreetcodeCategoryContent_Text_to_7000_simb { protected override void BuildTargetModel(ModelBuilder modelBuilder) diff --git a/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803093425_Change_StreetcodeCategoryContent_Text_to_5000_simb.cs b/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803205114_Change_StreetcodeCategoryContent_Text_to_7000_simb.cs similarity index 92% rename from Streetcode/Streetcode.DAL/Persistence/Migrations/20230803093425_Change_StreetcodeCategoryContent_Text_to_5000_simb.cs rename to Streetcode/Streetcode.DAL/Persistence/Migrations/20230803205114_Change_StreetcodeCategoryContent_Text_to_7000_simb.cs index c4c5070e0..8a16e2b65 100644 --- a/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803093425_Change_StreetcodeCategoryContent_Text_to_5000_simb.cs +++ b/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803205114_Change_StreetcodeCategoryContent_Text_to_7000_simb.cs @@ -4,7 +4,7 @@ namespace Streetcode.DAL.Persistence.Migrations { - public partial class Change_StreetcodeCategoryContent_Text_to_5000_simb : Migration + public partial class Change_StreetcodeCategoryContent_Text_to_7000_simb : Migration { protected override void Up(MigrationBuilder migrationBuilder) { @@ -13,7 +13,7 @@ protected override void Up(MigrationBuilder migrationBuilder) schema: "sources", table: "streetcode_source_link_categories", type: "nvarchar(max)", - maxLength: 5000, + maxLength: 7000, nullable: false, oldClrType: typeof(string), oldType: "nvarchar(1000)", @@ -31,7 +31,7 @@ protected override void Down(MigrationBuilder migrationBuilder) nullable: false, oldClrType: typeof(string), oldType: "nvarchar(max)", - oldMaxLength: 5000); + oldMaxLength: 7000); } } } diff --git a/Streetcode/Streetcode.DAL/Persistence/ScriptsMigration/DDL_last_mig.sql b/Streetcode/Streetcode.DAL/Persistence/ScriptsMigration/DDL_last_mig.sql new file mode 100644 index 000000000..88ee40b31 --- /dev/null +++ b/Streetcode/Streetcode.DAL/Persistence/ScriptsMigration/DDL_last_mig.sql @@ -0,0 +1,586 @@ +IF OBJECT_ID(N'[entity_framework].[__EFMigrationsHistory]') IS NULL +BEGIN + IF SCHEMA_ID(N'entity_framework') IS NULL EXEC(N'CREATE SCHEMA [entity_framework];'); + CREATE TABLE [entity_framework].[__EFMigrationsHistory] ( + [MigrationId] nvarchar(150) NOT NULL, + [ProductVersion] nvarchar(32) NOT NULL, + CONSTRAINT [PK___EFMigrationsHistory] PRIMARY KEY ([MigrationId]) + ); +END; +GO + +BEGIN TRANSACTION; +GO + +IF SCHEMA_ID(N'media') IS NULL EXEC(N'CREATE SCHEMA [media];'); +GO + +IF SCHEMA_ID(N'add_content') IS NULL EXEC(N'CREATE SCHEMA [add_content];'); +GO + +IF SCHEMA_ID(N'streetcode') IS NULL EXEC(N'CREATE SCHEMA [streetcode];'); +GO + +IF SCHEMA_ID(N'timeline') IS NULL EXEC(N'CREATE SCHEMA [timeline];'); +GO + +IF SCHEMA_ID(N'news') IS NULL EXEC(N'CREATE SCHEMA [news];'); +GO + +IF SCHEMA_ID(N'partners') IS NULL EXEC(N'CREATE SCHEMA [partners];'); +GO + +IF SCHEMA_ID(N'team') IS NULL EXEC(N'CREATE SCHEMA [team];'); +GO + +IF SCHEMA_ID(N'coordinates') IS NULL EXEC(N'CREATE SCHEMA [coordinates];'); +GO + +IF SCHEMA_ID(N'feedback') IS NULL EXEC(N'CREATE SCHEMA [feedback];'); +GO + +IF SCHEMA_ID(N'sources') IS NULL EXEC(N'CREATE SCHEMA [sources];'); +GO + +IF SCHEMA_ID(N'toponyms') IS NULL EXEC(N'CREATE SCHEMA [toponyms];'); +GO + +IF SCHEMA_ID(N'transactions') IS NULL EXEC(N'CREATE SCHEMA [transactions];'); +GO + +IF SCHEMA_ID(N'Users') IS NULL EXEC(N'CREATE SCHEMA [Users];'); +GO + +CREATE TABLE [media].[audios] ( + [Id] int NOT NULL IDENTITY, + [Title] nvarchar(100) NULL, + [BlobName] nvarchar(100) NOT NULL, + [MimeType] nvarchar(10) NOT NULL, + CONSTRAINT [PK_audios] PRIMARY KEY ([Id]) +); +GO + +CREATE TABLE [timeline].[historical_contexts] ( + [Id] int NOT NULL IDENTITY, + [Title] nvarchar(50) NOT NULL, + CONSTRAINT [PK_historical_contexts] PRIMARY KEY ([Id]) +); +GO + +CREATE TABLE [media].[images] ( + [Id] int NOT NULL IDENTITY, + [BlobName] nvarchar(100) NOT NULL, + [MimeType] nvarchar(10) NOT NULL, + CONSTRAINT [PK_images] PRIMARY KEY ([Id]) +); +GO + +CREATE TABLE [team].[positions] ( + [Id] int NOT NULL IDENTITY, + [Position] nvarchar(50) NOT NULL, + CONSTRAINT [PK_positions] PRIMARY KEY ([Id]) +); +GO + +CREATE TABLE [feedback].[responses] ( + [Id] int NOT NULL IDENTITY, + [Name] nvarchar(50) NULL, + [Email] nvarchar(50) NOT NULL, + [Description] nvarchar(1000) NULL, + CONSTRAINT [PK_responses] PRIMARY KEY ([Id]) +); +GO + +CREATE TABLE [add_content].[tags] ( + [Id] int NOT NULL IDENTITY, + [Title] nvarchar(50) NOT NULL, + CONSTRAINT [PK_tags] PRIMARY KEY ([Id]) +); +GO + +CREATE TABLE [streetcode].[terms] ( + [Id] int NOT NULL IDENTITY, + [Title] nvarchar(50) NOT NULL, + [Description] nvarchar(500) NOT NULL, + CONSTRAINT [PK_terms] PRIMARY KEY ([Id]) +); +GO + +CREATE TABLE [toponyms].[toponyms] ( + [Id] int NOT NULL IDENTITY, + [Oblast] nvarchar(100) NOT NULL, + [AdminRegionOld] nvarchar(150) NULL, + [AdminRegionNew] nvarchar(150) NULL, + [Gromada] nvarchar(150) NULL, + [Community] nvarchar(150) NULL, + [StreetName] nvarchar(150) NOT NULL, + [StreetType] nvarchar(50) NULL, + CONSTRAINT [PK_toponyms] PRIMARY KEY ([Id]) +); +GO + +CREATE TABLE [Users].[Users] ( + [Id] int NOT NULL IDENTITY, + [Name] nvarchar(50) NOT NULL, + [Surname] nvarchar(50) NOT NULL, + [Email] nvarchar(max) NOT NULL, + [Login] nvarchar(20) NOT NULL, + [Password] nvarchar(20) NOT NULL, + [Role] int NOT NULL, + CONSTRAINT [PK_Users] PRIMARY KEY ([Id]) +); +GO + +CREATE TABLE [streetcode].[streetcodes] ( + [Id] int NOT NULL IDENTITY, + [Index] int NOT NULL, + [Teaser] nvarchar(650) NULL, + [DateString] nvarchar(50) NOT NULL, + [Alias] nvarchar(50) NULL, + [Status] int NOT NULL, + [Title] nvarchar(100) NOT NULL, + [TransliterationUrl] nvarchar(150) NOT NULL, + [ViewCount] int NOT NULL DEFAULT 0, + [CreatedAt] datetime2 NOT NULL DEFAULT (GETDATE()), + [UpdatedAt] datetime2 NOT NULL DEFAULT (GETDATE()), + [EventStartOrPersonBirthDate] datetime2 NOT NULL, + [EventEndOrPersonDeathDate] datetime2 NULL, + [AudioId] int NULL, + [StreetcodeType] nvarchar(max) NOT NULL, + [FirstName] nvarchar(50) NULL, + [Rank] nvarchar(50) NULL, + [LastName] nvarchar(50) NULL, + CONSTRAINT [PK_streetcodes] PRIMARY KEY ([Id]), + CONSTRAINT [FK_streetcodes_audios_AudioId] FOREIGN KEY ([AudioId]) REFERENCES [media].[audios] ([Id]) ON DELETE CASCADE +); +GO + +CREATE TABLE [media].[arts] ( + [Id] int NOT NULL IDENTITY, + [Description] nvarchar(400) NULL, + [Title] nvarchar(150) NULL, + [ImageId] int NOT NULL, + CONSTRAINT [PK_arts] PRIMARY KEY ([Id]), + CONSTRAINT [FK_arts_images_ImageId] FOREIGN KEY ([ImageId]) REFERENCES [media].[images] ([Id]) ON DELETE CASCADE +); +GO + +CREATE TABLE [media].[image_details] ( + [Id] int NOT NULL IDENTITY, + [Title] nvarchar(100) NULL, + [Alt] nvarchar(300) NULL, + [ImageId] int NOT NULL, + CONSTRAINT [PK_image_details] PRIMARY KEY ([Id]), + CONSTRAINT [FK_image_details_images_ImageId] FOREIGN KEY ([ImageId]) REFERENCES [media].[images] ([Id]) ON DELETE CASCADE +); +GO + +CREATE TABLE [news].[news] ( + [Id] int NOT NULL IDENTITY, + [Title] nvarchar(150) NOT NULL, + [Text] nvarchar(max) NOT NULL, + [URL] nvarchar(100) NOT NULL, + [ImageId] int NULL, + [CreationDate] datetime2 NOT NULL, + CONSTRAINT [PK_news] PRIMARY KEY ([Id]), + CONSTRAINT [FK_news_images_ImageId] FOREIGN KEY ([ImageId]) REFERENCES [media].[images] ([Id]) +); +GO + +CREATE TABLE [partners].[partners] ( + [Id] int NOT NULL IDENTITY, + [Title] nvarchar(255) NOT NULL, + [LogoId] int NOT NULL, + [IsKeyPartner] bit NOT NULL DEFAULT CAST(0 AS bit), + [IsVisibleEverywhere] bit NOT NULL, + [TargetUrl] nvarchar(255) NOT NULL, + [UrlTitle] nvarchar(255) NULL, + [Description] nvarchar(600) NULL, + CONSTRAINT [PK_partners] PRIMARY KEY ([Id]), + CONSTRAINT [FK_partners_images_LogoId] FOREIGN KEY ([LogoId]) REFERENCES [media].[images] ([Id]) ON DELETE CASCADE +); +GO + +CREATE TABLE [sources].[source_link_categories] ( + [Id] int NOT NULL IDENTITY, + [Title] nvarchar(100) NOT NULL, + [ImageId] int NOT NULL, + CONSTRAINT [PK_source_link_categories] PRIMARY KEY ([Id]), + CONSTRAINT [FK_source_link_categories_images_ImageId] FOREIGN KEY ([ImageId]) REFERENCES [media].[images] ([Id]) ON DELETE CASCADE +); +GO + +CREATE TABLE [team].[team_members] ( + [Id] int NOT NULL IDENTITY, + [FirstName] nvarchar(50) NOT NULL, + [LastName] nvarchar(50) NULL, + [Description] nvarchar(150) NOT NULL, + [IsMain] bit NOT NULL, + [ImageId] int NOT NULL, + CONSTRAINT [PK_team_members] PRIMARY KEY ([Id]), + CONSTRAINT [FK_team_members_images_ImageId] FOREIGN KEY ([ImageId]) REFERENCES [media].[images] ([Id]) ON DELETE CASCADE +); +GO + +CREATE TABLE [streetcode].[related_terms] ( + [Id] int NOT NULL IDENTITY, + [Word] nvarchar(50) NOT NULL, + [TermId] int NOT NULL, + CONSTRAINT [PK_related_terms] PRIMARY KEY ([Id]), + CONSTRAINT [FK_related_terms_terms_TermId] FOREIGN KEY ([TermId]) REFERENCES [streetcode].[terms] ([Id]) ON DELETE CASCADE +); +GO + +CREATE TABLE [add_content].[coordinates] ( + [Id] int NOT NULL IDENTITY, + [Latitude] decimal(18,4) NOT NULL, + [Longtitude] decimal(18,4) NOT NULL, + [CoordinateType] nvarchar(max) NOT NULL, + [StreetcodeId] int NULL, + [ToponymId] int NULL, + CONSTRAINT [PK_coordinates] PRIMARY KEY ([Id]), + CONSTRAINT [FK_coordinates_streetcodes_StreetcodeId] FOREIGN KEY ([StreetcodeId]) REFERENCES [streetcode].[streetcodes] ([Id]) ON DELETE CASCADE, + CONSTRAINT [FK_coordinates_toponyms_ToponymId] FOREIGN KEY ([ToponymId]) REFERENCES [toponyms].[toponyms] ([Id]) ON DELETE CASCADE +); +GO + +CREATE TABLE [streetcode].[facts] ( + [Id] int NOT NULL IDENTITY, + [Title] nvarchar(100) NOT NULL, + [FactContent] nvarchar(600) NOT NULL, + [ImageId] int NULL, + [StreetcodeId] int NOT NULL, + CONSTRAINT [PK_facts] PRIMARY KEY ([Id]), + CONSTRAINT [FK_facts_images_ImageId] FOREIGN KEY ([ImageId]) REFERENCES [media].[images] ([Id]) ON DELETE CASCADE, + CONSTRAINT [FK_facts_streetcodes_StreetcodeId] FOREIGN KEY ([StreetcodeId]) REFERENCES [streetcode].[streetcodes] ([Id]) ON DELETE CASCADE +); +GO + +CREATE TABLE [streetcode].[related_figures] ( + [ObserverId] int NOT NULL, + [TargetId] int NOT NULL, + CONSTRAINT [PK_related_figures] PRIMARY KEY ([ObserverId], [TargetId]), + CONSTRAINT [FK_related_figures_streetcodes_ObserverId] FOREIGN KEY ([ObserverId]) REFERENCES [streetcode].[streetcodes] ([Id]) ON DELETE NO ACTION, + CONSTRAINT [FK_related_figures_streetcodes_TargetId] FOREIGN KEY ([TargetId]) REFERENCES [streetcode].[streetcodes] ([Id]) ON DELETE CASCADE +); +GO + +CREATE TABLE [streetcode].[streetcode_image] ( + [StreetcodeId] int NOT NULL, + [ImageId] int NOT NULL, + CONSTRAINT [PK_streetcode_image] PRIMARY KEY ([ImageId], [StreetcodeId]), + CONSTRAINT [FK_streetcode_image_images_ImageId] FOREIGN KEY ([ImageId]) REFERENCES [media].[images] ([Id]) ON DELETE CASCADE, + CONSTRAINT [FK_streetcode_image_streetcodes_StreetcodeId] FOREIGN KEY ([StreetcodeId]) REFERENCES [streetcode].[streetcodes] ([Id]) ON DELETE CASCADE +); +GO + +CREATE TABLE [add_content].[streetcode_tag_index] ( + [StreetcodeId] int NOT NULL, + [TagId] int NOT NULL, + [IsVisible] bit NOT NULL, + [Index] int NOT NULL, + CONSTRAINT [PK_streetcode_tag_index] PRIMARY KEY ([StreetcodeId], [TagId]), + CONSTRAINT [FK_streetcode_tag_index_streetcodes_StreetcodeId] FOREIGN KEY ([StreetcodeId]) REFERENCES [streetcode].[streetcodes] ([Id]) ON DELETE CASCADE, + CONSTRAINT [FK_streetcode_tag_index_tags_TagId] FOREIGN KEY ([TagId]) REFERENCES [add_content].[tags] ([Id]) ON DELETE CASCADE +); +GO + +CREATE TABLE [streetcode].[streetcode_toponym] ( + [StreetcodeId] int NOT NULL, + [ToponymId] int NOT NULL, + CONSTRAINT [PK_streetcode_toponym] PRIMARY KEY ([StreetcodeId], [ToponymId]), + CONSTRAINT [FK_streetcode_toponym_streetcodes_StreetcodeId] FOREIGN KEY ([StreetcodeId]) REFERENCES [streetcode].[streetcodes] ([Id]) ON DELETE CASCADE, + CONSTRAINT [FK_streetcode_toponym_toponyms_ToponymId] FOREIGN KEY ([ToponymId]) REFERENCES [toponyms].[toponyms] ([Id]) ON DELETE CASCADE +); +GO + +CREATE TABLE [add_content].[subtitles] ( + [Id] int NOT NULL IDENTITY, + [SubtitleText] nvarchar(500) NULL, + [StreetcodeId] int NOT NULL, + CONSTRAINT [PK_subtitles] PRIMARY KEY ([Id]), + CONSTRAINT [FK_subtitles_streetcodes_StreetcodeId] FOREIGN KEY ([StreetcodeId]) REFERENCES [streetcode].[streetcodes] ([Id]) ON DELETE CASCADE +); +GO + +CREATE TABLE [streetcode].[texts] ( + [Id] int NOT NULL IDENTITY, + [Title] nvarchar(300) NOT NULL, + [TextContent] nvarchar(max) NOT NULL, + [AdditionalText] nvarchar(500) NULL, + [StreetcodeId] int NOT NULL, + CONSTRAINT [PK_texts] PRIMARY KEY ([Id]), + CONSTRAINT [FK_texts_streetcodes_StreetcodeId] FOREIGN KEY ([StreetcodeId]) REFERENCES [streetcode].[streetcodes] ([Id]) ON DELETE CASCADE +); +GO + +CREATE TABLE [timeline].[timeline_items] ( + [Id] int NOT NULL IDENTITY, + [Date] datetime2 NOT NULL, + [DateViewPattern] int NOT NULL, + [Title] nvarchar(100) NOT NULL, + [Description] nvarchar(600) NULL, + [StreetcodeId] int NOT NULL, + CONSTRAINT [PK_timeline_items] PRIMARY KEY ([Id]), + CONSTRAINT [FK_timeline_items_streetcodes_StreetcodeId] FOREIGN KEY ([StreetcodeId]) REFERENCES [streetcode].[streetcodes] ([Id]) ON DELETE CASCADE +); +GO + +CREATE TABLE [transactions].[transaction_links] ( + [Id] int NOT NULL IDENTITY, + [UrlTitle] nvarchar(255) NULL, + [Url] nvarchar(255) NOT NULL, + [StreetcodeId] int NOT NULL, + CONSTRAINT [PK_transaction_links] PRIMARY KEY ([Id]), + CONSTRAINT [FK_transaction_links_streetcodes_StreetcodeId] FOREIGN KEY ([StreetcodeId]) REFERENCES [streetcode].[streetcodes] ([Id]) ON DELETE CASCADE +); +GO + +CREATE TABLE [media].[videos] ( + [Id] int NOT NULL IDENTITY, + [Title] nvarchar(100) NULL, + [Description] nvarchar(max) NULL, + [Url] nvarchar(max) NOT NULL, + [StreetcodeId] int NOT NULL, + CONSTRAINT [PK_videos] PRIMARY KEY ([Id]), + CONSTRAINT [FK_videos_streetcodes_StreetcodeId] FOREIGN KEY ([StreetcodeId]) REFERENCES [streetcode].[streetcodes] ([Id]) ON DELETE CASCADE +); +GO + +CREATE TABLE [streetcode].[streetcode_art] ( + [StreetcodeId] int NOT NULL, + [ArtId] int NOT NULL, + [Index] int NOT NULL DEFAULT 1, + CONSTRAINT [PK_streetcode_art] PRIMARY KEY ([ArtId], [StreetcodeId]), + CONSTRAINT [FK_streetcode_art_arts_ArtId] FOREIGN KEY ([ArtId]) REFERENCES [media].[arts] ([Id]) ON DELETE CASCADE, + CONSTRAINT [FK_streetcode_art_streetcodes_StreetcodeId] FOREIGN KEY ([StreetcodeId]) REFERENCES [streetcode].[streetcodes] ([Id]) ON DELETE CASCADE +); +GO + +CREATE TABLE [partners].[partner_source_links] ( + [Id] int NOT NULL IDENTITY, + [Title] nvarchar(50) NOT NULL, + [LogoType] tinyint NOT NULL, + [TargetUrl] nvarchar(255) NOT NULL, + [PartnerId] int NOT NULL, + CONSTRAINT [PK_partner_source_links] PRIMARY KEY ([Id]), + CONSTRAINT [FK_partner_source_links_partners_PartnerId] FOREIGN KEY ([PartnerId]) REFERENCES [partners].[partners] ([Id]) ON DELETE CASCADE +); +GO + +CREATE TABLE [streetcode].[streetcode_partners] ( + [StreetcodeId] int NOT NULL, + [PartnerId] int NOT NULL, + CONSTRAINT [PK_streetcode_partners] PRIMARY KEY ([PartnerId], [StreetcodeId]), + CONSTRAINT [FK_streetcode_partners_partners_PartnerId] FOREIGN KEY ([PartnerId]) REFERENCES [partners].[partners] ([Id]) ON DELETE CASCADE, + CONSTRAINT [FK_streetcode_partners_streetcodes_StreetcodeId] FOREIGN KEY ([StreetcodeId]) REFERENCES [streetcode].[streetcodes] ([Id]) ON DELETE CASCADE +); +GO + +CREATE TABLE [sources].[streetcode_source_link_categories] ( + [SourceLinkCategoryId] int NOT NULL, + [StreetcodeId] int NOT NULL, + [Text] nvarchar(1000) NOT NULL, + CONSTRAINT [PK_streetcode_source_link_categories] PRIMARY KEY ([SourceLinkCategoryId], [StreetcodeId]), + CONSTRAINT [FK_streetcode_source_link_categories_source_link_categories_SourceLinkCategoryId] FOREIGN KEY ([SourceLinkCategoryId]) REFERENCES [sources].[source_link_categories] ([Id]) ON DELETE CASCADE, + CONSTRAINT [FK_streetcode_source_link_categories_streetcodes_StreetcodeId] FOREIGN KEY ([StreetcodeId]) REFERENCES [streetcode].[streetcodes] ([Id]) ON DELETE CASCADE +); +GO + +CREATE TABLE [team].[team_member_links] ( + [Id] int NOT NULL IDENTITY, + [LogoType] tinyint NOT NULL, + [TargetUrl] nvarchar(255) NOT NULL, + [TeamMemberId] int NOT NULL, + CONSTRAINT [PK_team_member_links] PRIMARY KEY ([Id]), + CONSTRAINT [FK_team_member_links_team_members_TeamMemberId] FOREIGN KEY ([TeamMemberId]) REFERENCES [team].[team_members] ([Id]) ON DELETE CASCADE +); +GO + +CREATE TABLE [team].[team_member_positions] ( + [TeamMemberId] int NOT NULL, + [PositionsId] int NOT NULL, + CONSTRAINT [PK_team_member_positions] PRIMARY KEY ([TeamMemberId], [PositionsId]), + CONSTRAINT [FK_team_member_positions_positions_PositionsId] FOREIGN KEY ([PositionsId]) REFERENCES [team].[positions] ([Id]) ON DELETE CASCADE, + CONSTRAINT [FK_team_member_positions_team_members_TeamMemberId] FOREIGN KEY ([TeamMemberId]) REFERENCES [team].[team_members] ([Id]) ON DELETE CASCADE +); +GO + +CREATE TABLE [coordinates].[qr_coordinates] ( + [Id] int NOT NULL IDENTITY, + [QrId] int NOT NULL, + [Count] int NOT NULL, + [Address] nvarchar(150) NOT NULL, + [StreetcodeId] int NOT NULL, + [StreetcodeCoordinateId] int NOT NULL, + CONSTRAINT [PK_qr_coordinates] PRIMARY KEY ([Id]), + CONSTRAINT [FK_qr_coordinates_coordinates_StreetcodeCoordinateId] FOREIGN KEY ([StreetcodeCoordinateId]) REFERENCES [add_content].[coordinates] ([Id]) ON DELETE CASCADE, + CONSTRAINT [FK_qr_coordinates_streetcodes_StreetcodeId] FOREIGN KEY ([StreetcodeId]) REFERENCES [streetcode].[streetcodes] ([Id]) +); +GO + +CREATE TABLE [HistoricalContextsTimelines] ( + [HistoricalContextId] int NOT NULL, + [TimelineId] int NOT NULL, + CONSTRAINT [PK_HistoricalContextsTimelines] PRIMARY KEY ([TimelineId], [HistoricalContextId]), + CONSTRAINT [FK_HistoricalContextsTimelines_historical_contexts_HistoricalContextId] FOREIGN KEY ([HistoricalContextId]) REFERENCES [timeline].[historical_contexts] ([Id]) ON DELETE CASCADE, + CONSTRAINT [FK_HistoricalContextsTimelines_timeline_items_TimelineId] FOREIGN KEY ([TimelineId]) REFERENCES [timeline].[timeline_items] ([Id]) ON DELETE CASCADE +); +GO + +CREATE UNIQUE INDEX [IX_arts_ImageId] ON [media].[arts] ([ImageId]); +GO + +CREATE INDEX [IX_coordinates_StreetcodeId] ON [add_content].[coordinates] ([StreetcodeId]); +GO + +CREATE UNIQUE INDEX [IX_coordinates_ToponymId] ON [add_content].[coordinates] ([ToponymId]) WHERE [ToponymId] IS NOT NULL; +GO + +CREATE INDEX [IX_facts_ImageId] ON [streetcode].[facts] ([ImageId]); +GO + +CREATE INDEX [IX_facts_StreetcodeId] ON [streetcode].[facts] ([StreetcodeId]); +GO + +CREATE INDEX [IX_HistoricalContextsTimelines_HistoricalContextId] ON [HistoricalContextsTimelines] ([HistoricalContextId]); +GO + +CREATE UNIQUE INDEX [IX_image_details_ImageId] ON [media].[image_details] ([ImageId]); +GO + +CREATE UNIQUE INDEX [IX_news_ImageId] ON [news].[news] ([ImageId]) WHERE [ImageId] IS NOT NULL; +GO + +CREATE UNIQUE INDEX [IX_news_URL] ON [news].[news] ([URL]); +GO + +CREATE INDEX [IX_partner_source_links_PartnerId] ON [partners].[partner_source_links] ([PartnerId]); +GO + +CREATE UNIQUE INDEX [IX_partners_LogoId] ON [partners].[partners] ([LogoId]); +GO + +CREATE UNIQUE INDEX [IX_qr_coordinates_StreetcodeCoordinateId] ON [coordinates].[qr_coordinates] ([StreetcodeCoordinateId]); +GO + +CREATE INDEX [IX_qr_coordinates_StreetcodeId] ON [coordinates].[qr_coordinates] ([StreetcodeId]); +GO + +CREATE INDEX [IX_related_figures_TargetId] ON [streetcode].[related_figures] ([TargetId]); +GO + +CREATE INDEX [IX_related_terms_TermId] ON [streetcode].[related_terms] ([TermId]); +GO + +CREATE INDEX [IX_source_link_categories_ImageId] ON [sources].[source_link_categories] ([ImageId]); +GO + +CREATE INDEX [IX_streetcode_art_ArtId_StreetcodeId] ON [streetcode].[streetcode_art] ([ArtId], [StreetcodeId]); +GO + +CREATE INDEX [IX_streetcode_art_StreetcodeId] ON [streetcode].[streetcode_art] ([StreetcodeId]); +GO + +CREATE INDEX [IX_streetcode_image_StreetcodeId] ON [streetcode].[streetcode_image] ([StreetcodeId]); +GO + +CREATE INDEX [IX_streetcode_partners_StreetcodeId] ON [streetcode].[streetcode_partners] ([StreetcodeId]); +GO + +CREATE INDEX [IX_streetcode_source_link_categories_StreetcodeId] ON [sources].[streetcode_source_link_categories] ([StreetcodeId]); +GO + +CREATE INDEX [IX_streetcode_tag_index_TagId] ON [add_content].[streetcode_tag_index] ([TagId]); +GO + +CREATE INDEX [IX_streetcode_toponym_ToponymId] ON [streetcode].[streetcode_toponym] ([ToponymId]); +GO + +CREATE UNIQUE INDEX [IX_streetcodes_AudioId] ON [streetcode].[streetcodes] ([AudioId]) WHERE [AudioId] IS NOT NULL; +GO + +CREATE UNIQUE INDEX [IX_streetcodes_Index] ON [streetcode].[streetcodes] ([Index]); +GO + +CREATE UNIQUE INDEX [IX_streetcodes_TransliterationUrl] ON [streetcode].[streetcodes] ([TransliterationUrl]); +GO + +CREATE INDEX [IX_subtitles_StreetcodeId] ON [add_content].[subtitles] ([StreetcodeId]); +GO + +CREATE INDEX [IX_team_member_links_TeamMemberId] ON [team].[team_member_links] ([TeamMemberId]); +GO + +CREATE INDEX [IX_team_member_positions_PositionsId] ON [team].[team_member_positions] ([PositionsId]); +GO + +CREATE UNIQUE INDEX [IX_team_members_ImageId] ON [team].[team_members] ([ImageId]); +GO + +CREATE UNIQUE INDEX [IX_texts_StreetcodeId] ON [streetcode].[texts] ([StreetcodeId]); +GO + +CREATE INDEX [IX_timeline_items_StreetcodeId] ON [timeline].[timeline_items] ([StreetcodeId]); +GO + +CREATE UNIQUE INDEX [IX_transaction_links_StreetcodeId] ON [transactions].[transaction_links] ([StreetcodeId]); +GO + +CREATE INDEX [IX_videos_StreetcodeId] ON [media].[videos] ([StreetcodeId]); +GO + +INSERT INTO [entity_framework].[__EFMigrationsHistory] ([MigrationId], [ProductVersion]) +VALUES (N'20230622110726_Initial', N'6.0.11'); +GO + +COMMIT; +GO + +BEGIN TRANSACTION; +GO + +DECLARE @var0 sysname; +SELECT @var0 = [d].[name] +FROM [sys].[default_constraints] [d] +INNER JOIN [sys].[columns] [c] ON [d].[parent_column_id] = [c].[column_id] AND [d].[parent_object_id] = [c].[object_id] +WHERE ([d].[parent_object_id] = OBJECT_ID(N'[partners].[partner_source_links]') AND [c].[name] = N'Title'); +IF @var0 IS NOT NULL EXEC(N'ALTER TABLE [partners].[partner_source_links] DROP CONSTRAINT [' + @var0 + '];'); +ALTER TABLE [partners].[partner_source_links] DROP COLUMN [Title]; +GO + +DECLARE @var1 sysname; +SELECT @var1 = [d].[name] +FROM [sys].[default_constraints] [d] +INNER JOIN [sys].[columns] [c] ON [d].[parent_column_id] = [c].[column_id] AND [d].[parent_object_id] = [c].[object_id] +WHERE ([d].[parent_object_id] = OBJECT_ID(N'[partners].[partners]') AND [c].[name] = N'TargetUrl'); +IF @var1 IS NOT NULL EXEC(N'ALTER TABLE [partners].[partners] DROP CONSTRAINT [' + @var1 + '];'); +ALTER TABLE [partners].[partners] ALTER COLUMN [TargetUrl] nvarchar(255) NULL; +GO + +INSERT INTO [entity_framework].[__EFMigrationsHistory] ([MigrationId], [ProductVersion]) +VALUES (N'20230703154732_UpdatePartnerModel', N'6.0.11'); +GO + +COMMIT; +GO + +BEGIN TRANSACTION; +GO + +DECLARE @var2 sysname; +SELECT @var2 = [d].[name] +FROM [sys].[default_constraints] [d] +INNER JOIN [sys].[columns] [c] ON [d].[parent_column_id] = [c].[column_id] AND [d].[parent_object_id] = [c].[object_id] +WHERE ([d].[parent_object_id] = OBJECT_ID(N'[sources].[streetcode_source_link_categories]') AND [c].[name] = N'Text'); +IF @var2 IS NOT NULL EXEC(N'ALTER TABLE [sources].[streetcode_source_link_categories] DROP CONSTRAINT [' + @var2 + '];'); +ALTER TABLE [sources].[streetcode_source_link_categories] ALTER COLUMN [Text] nvarchar(max) NOT NULL; +GO + +INSERT INTO [entity_framework].[__EFMigrationsHistory] ([MigrationId], [ProductVersion]) +VALUES (N'20230803205114_Change_StreetcodeCategoryContent_Text_to_7000_simb', N'6.0.11'); +GO + +COMMIT; +GO + From 887bf959b543171886afcdf00a9c128636ec7b85 Mon Sep 17 00:00:00 2001 From: ValDekh Date: Fri, 4 Aug 2023 15:17:04 +0300 Subject: [PATCH 5/8] Add with 10000 simb --- .../DTO/Sources/StreetcodeCategoryContentDTO.cs | 2 +- .../Entities/Sources/StreetcodeCategoryContent.cs | 2 +- ...treetcodeCategoryContent_Text_to_10000_simb.Designer.cs} | 6 +++--- ..._Change_StreetcodeCategoryContent_Text_to_10000_simb.cs} | 6 +++--- .../Migrations/StreetcodeDbContextModelSnapshot.cs | 2 +- .../Persistence/ScriptsMigration/DDL_last_mig.sql | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) rename Streetcode/Streetcode.DAL/Persistence/Migrations/{20230803205114_Change_StreetcodeCategoryContent_Text_to_7000_simb.Designer.cs => 20230804120930_Change_StreetcodeCategoryContent_Text_to_10000_simb.Designer.cs} (99%) rename Streetcode/Streetcode.DAL/Persistence/Migrations/{20230803205114_Change_StreetcodeCategoryContent_Text_to_7000_simb.cs => 20230804120930_Change_StreetcodeCategoryContent_Text_to_10000_simb.cs} (92%) diff --git a/Streetcode/Streetcode.BLL/DTO/Sources/StreetcodeCategoryContentDTO.cs b/Streetcode/Streetcode.BLL/DTO/Sources/StreetcodeCategoryContentDTO.cs index 179b5160a..a7afc5eca 100644 --- a/Streetcode/Streetcode.BLL/DTO/Sources/StreetcodeCategoryContentDTO.cs +++ b/Streetcode/Streetcode.BLL/DTO/Sources/StreetcodeCategoryContentDTO.cs @@ -10,7 +10,7 @@ namespace Streetcode.BLL.DTO.Sources public class StreetcodeCategoryContentDTO { [Required] - [MaxLength(7000)] + [MaxLength(10000)] public string Text { get; set; } [Required] diff --git a/Streetcode/Streetcode.DAL/Entities/Sources/StreetcodeCategoryContent.cs b/Streetcode/Streetcode.DAL/Entities/Sources/StreetcodeCategoryContent.cs index 9cf165cc4..ce7ec2436 100644 --- a/Streetcode/Streetcode.DAL/Entities/Sources/StreetcodeCategoryContent.cs +++ b/Streetcode/Streetcode.DAL/Entities/Sources/StreetcodeCategoryContent.cs @@ -8,7 +8,7 @@ namespace Streetcode.DAL.Entities.Sources; public class StreetcodeCategoryContent { [Required] - [MaxLength(7000)] + [MaxLength(10000)] public string? Text { get; set; } [Required] diff --git a/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803205114_Change_StreetcodeCategoryContent_Text_to_7000_simb.Designer.cs b/Streetcode/Streetcode.DAL/Persistence/Migrations/20230804120930_Change_StreetcodeCategoryContent_Text_to_10000_simb.Designer.cs similarity index 99% rename from Streetcode/Streetcode.DAL/Persistence/Migrations/20230803205114_Change_StreetcodeCategoryContent_Text_to_7000_simb.Designer.cs rename to Streetcode/Streetcode.DAL/Persistence/Migrations/20230804120930_Change_StreetcodeCategoryContent_Text_to_10000_simb.Designer.cs index 1c0a9794e..1eff0752d 100644 --- a/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803205114_Change_StreetcodeCategoryContent_Text_to_7000_simb.Designer.cs +++ b/Streetcode/Streetcode.DAL/Persistence/Migrations/20230804120930_Change_StreetcodeCategoryContent_Text_to_10000_simb.Designer.cs @@ -12,8 +12,8 @@ namespace Streetcode.DAL.Persistence.Migrations { [DbContext(typeof(StreetcodeDbContext))] - [Migration("20230803205114_Change_StreetcodeCategoryContent_Text_to_7000_simb")] - partial class Change_StreetcodeCategoryContent_Text_to_7000_simb + [Migration("20230804120930_Change_StreetcodeCategoryContent_Text_to_10000_simb")] + partial class Change_StreetcodeCategoryContent_Text_to_10000_simb { protected override void BuildTargetModel(ModelBuilder modelBuilder) { @@ -478,7 +478,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("Text") .IsRequired() - .HasMaxLength(7000) + .HasMaxLength(10000) .HasColumnType("nvarchar(max)"); b.HasKey("SourceLinkCategoryId", "StreetcodeId"); diff --git a/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803205114_Change_StreetcodeCategoryContent_Text_to_7000_simb.cs b/Streetcode/Streetcode.DAL/Persistence/Migrations/20230804120930_Change_StreetcodeCategoryContent_Text_to_10000_simb.cs similarity index 92% rename from Streetcode/Streetcode.DAL/Persistence/Migrations/20230803205114_Change_StreetcodeCategoryContent_Text_to_7000_simb.cs rename to Streetcode/Streetcode.DAL/Persistence/Migrations/20230804120930_Change_StreetcodeCategoryContent_Text_to_10000_simb.cs index 8a16e2b65..6ea0ca0b1 100644 --- a/Streetcode/Streetcode.DAL/Persistence/Migrations/20230803205114_Change_StreetcodeCategoryContent_Text_to_7000_simb.cs +++ b/Streetcode/Streetcode.DAL/Persistence/Migrations/20230804120930_Change_StreetcodeCategoryContent_Text_to_10000_simb.cs @@ -4,7 +4,7 @@ namespace Streetcode.DAL.Persistence.Migrations { - public partial class Change_StreetcodeCategoryContent_Text_to_7000_simb : Migration + public partial class Change_StreetcodeCategoryContent_Text_to_10000_simb : Migration { protected override void Up(MigrationBuilder migrationBuilder) { @@ -13,7 +13,7 @@ protected override void Up(MigrationBuilder migrationBuilder) schema: "sources", table: "streetcode_source_link_categories", type: "nvarchar(max)", - maxLength: 7000, + maxLength: 10000, nullable: false, oldClrType: typeof(string), oldType: "nvarchar(1000)", @@ -31,7 +31,7 @@ protected override void Down(MigrationBuilder migrationBuilder) nullable: false, oldClrType: typeof(string), oldType: "nvarchar(max)", - oldMaxLength: 7000); + oldMaxLength: 10000); } } } diff --git a/Streetcode/Streetcode.DAL/Persistence/Migrations/StreetcodeDbContextModelSnapshot.cs b/Streetcode/Streetcode.DAL/Persistence/Migrations/StreetcodeDbContextModelSnapshot.cs index bcf166dee..250af21e3 100644 --- a/Streetcode/Streetcode.DAL/Persistence/Migrations/StreetcodeDbContextModelSnapshot.cs +++ b/Streetcode/Streetcode.DAL/Persistence/Migrations/StreetcodeDbContextModelSnapshot.cs @@ -476,7 +476,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("Text") .IsRequired() - .HasMaxLength(7000) + .HasMaxLength(10000) .HasColumnType("nvarchar(max)"); b.HasKey("SourceLinkCategoryId", "StreetcodeId"); diff --git a/Streetcode/Streetcode.DAL/Persistence/ScriptsMigration/DDL_last_mig.sql b/Streetcode/Streetcode.DAL/Persistence/ScriptsMigration/DDL_last_mig.sql index 88ee40b31..4cc98263a 100644 --- a/Streetcode/Streetcode.DAL/Persistence/ScriptsMigration/DDL_last_mig.sql +++ b/Streetcode/Streetcode.DAL/Persistence/ScriptsMigration/DDL_last_mig.sql @@ -578,7 +578,7 @@ ALTER TABLE [sources].[streetcode_source_link_categories] ALTER COLUMN [Text] nv GO INSERT INTO [entity_framework].[__EFMigrationsHistory] ([MigrationId], [ProductVersion]) -VALUES (N'20230803205114_Change_StreetcodeCategoryContent_Text_to_7000_simb', N'6.0.11'); +VALUES (N'20230804120930_Change_StreetcodeCategoryContent_Text_to_10000_simb', N'6.0.11'); GO COMMIT; From 11fe02a8bd0c4753372b954b646e51d6fb0bcd15 Mon Sep 17 00:00:00 2001 From: ValDekh Date: Fri, 4 Aug 2023 15:24:17 +0300 Subject: [PATCH 6/8] some changes --- Streetcode/Streetcode.WebApi/appsettings.Local.json | 3 +-- Streetcode/Streetcode.WebApi/appsettings.json | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Streetcode/Streetcode.WebApi/appsettings.Local.json b/Streetcode/Streetcode.WebApi/appsettings.Local.json index 2cbc87149..14b44479d 100644 --- a/Streetcode/Streetcode.WebApi/appsettings.Local.json +++ b/Streetcode/Streetcode.WebApi/appsettings.Local.json @@ -1,7 +1,6 @@ { "ConnectionStrings": { - //"DefaultConnection": "Server=127.0.0.1;Database=StreetcodeDb;User Id=sa;Password=Admin@1234;MultipleActiveResultSets=true" - "DefaultConnection": "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=StreetcodeDb;Integrated Security=True" + "DefaultConnection": "Server=127.0.0.1;Database=StreetcodeDb;User Id=sa;Password=Admin@1234;MultipleActiveResultSets=true" }, "CORS": { "AllowedOrigins": [ "http://localhost:3000" ], diff --git a/Streetcode/Streetcode.WebApi/appsettings.json b/Streetcode/Streetcode.WebApi/appsettings.json index 1d48cfd52..b5d976f12 100644 --- a/Streetcode/Streetcode.WebApi/appsettings.json +++ b/Streetcode/Streetcode.WebApi/appsettings.json @@ -1,7 +1,6 @@ { "ConnectionStrings": { - //"DefaultConnection": "Server=127.0.0.1;Database=StreetcodeDb;User Id=sa;Password=Admin@1234;MultipleActiveResultSets=true" - "DefaultConnection": "Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=StreetcodeDb;Integrated Security=True" + "DefaultConnection": "Server=127.0.0.1;Database=StreetcodeDb;User Id=sa;Password=Admin@1234;MultipleActiveResultSets=true" }, "EmailConfiguration": { "From": "streetcodefeedback@gmail.com", From b3acd7a5a5bb801b44927760d18c5a9dd92f79a4 Mon Sep 17 00:00:00 2001 From: ValDekh Date: Mon, 7 Aug 2023 14:13:22 +0300 Subject: [PATCH 7/8] change connection string --- Streetcode/Streetcode.WebApi/appsettings.Local.json | 2 +- Streetcode/Streetcode.WebApi/appsettings.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Streetcode/Streetcode.WebApi/appsettings.Local.json b/Streetcode/Streetcode.WebApi/appsettings.Local.json index 14b44479d..72176d960 100644 --- a/Streetcode/Streetcode.WebApi/appsettings.Local.json +++ b/Streetcode/Streetcode.WebApi/appsettings.Local.json @@ -1,6 +1,6 @@ { "ConnectionStrings": { - "DefaultConnection": "Server=127.0.0.1;Database=StreetcodeDb;User Id=sa;Password=Admin@1234;MultipleActiveResultSets=true" + "DefaultConnection": "Server=localhost;Database=StreetcodeDb;User Id=sa;Password=Admin@1234;MultipleActiveResultSets=true" }, "CORS": { "AllowedOrigins": [ "http://localhost:3000" ], diff --git a/Streetcode/Streetcode.WebApi/appsettings.json b/Streetcode/Streetcode.WebApi/appsettings.json index b5d976f12..069898083 100644 --- a/Streetcode/Streetcode.WebApi/appsettings.json +++ b/Streetcode/Streetcode.WebApi/appsettings.json @@ -1,6 +1,6 @@ { "ConnectionStrings": { - "DefaultConnection": "Server=127.0.0.1;Database=StreetcodeDb;User Id=sa;Password=Admin@1234;MultipleActiveResultSets=true" + "DefaultConnection": "Server=127.0.0.1;Database=StreetcodeDb;User Id=sa;Password=Admin@1234;MultipleActiveResultSets=true" }, "EmailConfiguration": { "From": "streetcodefeedback@gmail.com", From a70e9ddd419385ceac97db9b0f6a0e277ea29dac Mon Sep 17 00:00:00 2001 From: ValDekh Date: Mon, 7 Aug 2023 14:23:09 +0300 Subject: [PATCH 8/8] Delete client --- Streetcode/StreetCode.Client | 1 - 1 file changed, 1 deletion(-) delete mode 160000 Streetcode/StreetCode.Client diff --git a/Streetcode/StreetCode.Client b/Streetcode/StreetCode.Client deleted file mode 160000 index 73140a1f7..000000000 --- a/Streetcode/StreetCode.Client +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 73140a1f7a653d6b9781bc45f2f8c665f70b6601