diff --git a/api/src/Kurs.Platform.Domain/Classroom/Classroom.cs b/api/src/Kurs.Platform.Domain/Entities/Classroom/Classroom.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Classroom/Classroom.cs rename to api/src/Kurs.Platform.Domain/Entities/Classroom/Classroom.cs diff --git a/api/src/Kurs.Platform.Domain/Classroom/ClassroomAttandance.cs b/api/src/Kurs.Platform.Domain/Entities/Classroom/ClassroomAttandance.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Classroom/ClassroomAttandance.cs rename to api/src/Kurs.Platform.Domain/Entities/Classroom/ClassroomAttandance.cs diff --git a/api/src/Kurs.Platform.Domain/Classroom/ClassroomChat.cs b/api/src/Kurs.Platform.Domain/Entities/Classroom/ClassroomChat.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Classroom/ClassroomChat.cs rename to api/src/Kurs.Platform.Domain/Entities/Classroom/ClassroomChat.cs diff --git a/api/src/Kurs.Platform.Domain/Classroom/ClassroomParticipant.cs b/api/src/Kurs.Platform.Domain/Entities/Classroom/ClassroomParticipant.cs similarity index 100% rename from api/src/Kurs.Platform.Domain/Classroom/ClassroomParticipant.cs rename to api/src/Kurs.Platform.Domain/Entities/Classroom/ClassroomParticipant.cs diff --git a/api/src/Kurs.Platform.Domain/Entities/Bank.cs b/api/src/Kurs.Platform.Domain/Entities/Definitions/Bank.cs similarity index 64% rename from api/src/Kurs.Platform.Domain/Entities/Bank.cs rename to api/src/Kurs.Platform.Domain/Entities/Definitions/Bank.cs index 4075666f..ab371b32 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Bank.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Definitions/Bank.cs @@ -1,40 +1,18 @@ using System; -using System.ComponentModel.DataAnnotations; using Volo.Abp.Domain.Entities.Auditing; namespace Kurs.Platform.Entities; public class Bank : FullAuditedEntity { - [Required] - [MaxLength(256)] public string Name { get; set; } - - [MaxLength(64)] public string IdentifierCode { get; set; } - - // Adres alanları - [MaxLength(256)] public string AddressLine1 { get; set; } - - [MaxLength(256)] public string AddressLine2 { get; set; } - - [MaxLength(128)] public string District { get; set; } - - [MaxLength(128)] public string City { get; set; } - - [MaxLength(16)] public string PostalCode { get; set; } - - [MaxLength(128)] public string Country { get; set; } - - [MaxLength(64)] public string Phone { get; set; } - - [MaxLength(128)] public string Email { get; set; } } diff --git a/api/src/Kurs.Platform.Domain/Entities/BankAccount.cs b/api/src/Kurs.Platform.Domain/Entities/Definitions/BankAccount.cs similarity index 80% rename from api/src/Kurs.Platform.Domain/Entities/BankAccount.cs rename to api/src/Kurs.Platform.Domain/Entities/Definitions/BankAccount.cs index 2fd107dc..75607fe5 100644 --- a/api/src/Kurs.Platform.Domain/Entities/BankAccount.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Definitions/BankAccount.cs @@ -1,26 +1,16 @@ using System; -using System.ComponentModel.DataAnnotations; using Volo.Abp.Domain.Entities.Auditing; namespace Kurs.Platform.Entities; public class BankAccount : FullAuditedEntity { - [Required] - [MaxLength(64)] public string AccountNumber { get; set; } - public Guid BankId { get; set; } public Bank Bank { get; set; } - - [MaxLength(256)] public string AccountOwner { get; set; } - public Guid? CurrencyId { get; set; } // Currency entity'sine referans public Currency Currency { get; set; } - public bool CanTransferMoney { get; set; } - - [MaxLength(256)] public string Company { get; set; } } diff --git a/api/src/Kurs.Platform.Domain/Entities/Definitions/ContactTag.cs b/api/src/Kurs.Platform.Domain/Entities/Definitions/ContactTag.cs index ba1f2efe..1fd321cb 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Definitions/ContactTag.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Definitions/ContactTag.cs @@ -1,12 +1,8 @@ using System; -using System.ComponentModel.DataAnnotations; using Volo.Abp.Domain.Entities.Auditing; public class ContactTag : FullAuditedEntity { - [Required, MaxLength(128)] public string Name { get; set; } - - [MaxLength(128)] public string Category { get; set; } } diff --git a/api/src/Kurs.Platform.Domain/Entities/Definitions/ContactTitle.cs b/api/src/Kurs.Platform.Domain/Entities/Definitions/ContactTitle.cs index 834bd521..da4e2a1b 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Definitions/ContactTitle.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Definitions/ContactTitle.cs @@ -1,12 +1,8 @@ using System; -using System.ComponentModel.DataAnnotations; using Volo.Abp.Domain.Entities.Auditing; public class ContactTitle : FullAuditedEntity { - [Required, MaxLength(128)] public string Title { get; set; } - - [MaxLength(64)] public string Abbreviation { get; set; } } diff --git a/api/src/Kurs.Platform.Domain/Entities/Definitions/Currency.cs b/api/src/Kurs.Platform.Domain/Entities/Definitions/Currency.cs index f5dd7788..8dddc967 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Definitions/Currency.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Definitions/Currency.cs @@ -6,20 +6,10 @@ namespace Kurs.Platform.Entities; public class Currency : FullAuditedEntity { - [Required] - [MaxLength(8)] public string Code { get; set; } // TRY, USD, EUR - - [MaxLength(8)] public string Symbol { get; set; } // ₺, $, etc. - - [Required] - [MaxLength(128)] public string Name { get; set; } // Turkish lira, US dollar, ... - public decimal Rate { get; set; } // TRY başına değer - public bool IsActive { get; set; } - public DateTime? LastUpdated { get; set; } } diff --git a/api/src/Kurs.Platform.Domain/Entities/Definitions/Sector.cs b/api/src/Kurs.Platform.Domain/Entities/Definitions/Sector.cs index c15b0c16..13a9c15d 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Definitions/Sector.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Definitions/Sector.cs @@ -1,15 +1,10 @@ using System; using Volo.Abp.Domain.Entities.Auditing; -using System.ComponentModel.DataAnnotations; namespace Kurs.Platform.Entities; public class Sector : FullAuditedEntity { - [Required] - [MaxLength(128)] public string Name { get; set; } - - [MaxLength(256)] public string FullName { get; set; } } \ No newline at end of file diff --git a/api/src/Kurs.Platform.Domain/Entities/Definitions/Skill.cs b/api/src/Kurs.Platform.Domain/Entities/Definitions/Skill.cs index d637e616..aa25395d 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Definitions/Skill.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Definitions/Skill.cs @@ -6,9 +6,6 @@ namespace Kurs.Platform.Entities; public class Skill : FullAuditedEntity { public string Name { get; set; } - public Guid SkillTypeId { get; set; } - public SkillType SkillType { get; set; } - } \ No newline at end of file diff --git a/api/src/Kurs.Platform.Domain/Entities/Definitions/SkillLevel.cs b/api/src/Kurs.Platform.Domain/Entities/Definitions/SkillLevel.cs index 286e3adf..48b0a048 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Definitions/SkillLevel.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Definitions/SkillLevel.cs @@ -6,11 +6,8 @@ namespace Kurs.Platform.Entities; public class SkillLevel : FullAuditedEntity { public string Name { get; set; } - public int Progress { get; set; } public bool IsDefault { get; set; } - public Guid SkillTypeId { get; set; } - public SkillType SkillType { get; set; } } \ No newline at end of file diff --git a/api/src/Kurs.Platform.Domain/Entities/Definitions/SkillType.cs b/api/src/Kurs.Platform.Domain/Entities/Definitions/SkillType.cs index 9d9df4ca..3ebd6570 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Definitions/SkillType.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Definitions/SkillType.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using Volo.Abp.Domain.Entities.Auditing; namespace Kurs.Platform.Entities; + public class SkillType : FullAuditedEntity { public string Name { get; set; } diff --git a/api/src/Kurs.Platform.Domain/Entities/Definitions/UomCategory.cs b/api/src/Kurs.Platform.Domain/Entities/Definitions/UomCategory.cs index 694f03df..2a1d3620 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Definitions/UomCategory.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Definitions/UomCategory.cs @@ -12,7 +12,7 @@ public class UomCategory : FullAuditedEntity protected UomCategory() { } - public UomCategory(Guid id, string name): base(id) + public UomCategory(Guid id, string name) : base(id) { Name = name; } diff --git a/api/src/Kurs.Platform.Domain/Entities/Report/ReportCategory.cs b/api/src/Kurs.Platform.Domain/Entities/Report/ReportCategory.cs index 16744bff..2ad513e6 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Report/ReportCategory.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Report/ReportCategory.cs @@ -1,13 +1,11 @@ using System; using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; using Volo.Abp.Domain.Entities.Auditing; namespace Kurs.Platform.Entities { public class ReportCategory : FullAuditedEntity { - [Required] public string Name { get; set; } public string Description { get; set; } public string Icon { get; set; } diff --git a/api/src/Kurs.Platform.Domain/Entities/Report/ReportGenerated.cs b/api/src/Kurs.Platform.Domain/Entities/Report/ReportGenerated.cs index 18dc987d..a169d250 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Report/ReportGenerated.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Report/ReportGenerated.cs @@ -7,19 +7,11 @@ namespace Kurs.Platform.Entities public class ReportGenerated : FullAuditedEntity { public Guid? TemplateId { get; set; } - - [Required] - [StringLength(256)] public string TemplateName { get; set; } - - [Required] public string GeneratedContent { get; set; } - - public string Parameters { get; set; } // JSON string for parameters - + public string Parameters { get; set; } public DateTime GeneratedAt { get; set; } - // Navigation property public virtual ReportTemplate Template { get; set; } public ReportGenerated() diff --git a/api/src/Kurs.Platform.Domain/Entities/Report/ReportParameter.cs b/api/src/Kurs.Platform.Domain/Entities/Report/ReportParameter.cs index c05a14aa..727f9d75 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Report/ReportParameter.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Report/ReportParameter.cs @@ -7,8 +7,6 @@ namespace Kurs.Platform.Entities public class ReportParameter : FullAuditedEntity { public Guid ReportTemplateId { get; set; } - - [Required] public string Name { get; set; } public string Placeholder { get; set; } public string Type { get; set; } diff --git a/api/src/Kurs.Platform.Domain/Entities/Report/ReportTemplate.cs b/api/src/Kurs.Platform.Domain/Entities/Report/ReportTemplate.cs index ec9d220b..0cb90b0c 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Report/ReportTemplate.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Report/ReportTemplate.cs @@ -7,14 +7,11 @@ namespace Kurs.Platform.Entities { public class ReportTemplate : FullAuditedEntity { - [Required] public string Name { get; set; } public string Description { get; set; } - - [Required] public string HtmlContent { get; set; } public string CategoryName { get; set; } - public string Tags { get; set; } // JSON string array + public string Tags { get; set; } public ReportCategory ReportCategory { get; set; } public ICollection Parameters { get; set; } diff --git a/api/src/Kurs.Platform.Domain/Entities/Saas/BackgroundWorker.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/BackgroundWorker.cs index 6bc7464f..ef466a82 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Saas/BackgroundWorker.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Saas/BackgroundWorker.cs @@ -1,5 +1,4 @@ using System; -using System.ComponentModel.DataAnnotations; using Kurs.Platform.Enums; using Volo.Abp.Domain.Entities.Auditing; @@ -7,21 +6,12 @@ namespace Kurs.Platform.Entities; public class BackgroundWorker : FullAuditedEntity { - [Required] - [StringLength(100)] public string Name { get; set; } - [Required] - [StringLength(50)] public string Cron { get; set; } - /// PlatformConsts.WorkerTypes - [Required] - public WorkerTypeEnum WorkerType { get; set; } //MailQueue, Sql + public WorkerTypeEnum WorkerType { get; set; } public bool IsActive { get; set; } - [StringLength(50)] public string DataSourceCode { get; set; } - [StringLength(100)] public string BeforeSp { get; set; } - [StringLength(100)] public string AfterSp { get; set; } public string Options { get; set; } diff --git a/api/src/Kurs.Platform.Domain/Entities/Saas/DataSource.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/DataSource.cs index 2597900f..599a57be 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Saas/DataSource.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Saas/DataSource.cs @@ -1,5 +1,4 @@ using System; -using System.ComponentModel.DataAnnotations; using Kurs.Platform.Enums; using Volo.Abp.Domain.Entities.Auditing; @@ -7,9 +6,7 @@ namespace Kurs.Platform.Entities; public class DataSource : FullAuditedEntity { - [StringLength(50)] public string Code { get; set; } public DataSourceTypeEnum DataSourceType { get; set; } - [StringLength(200)] public string ConnectionString { get; set; } } diff --git a/api/src/Kurs.Platform.Domain/Entities/Saas/GlobalSearch.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/GlobalSearch.cs index ffdba41a..47e54ea0 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Saas/GlobalSearch.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Saas/GlobalSearch.cs @@ -9,9 +9,7 @@ public class GlobalSearch : Entity, IMultiTenant { public virtual Guid? TenantId { get; protected set; } - [StringLength(50)] public string System { get; set; } // KIM, ETA, vb. - [StringLength(50)] public string Group { get; set; } // Musteri, Desen, vb. public string Term { get; set; } // Aranacak terim public string Weight { get; set; } // Aranacak terimin ağırlığı. diff --git a/api/src/Kurs.Platform.Domain/Entities/Saas/IpRestriction.cs b/api/src/Kurs.Platform.Domain/Entities/Saas/IpRestriction.cs index 9b819ec9..d23204d1 100644 --- a/api/src/Kurs.Platform.Domain/Entities/Saas/IpRestriction.cs +++ b/api/src/Kurs.Platform.Domain/Entities/Saas/IpRestriction.cs @@ -11,5 +11,4 @@ public class IpRestriction : FullAuditedEntity, IMultiTenant public string ResourceType { get; set; } public string ResourceId { get; set; } public string IP { get; set; } - } diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs b/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs index add3e0df..b5d4eefb 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/EntityFrameworkCore/PlatformDbContext.cs @@ -168,12 +168,82 @@ public class PlatformDbContext : builder.Entity(b => { b.ToTable(PlatformConsts.DbTablePrefix + nameof(ListForm), PlatformConsts.DbSchema); - b.ConfigureByConvention(); //auto configure for the base class props - //b.HasIndex(x => x.ListFormCode); //TODO: Should be non-unique index + b.ConfigureByConvention(); // base class props - //b.Property(a => a.KeyFieldDbSourceType).HasDefaultValue(16); + // Anahtar + b.HasKey(x => x.Id); + + // Özellikler + b.Property(a => a.ListFormCode).IsRequired().HasMaxLength(64); + b.Property(a => a.CultureName).HasMaxLength(10); + b.Property(a => a.DataSourceCode).HasMaxLength(100); + b.Property(a => a.TableName).HasMaxLength(128); b.Property(a => a.KeyFieldName).HasMaxLength(50); - b.Property(a => a.PageSize).HasDefaultValue(10); + b.Property(a => a.Name).HasMaxLength(128); + b.Property(a => a.Description).HasMaxLength(512); + b.Property(a => a.Title).HasMaxLength(256); + b.Property(a => a.SortMode).HasMaxLength(20); + b.Property(a => a.PageSize).HasDefaultValue(20); + b.Property(a => a.UpdateServiceAddress).HasMaxLength(256); + b.Property(a => a.InsertServiceAddress).HasMaxLength(256); + b.Property(a => a.DeleteServiceAddress).HasMaxLength(256); + b.Property(a => a.UserId).HasMaxLength(256); + b.Property(a => a.RoleId).HasMaxLength(256); + b.Property(a => a.ListFormType).HasMaxLength(20); + + // Uzun JSON alanları için nvarchar(max) + b.Property(a => a.SelectCommand).HasColumnType("nvarchar(max)"); + b.Property(a => a.SelectFieldsDefaultValueJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.DefaultFilter).HasColumnType("nvarchar(max)"); + b.Property(a => a.ColumnOptionJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.PivotOptionJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.FilterRowJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.HeaderFilterJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.FilterPanelJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.SearchPanelJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.GroupPanelJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.SelectionJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.PagerOptionJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.EditingOptionJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.EditingFormJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.PermissionJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.InsertFieldsDefaultValueJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.UpdateFieldsDefaultValueJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.DeleteFieldsDefaultValueJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.CommandColumnJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.StateStoringJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.DeleteCommand).HasColumnType("nvarchar(max)"); + b.Property(a => a.UpdateCommand).HasColumnType("nvarchar(max)"); + b.Property(a => a.InsertCommand).HasColumnType("nvarchar(max)"); + b.Property(a => a.CustomJsSourcesJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.CustomStyleSourcesJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.FormFieldsDefaultValueJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.SubFormsJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.WidgetsJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.ExtraFilterJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.LayoutJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.CommonJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.DataSourceJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.AdaptiveLayoutJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.AnimationJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.AnnotationsJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.ArgumentAxisJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.CommonAnnotationsSettingsJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.CommonAxisSettingsJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.CommonPaneSettingsJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.CommonSeriesSettingsJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.CrosshairJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.ExportJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.LegendJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.MarginJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.PanesJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.ScrollBarJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.SeriesJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.SizeJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.TitleJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.TooltipJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.ValueAxisJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.ZoomAndPanJson).HasColumnType("nvarchar(max)"); b.HasMany().WithOne().HasForeignKey(x => x.ListFormCode).HasPrincipalKey(x => x.ListFormCode).IsRequired(); b.HasMany().WithOne().HasForeignKey(x => x.ListFormCode).HasPrincipalKey(x => x.ListFormCode).IsRequired(); @@ -184,19 +254,60 @@ public class PlatformDbContext : b.ToTable(PlatformConsts.DbTablePrefix + nameof(ListFormField), PlatformConsts.DbSchema); b.ConfigureByConvention(); + // Anahtar + b.HasKey(x => x.Id); + + // Zorunlu alanlar + b.Property(a => a.ListFormCode).IsRequired().HasMaxLength(64); + b.Property(a => a.UserId).HasMaxLength(256); + b.Property(a => a.RoleId).HasMaxLength(256); + b.Property(a => a.CultureName).HasMaxLength(10); + b.Property(a => a.FieldName).IsRequired().HasMaxLength(100); + b.Property(a => a.CaptionName).HasMaxLength(200); + + // Varsayılan değerler b.Property(a => a.AllowSearch).HasDefaultValue(false); b.Property(a => a.IsActive).HasDefaultValue(true); b.Property(a => a.Visible).HasDefaultValue(true); b.Property(a => a.ListOrderNo).HasDefaultValue(30); - b.Property(a => a.FieldName).HasMaxLength(100); b.Property(a => a.Width).HasDefaultValue(100); - b.Property(a => a.SourceDbType).HasDefaultValue(System.Data.DbType.String).HasSentinel(System.Data.DbType.AnsiString); + b.Property(a => a.SortDirection).HasMaxLength(10); + b.Property(a => a.BandName).HasMaxLength(128); + + // JSON alanlar + b.Property(a => a.ColumnFilterJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.ColumnHeaderJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.GroupingJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.ColumnCustomizationJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.TotalSummaryJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.GroupSummaryJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.JoinTableJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.EditingJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.LookupJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.ValidationRuleJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.ColumnStylingJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.PermissionJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.PivotSettingsJson).HasColumnType("nvarchar(max)"); + + // Stil ve format + b.Property(a => a.ColumnCssClass).HasMaxLength(100); + b.Property(a => a.ColumnCssValue).HasMaxLength(256); + b.Property(a => a.Alignment).HasMaxLength(20).HasDefaultValue("left"); + b.Property(a => a.Format).HasMaxLength(100); + b.Property(a => a.EditorOptions).HasColumnType("nvarchar(max)"); }); builder.Entity(b => { b.ToTable(PlatformConsts.DbTablePrefix + nameof(ListFormCustomization), PlatformConsts.DbSchema); b.ConfigureByConvention(); + + b.Property(a => a.ListFormCode).IsRequired().HasMaxLength(64); + b.Property(a => a.UserId).HasMaxLength(256); + b.Property(a => a.RoleId).HasMaxLength(256); + b.Property(a => a.FilterName).HasMaxLength(128); + b.Property(a => a.CustomizationData).HasColumnType("nvarchar(max)"); + b.Property(a => a.CustomizationType).IsRequired(); }); builder.Entity(b => @@ -204,12 +315,12 @@ public class PlatformDbContext : b.ToTable(PlatformConsts.DbTablePrefix + nameof(Menu), PlatformConsts.DbSchema); b.ConfigureByConvention(); - b.Property(a => a.Code).HasMaxLength(100).IsRequired(); - b.Property(a => a.DisplayName).HasMaxLength(100).IsRequired(); - b.Property(a => a.Url).HasMaxLength(100); + b.Property(a => a.Code).IsRequired().HasMaxLength(100); + b.Property(a => a.DisplayName).IsRequired().HasMaxLength(100); + b.Property(a => a.Url).HasMaxLength(250); b.Property(a => a.Icon).HasMaxLength(50); b.Property(a => a.ParentCode).HasMaxLength(50); - b.Property(a => a.CssClass).HasMaxLength(50); + b.Property(a => a.CssClass).HasMaxLength(128); b.Property(a => a.RequiredPermissionName).HasMaxLength(128); b.Property(a => a.Target).HasMaxLength(50); b.Property(a => a.ElementId).HasMaxLength(50); @@ -223,54 +334,105 @@ public class PlatformDbContext : b.ToTable(PlatformConsts.DbTablePrefix + nameof(IpRestriction), PlatformConsts.DbSchema); b.ConfigureByConvention(); - b.Property(a => a.ResourceType).HasMaxLength(10).IsRequired(); + b.Property(a => a.ResourceType).IsRequired().HasMaxLength(10); b.Property(a => a.ResourceId).HasMaxLength(32); - b.Property(a => a.IP).HasMaxLength(32).IsRequired(); + b.Property(a => a.IP).IsRequired().HasMaxLength(32); }); builder.Entity(b => { b.ToTable(PlatformConsts.DbTablePrefix + nameof(DataSource), PlatformConsts.DbSchema); - b.ConfigureByConvention(); //auto configure for the base class props + b.ConfigureByConvention(); - b.Property(a => a.Code).HasMaxLength(100).IsRequired(); + b.Property(a => a.Code).IsRequired().HasMaxLength(100); + b.Property(a => a.ConnectionString).HasMaxLength(256); + b.Property(a => a.DataSourceType).IsRequired(); }); builder.Entity(b => { b.ToTable(PlatformConsts.DbTablePrefix + nameof(BackgroundWorker), PlatformConsts.DbSchema); - b.ConfigureByConvention(); //auto configure for the base class props + b.ConfigureByConvention(); + + b.Property(a => a.Name).IsRequired().HasMaxLength(100); + b.Property(a => a.Cron).IsRequired().HasMaxLength(50); + b.Property(a => a.WorkerType).IsRequired(); + b.Property(a => a.IsActive).HasDefaultValue(true); + b.Property(a => a.DataSourceCode).HasMaxLength(50); + b.Property(a => a.BeforeSp).HasMaxLength(100); + b.Property(a => a.AfterSp).HasMaxLength(100); + b.Property(a => a.Options).HasColumnType("nvarchar(max)"); }); builder.Entity(b => { b.ToTable(PlatformConsts.DbTablePrefix + nameof(CustomEndpoint), PlatformConsts.DbSchema); b.ConfigureByConvention(); + + b.Property(a => a.Name).IsRequired().HasMaxLength(128); + b.Property(a => a.Description).HasMaxLength(512); + b.Property(a => a.Url).IsRequired().HasMaxLength(256); + b.Property(a => a.Method).IsRequired().HasMaxLength(10); + b.Property(a => a.DataSourceCode).IsRequired().HasMaxLength(100); + b.Property(a => a.Sql).IsRequired(); + b.Property(a => a.ParametersJson).HasColumnType("nvarchar(max)"); + b.Property(a => a.PermissionsJson).HasColumnType("nvarchar(max)"); }); builder.Entity(b => { b.ToTable(PlatformConsts.DbTablePrefix + nameof(GlobalSearch), PlatformConsts.DbSchema); b.ConfigureByConvention(); + + b.Property(a => a.System).HasMaxLength(50); + b.Property(a => a.Group).HasMaxLength(50); + b.Property(a => a.Term).IsRequired().HasMaxLength(256); + b.Property(a => a.Weight).HasMaxLength(50); + b.Property(a => a.Url).HasMaxLength(512); }); builder.Entity(b => { b.ToTable(PlatformConsts.DbTablePrefix + nameof(AiBot), PlatformConsts.DbSchema); b.ConfigureByConvention(); + + b.Property(a => a.BotName).IsRequired().HasMaxLength(128); }); builder.Entity(b => { b.ToTable(PlatformConsts.DbTablePrefix + nameof(Branch), PlatformConsts.DbSchema); b.ConfigureByConvention(); + + b.Property(a => a.TenantId).IsRequired(); + b.Property(a => a.Code).IsRequired().HasMaxLength(64); + b.Property(a => a.Name).IsRequired().HasMaxLength(128); + b.Property(a => a.VknTckn).IsRequired(); + b.Property(a => a.TaxOffice).HasMaxLength(128); + b.Property(a => a.Country).HasMaxLength(128); + b.Property(a => a.City).HasMaxLength(128); + b.Property(a => a.District).HasMaxLength(128); + b.Property(a => a.Street).HasMaxLength(256); + b.Property(a => a.Address).HasMaxLength(512); + b.Property(a => a.Address2).HasMaxLength(512); + b.Property(a => a.PostalCode).HasMaxLength(16); + b.Property(a => a.Phone).HasMaxLength(20); + b.Property(a => a.Mobile).IsRequired().HasMaxLength(20); + b.Property(a => a.Fax).HasMaxLength(20); + b.Property(a => a.Email).HasMaxLength(128); + b.Property(a => a.Website).HasMaxLength(128); + b.Property(a => a.IsActive).HasDefaultValue(true); }); builder.Entity(b => { b.ToTable(PlatformConsts.DbTablePrefix + nameof(BranchUsers), PlatformConsts.DbSchema); - b.HasKey(x => new { x.UserId, x.BranchId }); b.ConfigureByConvention(); + + b.HasKey(x => new { x.UserId, x.BranchId }); + b.Property(a => a.UserId).IsRequired(); + b.Property(a => a.BranchId).IsRequired(); + b.Property(a => a.TenantId); }); builder.Entity(b => @@ -287,12 +449,9 @@ public class PlatformDbContext : b.ToTable(PlatformConsts.DbTablePrefix + nameof(UomCategory), PlatformConsts.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Name) - .IsRequired() - .HasMaxLength(128); + b.Property(x => x.Name).IsRequired().HasMaxLength(128); - b.HasIndex(x => x.Name) - .IsUnique(); + b.HasIndex(x => x.Name).IsUnique(); }); builder.Entity(b => @@ -301,17 +460,10 @@ public class PlatformDbContext : b.ConfigureByConvention(); b.Property(x => x.Name).IsRequired().HasMaxLength(64); - - b.Property(x => x.Type) - .HasConversion() - .HasMaxLength(32) - .IsRequired(); - + b.Property(x => x.Type).IsRequired().HasConversion().HasMaxLength(32); b.Property(x => x.Ratio).HasPrecision(18, 6); b.Property(x => x.Rounding).HasPrecision(18, 6); - - b.Property(x => x.UomCategoryId) - .IsRequired(); + b.Property(x => x.UomCategoryId).IsRequired(); b.HasOne(x => x.UomCategory) .WithMany(x => x.Uoms) @@ -328,8 +480,8 @@ public class PlatformDbContext : b.Property(x => x.Code).IsRequired().HasMaxLength(8); b.Property(x => x.Symbol).HasMaxLength(8); b.Property(x => x.Name).IsRequired().HasMaxLength(128); - b.Property(x => x.Rate).HasColumnType("decimal(18,6)"); - b.Property(x => x.IsActive); + b.Property(x => x.Rate).HasPrecision(18, 6); + b.Property(x => x.IsActive).HasDefaultValue(true); b.Property(x => x.LastUpdated); }); @@ -339,6 +491,15 @@ public class PlatformDbContext : b.ConfigureByConvention(); b.Property(x => x.Name).IsRequired().HasMaxLength(128); + b.Property(x => x.IdentifierCode).HasMaxLength(64); + b.Property(x => x.AddressLine1).HasMaxLength(256); + b.Property(x => x.AddressLine2).HasMaxLength(256); + b.Property(x => x.District).HasMaxLength(128); + b.Property(x => x.City).HasMaxLength(128); + b.Property(x => x.PostalCode).HasMaxLength(16); + b.Property(x => x.Country).HasMaxLength(128); + b.Property(x => x.Phone).HasMaxLength(64); + b.Property(x => x.Email).HasMaxLength(128); }); builder.Entity(b => @@ -347,20 +508,30 @@ public class PlatformDbContext : b.ConfigureByConvention(); b.Property(x => x.AccountNumber).IsRequired().HasMaxLength(64); - b.Property(x => x.BankId).IsRequired(); b.Property(x => x.AccountOwner).IsRequired().HasMaxLength(256); + b.Property(x => x.Company).HasMaxLength(256); + + b.Property(x => x.BankId).IsRequired(); + b.Property(x => x.CurrencyId); b.HasOne(x => x.Bank) - .WithMany() - .HasPrincipalKey(x => x.Id) - .HasForeignKey(x => x.BankId) - .OnDelete(DeleteBehavior.Restrict); + .WithMany() + .HasPrincipalKey(x => x.Id) + .HasForeignKey(x => x.BankId) + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne(x => x.Currency) + .WithMany() + .HasPrincipalKey(x => x.Id) + .HasForeignKey(x => x.CurrencyId) + .OnDelete(DeleteBehavior.Restrict); }); builder.Entity(b => { b.ToTable(PlatformConsts.DbTablePrefix + nameof(CountryGroup), PlatformConsts.DbSchema); b.ConfigureByConvention(); + b.Property(x => x.Name).IsRequired().HasMaxLength(128); b.HasIndex(x => x.Name).IsUnique(); }); @@ -381,16 +552,16 @@ public class PlatformDbContext : b.HasIndex(x => x.GroupName); b.HasMany(x => x.Cities) - .WithOne(x => x.Country) - .HasForeignKey(x => x.CountryCode) - .HasPrincipalKey(x => x.Code) - .OnDelete(DeleteBehavior.Cascade); + .WithOne(x => x.Country) + .HasForeignKey(x => x.CountryCode) + .HasPrincipalKey(x => x.Code) + .OnDelete(DeleteBehavior.Cascade); b.HasOne() - .WithMany() - .HasPrincipalKey(x => x.Name) - .HasForeignKey(x => x.GroupName) - .OnDelete(DeleteBehavior.Restrict); + .WithMany() + .HasPrincipalKey(x => x.Name) + .HasForeignKey(x => x.GroupName) + .OnDelete(DeleteBehavior.Restrict); }); builder.Entity(b => @@ -406,10 +577,10 @@ public class PlatformDbContext : b.HasIndex(x => new { x.CountryCode, x.Code }).IsUnique(); b.HasMany(x => x.Districts) - .WithOne(x => x.City) - .HasForeignKey(x => new { x.CountryCode, x.CityCode }) - .HasPrincipalKey(x => new { x.CountryCode, x.Code }) - .OnDelete(DeleteBehavior.Cascade); + .WithOne(x => x.City) + .HasForeignKey(x => new { x.CountryCode, x.CityCode }) + .HasPrincipalKey(x => new { x.CountryCode, x.Code }) + .OnDelete(DeleteBehavior.Cascade); }); builder.Entity(b => @@ -417,8 +588,9 @@ public class PlatformDbContext : b.ToTable(PlatformConsts.DbTablePrefix + nameof(District), PlatformConsts.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Name).IsRequired().HasMaxLength(128); + b.Property(x => x.CountryCode).HasMaxLength(8); b.Property(x => x.CityCode).IsRequired().HasMaxLength(16); + b.Property(x => x.Name).IsRequired().HasMaxLength(128); b.Property(x => x.Township).HasMaxLength(128); b.Property(x => x.Street).HasMaxLength(256); b.Property(x => x.ZipCode).HasMaxLength(16); @@ -430,27 +602,29 @@ public class PlatformDbContext : { b.ToTable(PlatformConsts.DbTablePrefix + nameof(SkillType), PlatformConsts.DbSchema); b.ConfigureByConvention(); + b.Property(x => x.Name).IsRequired().HasMaxLength(128); b.HasIndex(x => x.Name).IsUnique(); b.HasMany(x => x.Skills) - .WithOne(x => x.SkillType) - .HasForeignKey(x => new { x.SkillTypeId }) - .HasPrincipalKey(x => new { x.Id }) - .OnDelete(DeleteBehavior.Cascade); + .WithOne(x => x.SkillType) + .HasForeignKey(x => x.SkillTypeId) + .HasPrincipalKey(x => x.Id) + .OnDelete(DeleteBehavior.Cascade); b.HasMany(x => x.Levels) - .WithOne(x => x.SkillType) - .HasForeignKey(x => new { x.SkillTypeId }) - .HasPrincipalKey(x => new { x.Id }) - .OnDelete(DeleteBehavior.Cascade); + .WithOne(x => x.SkillType) + .HasForeignKey(x => x.SkillTypeId) + .HasPrincipalKey(x => x.Id) + .OnDelete(DeleteBehavior.Cascade); }); builder.Entity(b => { b.ToTable(PlatformConsts.DbTablePrefix + nameof(Skill), PlatformConsts.DbSchema); b.ConfigureByConvention(); + b.Property(x => x.Name).IsRequired().HasMaxLength(128); b.Property(x => x.SkillTypeId).IsRequired(); }); @@ -459,16 +633,18 @@ public class PlatformDbContext : { b.ToTable(PlatformConsts.DbTablePrefix + nameof(SkillLevel), PlatformConsts.DbSchema); b.ConfigureByConvention(); + b.Property(x => x.Name).IsRequired().HasMaxLength(128); b.Property(x => x.SkillTypeId).IsRequired(); - b.Property(x => x.Progress); - b.Property(x => x.IsDefault); + b.Property(x => x.Progress).HasDefaultValue(0); + b.Property(x => x.IsDefault).HasDefaultValue(false); }); builder.Entity(b => { b.ToTable(PlatformConsts.DbTablePrefix + nameof(ContactTag), PlatformConsts.DbSchema); b.ConfigureByConvention(); + b.Property(x => x.Name).IsRequired().HasMaxLength(128); b.Property(x => x.Category).HasMaxLength(128); }); @@ -477,11 +653,11 @@ public class PlatformDbContext : { b.ToTable(PlatformConsts.DbTablePrefix + nameof(ContactTitle), PlatformConsts.DbSchema); b.ConfigureByConvention(); + b.Property(x => x.Title).IsRequired().HasMaxLength(128); b.Property(x => x.Abbreviation).HasMaxLength(64); }); - // Blog Entity Configurations builder.Entity(b => { b.ToTable(PlatformConsts.DbTablePrefix + nameof(BlogCategory), PlatformConsts.DbSchema); @@ -490,6 +666,7 @@ public class PlatformDbContext : b.Property(x => x.Name).IsRequired().HasMaxLength(128); b.Property(x => x.Slug).IsRequired().HasMaxLength(128); b.Property(x => x.Description).HasMaxLength(512); + b.Property(x => x.Icon).HasMaxLength(128); b.HasIndex(x => x.Slug); }); @@ -505,6 +682,7 @@ public class PlatformDbContext : b.Property(x => x.ContentTr).IsRequired(); b.Property(x => x.ContentEn).IsRequired(); b.Property(x => x.CoverImage).HasMaxLength(512); + b.Property(x => x.ReadTime).HasMaxLength(64); b.HasIndex(x => x.Slug); b.HasIndex(x => x.IsPublished); @@ -516,25 +694,24 @@ public class PlatformDbContext : .OnDelete(DeleteBehavior.Restrict); }); - // Forum Entity Configurations - // ForumCategory builder.Entity(b => { b.ToTable(PlatformConsts.DbTablePrefix + nameof(ForumCategory), PlatformConsts.DbSchema); b.ConfigureByConvention(); b.Property(x => x.Name).IsRequired().HasMaxLength(128); + b.Property(x => x.Slug).IsRequired().HasMaxLength(128); b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.Icon).HasMaxLength(64); b.HasIndex(x => x.DisplayOrder); + b.HasMany(x => x.Topics) .WithOne(x => x.Category) .HasForeignKey(x => x.CategoryId) .OnDelete(DeleteBehavior.Restrict); }); - // ForumTopic builder.Entity(b => { b.ToTable(PlatformConsts.DbTablePrefix + nameof(ForumTopic), PlatformConsts.DbSchema); @@ -542,6 +719,8 @@ public class PlatformDbContext : b.Property(x => x.Title).IsRequired().HasMaxLength(256); b.Property(x => x.Content).IsRequired(); + b.Property(x => x.AuthorName).HasMaxLength(128); + b.Property(x => x.LastPostUserName).HasMaxLength(128); b.HasIndex(x => x.CategoryId); b.HasIndex(x => x.IsPinned); @@ -553,13 +732,13 @@ public class PlatformDbContext : .OnDelete(DeleteBehavior.Cascade); }); - // ForumPost builder.Entity(b => { b.ToTable(PlatformConsts.DbTablePrefix + nameof(ForumPost), PlatformConsts.DbSchema); b.ConfigureByConvention(); b.Property(x => x.Content).IsRequired(); + b.Property(x => x.AuthorName).HasMaxLength(128); b.HasIndex(x => x.TopicId); @@ -584,6 +763,8 @@ public class PlatformDbContext : b.Property(x => x.Key).IsRequired().HasMaxLength(128); b.Property(x => x.Path).IsRequired().HasMaxLength(256); b.Property(x => x.ComponentPath).IsRequired().HasMaxLength(256); + b.Property(x => x.RouteType).HasMaxLength(64); + b.Property(x => x.Authority).HasConversion( v => string.Join(",", v), v => v.Split(',', StringSplitOptions.RemoveEmptyEntries) @@ -608,7 +789,11 @@ public class PlatformDbContext : b.Property(x => x.Description).HasMaxLength(500); b.Property(x => x.MigrationStatus).IsRequired().HasMaxLength(50); b.Property(x => x.EndpointStatus).IsRequired().HasMaxLength(50); - b.HasMany(x => x.Fields).WithOne(x => x.Entity).HasForeignKey(x => x.EntityId); + + b.HasMany(x => x.Fields) + .WithOne(x => x.Entity) + .HasForeignKey(x => x.EntityId) + .OnDelete(DeleteBehavior.Cascade); }); builder.Entity(b => @@ -620,6 +805,7 @@ public class PlatformDbContext : b.Property(x => x.Name).IsRequired().HasMaxLength(100); b.Property(x => x.Type).IsRequired().HasMaxLength(50); b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.DefaultValue).HasMaxLength(256); }); builder.Entity(b => @@ -632,7 +818,12 @@ public class PlatformDbContext : b.Property(x => x.FileName).IsRequired().HasMaxLength(200); b.Property(x => x.SqlScript).IsRequired(); b.Property(x => x.Status).IsRequired().HasMaxLength(50); - b.HasOne(x => x.Entity).WithMany().HasForeignKey(x => x.EntityId).IsRequired(false); + b.Property(x => x.ErrorMessage).HasMaxLength(1000); + + b.HasOne(x => x.Entity) + .WithMany() + .HasForeignKey(x => x.EntityId) + .OnDelete(DeleteBehavior.Restrict); }); builder.Entity(b => @@ -646,7 +837,11 @@ public class PlatformDbContext : b.Property(x => x.Path).IsRequired().HasMaxLength(200); b.Property(x => x.OperationType).IsRequired().HasMaxLength(50); b.Property(x => x.CsharpCode).IsRequired(); - b.HasOne(x => x.Entity).WithMany().HasForeignKey(x => x.EntityId); + + b.HasOne(x => x.Entity) + .WithMany() + .HasForeignKey(x => x.EntityId) + .OnDelete(DeleteBehavior.Cascade); }); builder.Entity(b => @@ -659,6 +854,7 @@ public class PlatformDbContext : b.Property(x => x.Code).IsRequired(); b.Property(x => x.Props).HasMaxLength(1000); b.Property(x => x.Description).HasMaxLength(500); + b.Property(x => x.Dependencies).HasMaxLength(2000); }); builder.Entity(b => @@ -675,7 +871,6 @@ public class PlatformDbContext : b.Property(x => x.ImageUrl).HasMaxLength(300); }); - // PaymentMethod builder.Entity(b => { b.ToTable(PlatformConsts.DbTablePrefix + nameof(PaymentMethod), PlatformConsts.DbSchema); @@ -687,7 +882,6 @@ public class PlatformDbContext : b.Property(x => x.Commission).HasPrecision(5, 3); }); - // InstallmentOption builder.Entity(b => { b.ToTable(PlatformConsts.DbTablePrefix + nameof(InstallmentOption), PlatformConsts.DbSchema); @@ -695,7 +889,7 @@ public class PlatformDbContext : b.HasKey(x => x.Id); b.Property(x => x.Name).IsRequired().HasMaxLength(32); - b.Property(x => x.Commission).HasPrecision(5, 3); // örn. %0.275 gibi değerler için + b.Property(x => x.Commission).HasPrecision(5, 3); }); builder.Entity(b => @@ -703,17 +897,28 @@ public class PlatformDbContext : b.ToTable(PlatformConsts.DbTablePrefix + nameof(Order), PlatformConsts.DbSchema); b.ConfigureByConvention(); + b.Property(o => o.OrganizationName).HasMaxLength(128); + b.Property(o => o.Founder).HasMaxLength(128); + b.Property(o => o.TaxOffice).HasMaxLength(128); + b.Property(o => o.Address).HasMaxLength(512); + b.Property(o => o.Address2).HasMaxLength(512); + b.Property(o => o.District).HasMaxLength(128); + b.Property(o => o.Country).HasMaxLength(128); + b.Property(o => o.City).HasMaxLength(128); + b.Property(o => o.PostalCode).HasMaxLength(16); + b.Property(o => o.Email).HasMaxLength(128); + b.Property(o => o.Website).HasMaxLength(128); + b.Property(o => o.Subtotal).IsRequired().HasPrecision(18, 2); b.Property(o => o.Commission).IsRequired().HasPrecision(18, 2); b.Property(o => o.Total).IsRequired().HasPrecision(18, 2); + b.Property(o => o.PaymentMethod).IsRequired().HasMaxLength(64); b.Property(o => o.InstallmentName).HasMaxLength(128); b.Property(o => o.PaymentDataJson).HasMaxLength(4000); - builder.Entity() - .HasMany(o => o.Items) + b.HasMany(o => o.Items) .WithOne(i => i.Order) - .IsRequired(false) .HasForeignKey(i => i.OrderId) .OnDelete(DeleteBehavior.Cascade); }); @@ -746,11 +951,9 @@ public class PlatformDbContext : b.Property(x => x.ImportId).IsRequired(); b.Property(x => x.BlobName).IsRequired().HasMaxLength(256); b.Property(x => x.Status).IsRequired().HasMaxLength(64); - b.Property(x => x.ErrorsJson).HasColumnType("text"); + b.Property(x => x.ErrorsJson).HasColumnType("nvarchar(max)"); }); - // Reports Configuration - // Reports Configuration builder.Entity(b => { b.ToTable(PlatformConsts.DbTablePrefix + nameof(ReportCategory), PlatformConsts.DbSchema); @@ -760,14 +963,13 @@ public class PlatformDbContext : b.Property(x => x.Description).HasMaxLength(4000); // JSON string b.Property(x => x.Icon).HasMaxLength(64); - // Primary key dışında Name de ilişki anahtarı olarak kullanılacaksa b.HasIndex(x => x.Name).IsUnique(); - b.HasMany(x => x.ReportTemplates) // Bir kategori birden çok template içerir - .WithOne(x => x.ReportCategory) // Template'in bir kategorisi vardır - .HasForeignKey(x => x.CategoryName) // Template tarafındaki FK property - .HasPrincipalKey(c => c.Name) // Category tarafındaki anahtar - .OnDelete(DeleteBehavior.SetNull); // Silindiğinde null bırak + b.HasMany(x => x.ReportTemplates) + .WithOne(x => x.ReportCategory) + .HasForeignKey(x => x.CategoryName) + .HasPrincipalKey(c => c.Name) + .OnDelete(DeleteBehavior.SetNull); }); builder.Entity(b => @@ -778,11 +980,8 @@ public class PlatformDbContext : b.Property(x => x.Name).IsRequired().HasMaxLength(256); b.Property(x => x.Description).HasMaxLength(1000); b.Property(x => x.HtmlContent).IsRequired(); - b.Property(x => x.CategoryName).HasMaxLength(100); - b.Property(x => x.Tags).HasMaxLength(2000); - - // Burada CategoryName FK olacak b.Property(x => x.CategoryName).HasMaxLength(256); + b.Property(x => x.Tags).HasMaxLength(2000); b.HasMany(t => t.Parameters) .WithOne(p => p.ReportTemplate) @@ -809,13 +1008,12 @@ public class PlatformDbContext : b.ToTable(PlatformConsts.DbTablePrefix + nameof(ReportGenerated), PlatformConsts.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.TemplateId).IsRequired(false); // Nullable yapıyoruz + b.Property(x => x.TemplateId).IsRequired(false); b.Property(x => x.TemplateName).IsRequired().HasMaxLength(256); b.Property(x => x.GeneratedContent).IsRequired(); b.Property(x => x.Parameters).HasMaxLength(4000); // JSON string b.Property(x => x.GeneratedAt).IsRequired(); - // Foreign key relationship b.HasOne(x => x.Template) .WithMany() .HasForeignKey(x => x.TemplateId) @@ -828,7 +1026,7 @@ public class PlatformDbContext : b.ToTable(PlatformConsts.DbTablePrefix + nameof(Demo), PlatformConsts.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.OrganizationName).IsRequired(true).HasMaxLength(256); + b.Property(x => x.OrganizationName).IsRequired().HasMaxLength(256); b.Property(x => x.FullName).IsRequired().HasMaxLength(256); b.Property(x => x.Email).IsRequired().HasMaxLength(256); b.Property(x => x.Phone).IsRequired().HasMaxLength(20); @@ -843,10 +1041,7 @@ public class PlatformDbContext : b.ToTable(PlatformConsts.DbTablePrefix + nameof(Service), PlatformConsts.DbSchema); b.ConfigureByConvention(); - b.Property(x => x.Title) - .IsRequired() - .HasMaxLength(128); - + b.Property(x => x.Title).IsRequired().HasMaxLength(128); b.Property(x => x.Description).HasMaxLength(512); b.Property(x => x.Icon).HasMaxLength(64); @@ -860,7 +1055,7 @@ public class PlatformDbContext : new ValueComparer( (a, b) => a.SequenceEqual(b), a => a.Aggregate(0, (c, v) => HashCode.Combine(c, v.GetHashCode())), - a => a.ToArray() // clone + a => a.ToArray() ) ); }); @@ -870,7 +1065,6 @@ public class PlatformDbContext : b.ToTable(PlatformConsts.DbTablePrefix + nameof(About), PlatformConsts.DbSchema); b.ConfigureByConvention(); - // JSON alanlar b.Property(x => x.StatsJson).HasColumnType("nvarchar(max)"); b.Property(x => x.DescriptionsJson).HasColumnType("nvarchar(max)"); b.Property(x => x.SectionsJson).HasColumnType("nvarchar(max)"); @@ -887,13 +1081,11 @@ public class PlatformDbContext : b.Property(x => x.Location).HasMaxLength(150); b.Property(x => x.TaxNumber).HasMaxLength(50); - // JSON alanlar nvarchar(max) olarak b.Property(x => x.BankJson).HasColumnType("nvarchar(max)"); b.Property(x => x.WorkHoursJson).HasColumnType("nvarchar(max)"); b.Property(x => x.MapJson).HasColumnType("nvarchar(max)"); }); - // ClassSession builder.Entity(b => { b.ToTable(PlatformConsts.DbTablePrefix + nameof(Classroom), PlatformConsts.DbSchema); @@ -907,7 +1099,6 @@ public class PlatformDbContext : b.HasIndex(x => x.TeacherId); b.HasIndex(x => x.ScheduledStartTime); - // Relationships b.HasMany(x => x.Participants) .WithOne(x => x.Session) .HasForeignKey(x => x.SessionId) @@ -924,7 +1115,6 @@ public class PlatformDbContext : .OnDelete(DeleteBehavior.Cascade); }); - // Participant builder.Entity(b => { b.ToTable(PlatformConsts.DbTablePrefix + nameof(ClassroomParticipant), PlatformConsts.DbSchema); @@ -940,7 +1130,6 @@ public class PlatformDbContext : b.HasIndex(x => new { x.SessionId, x.UserId }).IsUnique(); }); - // AttendanceRecord builder.Entity(b => { b.ToTable(PlatformConsts.DbTablePrefix + nameof(ClassroomAttandance), PlatformConsts.DbSchema); @@ -953,7 +1142,6 @@ public class PlatformDbContext : b.HasIndex(x => x.JoinTime); }); - // ChatMessage builder.Entity(b => { b.ToTable(PlatformConsts.DbTablePrefix + nameof(ClassroomChat), PlatformConsts.DbSchema); diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251002102738_Initial.Designer.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251002115440_Initial.Designer.cs similarity index 96% rename from api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251002102738_Initial.Designer.cs rename to api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251002115440_Initial.Designer.cs index 19d14d75..1a8259f2 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251002102738_Initial.Designer.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251002115440_Initial.Designer.cs @@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore; namespace Kurs.Platform.Migrations { [DbContext(typeof(PlatformDbContext))] - [Migration("20251002102738_Initial")] + [Migration("20251002115440_Initial")] partial class Initial { /// @@ -709,7 +709,9 @@ namespace Kurs.Platform.Migrations .HasColumnType("uniqueidentifier"); b.Property("BotName") - .HasColumnType("nvarchar(max)"); + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.HasKey("Id"); @@ -817,7 +819,8 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(100)"); b.Property("ErrorMessage") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); b.Property("FileName") .IsRequired() @@ -891,7 +894,9 @@ namespace Kurs.Platform.Migrations .HasColumnName("DeletionTime"); b.Property("IsActive") - .HasColumnType("bit"); + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); b.Property("IsDeleted") .ValueGeneratedOnAdd() @@ -1100,7 +1105,8 @@ namespace Kurs.Platform.Migrations .HasColumnType("int"); b.Property("Icon") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("IsActive") .HasColumnType("bit"); @@ -1209,7 +1215,8 @@ namespace Kurs.Platform.Migrations .HasColumnType("datetime2"); b.Property("ReadTime") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); b.Property("Slug") .IsRequired() @@ -1252,19 +1259,25 @@ namespace Kurs.Platform.Migrations .HasColumnType("uniqueidentifier"); b.Property("Address") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); b.Property("Address2") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); b.Property("City") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("Code") - .HasColumnType("nvarchar(max)"); + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); b.Property("Country") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("CreationTime") .HasColumnType("datetime2") @@ -1283,16 +1296,21 @@ namespace Kurs.Platform.Migrations .HasColumnName("DeletionTime"); b.Property("District") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("Email") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("Fax") + .HasMaxLength(20) .HasColumnType("bigint"); b.Property("IsActive") - .HasColumnType("bit"); + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); b.Property("IsDeleted") .ValueGeneratedOnAdd() @@ -1309,22 +1327,29 @@ namespace Kurs.Platform.Migrations .HasColumnName("LastModifierId"); b.Property("Mobile") + .HasMaxLength(20) .HasColumnType("bigint"); b.Property("Name") - .HasColumnType("nvarchar(max)"); + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("Phone") + .HasMaxLength(20) .HasColumnType("bigint"); b.Property("PostalCode") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(16) + .HasColumnType("nvarchar(16)"); b.Property("Street") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.Property("TaxOffice") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("TenantId") .HasColumnType("uniqueidentifier"); @@ -1333,7 +1358,8 @@ namespace Kurs.Platform.Migrations .HasColumnType("bigint"); b.Property("Website") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.HasKey("Id"); @@ -1967,7 +1993,9 @@ namespace Kurs.Platform.Migrations .HasColumnName("DeletionTime"); b.Property("IsActive") - .HasColumnType("bit"); + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); b.Property("IsDeleted") .ValueGeneratedOnAdd() @@ -1992,6 +2020,7 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(128)"); b.Property("Rate") + .HasPrecision(18, 6) .HasColumnType("decimal(18,6)"); b.Property("Symbol") @@ -2029,7 +2058,8 @@ namespace Kurs.Platform.Migrations .HasColumnName("DeletionTime"); b.Property("Dependencies") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); b.Property("Description") .HasMaxLength(500) @@ -2084,7 +2114,9 @@ namespace Kurs.Platform.Migrations .HasColumnName("CreatorId"); b.Property("DataSourceCode") - .HasColumnType("nvarchar(max)"); + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); b.Property("DeleterId") .HasColumnType("uniqueidentifier") @@ -2095,7 +2127,8 @@ namespace Kurs.Platform.Migrations .HasColumnName("DeletionTime"); b.Property("Description") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); b.Property("IsDeleted") .ValueGeneratedOnAdd() @@ -2112,10 +2145,14 @@ namespace Kurs.Platform.Migrations .HasColumnName("LastModifierId"); b.Property("Method") - .HasColumnType("nvarchar(max)"); + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); b.Property("Name") - .HasColumnType("nvarchar(max)"); + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("ParametersJson") .HasColumnType("nvarchar(max)"); @@ -2124,6 +2161,7 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(max)"); b.Property("Sql") + .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("TenantId") @@ -2131,7 +2169,9 @@ namespace Kurs.Platform.Migrations .HasColumnName("TenantId"); b.Property("Url") - .HasColumnType("nvarchar(max)"); + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.HasKey("Id"); @@ -2237,7 +2277,8 @@ namespace Kurs.Platform.Migrations .HasColumnName("CreatorId"); b.Property("DefaultValue") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.Property("DeleterId") .HasColumnType("uniqueidentifier") @@ -2305,8 +2346,8 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(100)"); b.Property("ConnectionString") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.Property("CreationTime") .HasColumnType("datetime2") @@ -2437,6 +2478,7 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(16)"); b.Property("CountryCode") + .HasMaxLength(8) .HasColumnType("nvarchar(8)"); b.Property("CreationTime") @@ -2516,13 +2558,17 @@ namespace Kurs.Platform.Migrations .HasColumnName("TenantId"); b.Property("Term") - .HasColumnType("nvarchar(max)"); + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.Property("Url") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); b.Property("Weight") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); b.HasKey("Id"); @@ -2659,7 +2705,8 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(max)"); b.Property("CultureName") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); b.Property("CustomJsSourcesJson") .HasColumnType("nvarchar(max)"); @@ -2668,7 +2715,8 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(max)"); b.Property("DataSourceCode") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); b.Property("DataSourceJson") .HasColumnType("nvarchar(max)"); @@ -2683,7 +2731,8 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(max)"); b.Property("DeleteServiceAddress") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.Property("DeleterId") .HasColumnType("uniqueidentifier") @@ -2694,7 +2743,8 @@ namespace Kurs.Platform.Migrations .HasColumnName("DeletionTime"); b.Property("Description") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); b.Property("EditingFormJson") .HasColumnType("nvarchar(max)"); @@ -2733,7 +2783,8 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(max)"); b.Property("InsertServiceAddress") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.Property("IsBranch") .HasColumnType("bit"); @@ -2776,21 +2827,24 @@ namespace Kurs.Platform.Migrations b.Property("ListFormCode") .IsRequired() - .HasColumnType("nvarchar(450)"); + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); b.Property("ListFormType") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); b.Property("MarginJson") .HasColumnType("nvarchar(max)"); b.Property("Name") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("PageSize") .ValueGeneratedOnAdd() .HasColumnType("int") - .HasDefaultValue(10); + .HasDefaultValue(20); b.Property("PagerOptionJson") .HasColumnType("nvarchar(max)"); @@ -2805,7 +2859,8 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(max)"); b.Property("RoleId") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.Property("ScrollBarJson") .HasColumnType("nvarchar(max)"); @@ -2832,7 +2887,8 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(max)"); b.Property("SortMode") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); b.Property("StateStoringJson") .HasColumnType("nvarchar(max)"); @@ -2841,10 +2897,12 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(max)"); b.Property("TableName") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("Title") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.Property("TitleJson") .HasColumnType("nvarchar(max)"); @@ -2859,10 +2917,12 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(max)"); b.Property("UpdateServiceAddress") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.Property("UserId") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.Property("ValueAxisJson") .HasColumnType("nvarchar(max)"); @@ -2909,7 +2969,8 @@ namespace Kurs.Platform.Migrations .HasColumnName("DeletionTime"); b.Property("FilterName") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("IsDeleted") .ValueGeneratedOnAdd() @@ -2927,13 +2988,16 @@ namespace Kurs.Platform.Migrations b.Property("ListFormCode") .IsRequired() - .HasColumnType("nvarchar(450)"); + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); b.Property("RoleId") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.Property("UserId") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.HasKey("Id"); @@ -2948,7 +3012,10 @@ namespace Kurs.Platform.Migrations .HasColumnType("uniqueidentifier"); b.Property("Alignment") - .HasColumnType("nvarchar(max)"); + .ValueGeneratedOnAdd() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasDefaultValue("left"); b.Property("AllowSearch") .ValueGeneratedOnAdd() @@ -2956,16 +3023,20 @@ namespace Kurs.Platform.Migrations .HasDefaultValue(false); b.Property("BandName") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("CaptionName") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); b.Property("ColumnCssClass") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); b.Property("ColumnCssValue") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.Property("ColumnCustomizationJson") .HasColumnType("nvarchar(max)"); @@ -2988,7 +3059,8 @@ namespace Kurs.Platform.Migrations .HasColumnName("CreatorId"); b.Property("CultureName") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); b.Property("DeleterId") .HasColumnType("uniqueidentifier") @@ -3005,11 +3077,13 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(max)"); b.Property("FieldName") + .IsRequired() .HasMaxLength(100) .HasColumnType("nvarchar(100)"); b.Property("Format") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); b.Property("GroupSummaryJson") .HasColumnType("nvarchar(max)"); @@ -3041,7 +3115,8 @@ namespace Kurs.Platform.Migrations b.Property("ListFormCode") .IsRequired() - .HasColumnType("nvarchar(450)"); + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); b.Property("ListOrderNo") .ValueGeneratedOnAdd() @@ -3058,24 +3133,25 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(max)"); b.Property("RoleId") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.Property("SortDirection") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); b.Property("SortIndex") .HasColumnType("int"); b.Property("SourceDbType") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(16); + .HasColumnType("int"); b.Property("TotalSummaryJson") .HasColumnType("nvarchar(max)"); b.Property("UserId") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.Property("ValidationRuleJson") .HasColumnType("nvarchar(max)"); @@ -3185,7 +3261,7 @@ namespace Kurs.Platform.Migrations .HasColumnType("int"); b.Property("ErrorsJson") - .HasColumnType("text"); + .HasColumnType("nvarchar(max)"); b.Property("ExecRows") .HasColumnType("int"); @@ -3242,8 +3318,8 @@ namespace Kurs.Platform.Migrations .HasColumnName("CreatorId"); b.Property("CssClass") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("CultureName") .HasMaxLength(50) @@ -3307,8 +3383,8 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(50)"); b.Property("Url") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); b.Property("UserId") .HasMaxLength(256) @@ -3325,20 +3401,24 @@ namespace Kurs.Platform.Migrations .HasColumnType("uniqueidentifier"); b.Property("Address") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); b.Property("Address2") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); b.Property("City") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("Commission") .HasPrecision(18, 2) .HasColumnType("decimal(18,2)"); b.Property("Country") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("CreationTime") .HasColumnType("datetime2") @@ -3357,16 +3437,19 @@ namespace Kurs.Platform.Migrations .HasColumnName("DeletionTime"); b.Property("District") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("Email") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("Fax") .HasColumnType("bigint"); b.Property("Founder") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("InstallmentName") .HasMaxLength(128) @@ -3393,7 +3476,8 @@ namespace Kurs.Platform.Migrations .HasColumnType("bigint"); b.Property("OrganizationName") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("PaymentDataJson") .HasMaxLength(4000) @@ -3408,14 +3492,16 @@ namespace Kurs.Platform.Migrations .HasColumnType("bigint"); b.Property("PostalCode") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(16) + .HasColumnType("nvarchar(16)"); b.Property("Subtotal") .HasPrecision(18, 2) .HasColumnType("decimal(18,2)"); b.Property("TaxOffice") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("TenantId") .HasColumnType("uniqueidentifier") @@ -3429,7 +3515,8 @@ namespace Kurs.Platform.Migrations .HasColumnType("bigint"); b.Property("Website") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.HasKey("Id"); @@ -3899,7 +3986,8 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(256)"); b.Property("RouteType") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); b.HasKey("Id"); @@ -4093,7 +4181,9 @@ namespace Kurs.Platform.Migrations .HasColumnName("DeletionTime"); b.Property("IsDefault") - .HasColumnType("bit"); + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); b.Property("IsDeleted") .ValueGeneratedOnAdd() @@ -4115,7 +4205,9 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(128)"); b.Property("Progress") - .HasColumnType("int"); + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); b.Property("SkillTypeId") .HasColumnType("uniqueidentifier"); @@ -4362,7 +4454,9 @@ namespace Kurs.Platform.Migrations .HasColumnType("int"); b.Property("Slug") - .HasColumnType("nvarchar(max)"); + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("TenantId") .HasColumnType("uniqueidentifier"); @@ -4386,7 +4480,8 @@ namespace Kurs.Platform.Migrations .HasColumnType("uniqueidentifier"); b.Property("AuthorName") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("Content") .IsRequired() @@ -4455,7 +4550,8 @@ namespace Kurs.Platform.Migrations .HasColumnType("uniqueidentifier"); b.Property("AuthorName") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("CategoryId") .HasColumnType("uniqueidentifier"); @@ -4513,7 +4609,8 @@ namespace Kurs.Platform.Migrations .HasColumnType("uniqueidentifier"); b.Property("LastPostUserName") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("LikeCount") .HasColumnType("int"); @@ -6478,7 +6575,9 @@ namespace Kurs.Platform.Migrations { b.HasOne("Kurs.Platform.Entities.CustomEntity", "Entity") .WithMany() - .HasForeignKey("EntityId"); + .HasForeignKey("EntityId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); b.Navigation("Entity"); }); @@ -6493,7 +6592,8 @@ namespace Kurs.Platform.Migrations b.HasOne("Kurs.Platform.Entities.Currency", "Currency") .WithMany() - .HasForeignKey("CurrencyId"); + .HasForeignKey("CurrencyId") + .OnDelete(DeleteBehavior.Restrict); b.Navigation("Bank"); @@ -6612,7 +6712,8 @@ namespace Kurs.Platform.Migrations b.HasOne("Kurs.Platform.Entities.Order", "Order") .WithMany("Items") .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade); + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); b.Navigation("Order"); }); diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251002102738_Initial.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251002115440_Initial.cs similarity index 97% rename from api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251002102738_Initial.cs rename to api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251002115440_Initial.cs index 93c815df..ea87fbb5 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251002102738_Initial.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/20251002115440_Initial.cs @@ -522,7 +522,7 @@ namespace Kurs.Platform.Migrations columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), - BotName = table.Column(type: "nvarchar(max)", nullable: true) + BotName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false) }, constraints: table => { @@ -537,7 +537,7 @@ namespace Kurs.Platform.Migrations Name = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), Cron = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), WorkerType = table.Column(type: "int", nullable: false), - IsActive = table.Column(type: "bit", nullable: false), + IsActive = table.Column(type: "bit", nullable: false, defaultValue: true), DataSourceCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), BeforeSp = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), AfterSp = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), @@ -670,7 +670,7 @@ namespace Kurs.Platform.Migrations Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), Slug = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), Description = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true), - Icon = table.Column(type: "nvarchar(max)", nullable: true), + Icon = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), DisplayOrder = table.Column(type: "int", nullable: false), IsActive = table.Column(type: "bit", nullable: false), PostCount = table.Column(type: "int", nullable: true), @@ -693,23 +693,23 @@ namespace Kurs.Platform.Migrations { Id = table.Column(type: "uniqueidentifier", nullable: false), TenantId = table.Column(type: "uniqueidentifier", nullable: false), - Code = table.Column(type: "nvarchar(max)", nullable: true), - Name = table.Column(type: "nvarchar(max)", nullable: true), + Code = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), VknTckn = table.Column(type: "bigint", nullable: false), - TaxOffice = table.Column(type: "nvarchar(max)", nullable: true), - Country = table.Column(type: "nvarchar(max)", nullable: true), - City = table.Column(type: "nvarchar(max)", nullable: true), - District = table.Column(type: "nvarchar(max)", nullable: true), - Street = table.Column(type: "nvarchar(max)", nullable: true), - Address = table.Column(type: "nvarchar(max)", nullable: true), - Address2 = table.Column(type: "nvarchar(max)", nullable: true), - PostalCode = table.Column(type: "nvarchar(max)", nullable: true), - Phone = table.Column(type: "bigint", nullable: true), - Mobile = table.Column(type: "bigint", nullable: false), - Fax = table.Column(type: "bigint", nullable: true), - Email = table.Column(type: "nvarchar(max)", nullable: true), - Website = table.Column(type: "nvarchar(max)", nullable: true), - IsActive = table.Column(type: "bit", nullable: true), + TaxOffice = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + Country = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + City = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + District = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + Street = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + Address = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true), + Address2 = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true), + PostalCode = table.Column(type: "nvarchar(16)", maxLength: 16, nullable: true), + Phone = table.Column(type: "bigint", maxLength: 20, nullable: true), + Mobile = table.Column(type: "bigint", maxLength: 20, nullable: false), + Fax = table.Column(type: "bigint", maxLength: 20, nullable: true), + Email = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + Website = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + IsActive = table.Column(type: "bit", nullable: true, defaultValue: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), @@ -863,8 +863,8 @@ namespace Kurs.Platform.Migrations Code = table.Column(type: "nvarchar(8)", maxLength: 8, nullable: false), Symbol = table.Column(type: "nvarchar(8)", maxLength: 8, nullable: true), Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), - Rate = table.Column(type: "decimal(18,6)", nullable: false), - IsActive = table.Column(type: "bit", nullable: false), + Rate = table.Column(type: "decimal(18,6)", precision: 18, scale: 6, nullable: false), + IsActive = table.Column(type: "bit", nullable: false, defaultValue: true), LastUpdated = table.Column(type: "datetime2", nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), @@ -890,7 +890,7 @@ namespace Kurs.Platform.Migrations Props = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), Description = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), IsActive = table.Column(type: "bit", nullable: false), - Dependencies = table.Column(type: "nvarchar(max)", nullable: true), + Dependencies = table.Column(type: "nvarchar(2000)", maxLength: 2000, nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), @@ -910,12 +910,12 @@ namespace Kurs.Platform.Migrations { Id = table.Column(type: "uniqueidentifier", nullable: false), TenantId = table.Column(type: "uniqueidentifier", nullable: true), - Name = table.Column(type: "nvarchar(max)", nullable: true), - Description = table.Column(type: "nvarchar(max)", nullable: true), - Url = table.Column(type: "nvarchar(max)", nullable: true), - Method = table.Column(type: "nvarchar(max)", nullable: true), - DataSourceCode = table.Column(type: "nvarchar(max)", nullable: true), - Sql = table.Column(type: "nvarchar(max)", nullable: true), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), + Description = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true), + Url = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + Method = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: false), + DataSourceCode = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + Sql = table.Column(type: "nvarchar(max)", nullable: false), ParametersJson = table.Column(type: "nvarchar(max)", nullable: true), PermissionsJson = table.Column(type: "nvarchar(max)", nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), @@ -967,7 +967,7 @@ namespace Kurs.Platform.Migrations Id = table.Column(type: "uniqueidentifier", nullable: false), Code = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), DataSourceType = table.Column(type: "int", nullable: false), - ConnectionString = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), + ConnectionString = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), @@ -1014,7 +1014,7 @@ namespace Kurs.Platform.Migrations { Id = table.Column(type: "uniqueidentifier", nullable: false), Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), - Slug = table.Column(type: "nvarchar(max)", nullable: true), + Slug = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), Description = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true), Icon = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), DisplayOrder = table.Column(type: "int", nullable: false), @@ -1049,9 +1049,9 @@ namespace Kurs.Platform.Migrations TenantId = table.Column(type: "uniqueidentifier", nullable: true), System = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), Group = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), - Term = table.Column(type: "nvarchar(max)", nullable: true), - Weight = table.Column(type: "nvarchar(max)", nullable: true), - Url = table.Column(type: "nvarchar(max)", nullable: true) + Term = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), + Weight = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + Url = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true) }, constraints: table => { @@ -1142,20 +1142,20 @@ namespace Kurs.Platform.Migrations columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), - ListFormCode = table.Column(type: "nvarchar(450)", nullable: false), - CultureName = table.Column(type: "nvarchar(max)", nullable: true), - DataSourceCode = table.Column(type: "nvarchar(max)", nullable: true), + ListFormCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + CultureName = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: true), + DataSourceCode = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), SelectCommandType = table.Column(type: "int", nullable: false), - TableName = table.Column(type: "nvarchar(max)", nullable: true), + TableName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), SelectCommand = table.Column(type: "nvarchar(max)", nullable: true), KeyFieldName = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), KeyFieldDbSourceType = table.Column(type: "int", nullable: false), SelectFieldsDefaultValueJson = table.Column(type: "nvarchar(max)", nullable: true), - Name = table.Column(type: "nvarchar(max)", nullable: true), - Description = table.Column(type: "nvarchar(max)", nullable: true), - Title = table.Column(type: "nvarchar(max)", nullable: true), - SortMode = table.Column(type: "nvarchar(max)", nullable: true), - PageSize = table.Column(type: "int", nullable: false, defaultValue: 10), + Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + Description = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true), + Title = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + SortMode = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true), + PageSize = table.Column(type: "int", nullable: false, defaultValue: 20), Width = table.Column(type: "int", nullable: true), Height = table.Column(type: "int", nullable: true), DefaultFilter = table.Column(type: "nvarchar(max)", nullable: true), @@ -1179,23 +1179,23 @@ namespace Kurs.Platform.Migrations DeleteCommand = table.Column(type: "nvarchar(max)", nullable: true), UpdateCommand = table.Column(type: "nvarchar(max)", nullable: true), InsertCommand = table.Column(type: "nvarchar(max)", nullable: true), - UpdateServiceAddress = table.Column(type: "nvarchar(max)", nullable: true), - InsertServiceAddress = table.Column(type: "nvarchar(max)", nullable: true), - DeleteServiceAddress = table.Column(type: "nvarchar(max)", nullable: true), + UpdateServiceAddress = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + InsertServiceAddress = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + DeleteServiceAddress = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), CustomJsSourcesJson = table.Column(type: "nvarchar(max)", nullable: true), CustomStyleSourcesJson = table.Column(type: "nvarchar(max)", nullable: true), FormFieldsDefaultValueJson = table.Column(type: "nvarchar(max)", nullable: true), IsTenant = table.Column(type: "bit", nullable: false), IsBranch = table.Column(type: "bit", nullable: false), IsOrganizationUnit = table.Column(type: "bit", nullable: false), - ListFormType = table.Column(type: "nvarchar(max)", nullable: true), + ListFormType = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true), IsSubForm = table.Column(type: "bit", nullable: false), SubFormsJson = table.Column(type: "nvarchar(max)", nullable: true), WidgetsJson = table.Column(type: "nvarchar(max)", nullable: true), ExtraFilterJson = table.Column(type: "nvarchar(max)", nullable: true), LayoutJson = table.Column(type: "nvarchar(max)", nullable: true), - UserId = table.Column(type: "nvarchar(max)", nullable: true), - RoleId = table.Column(type: "nvarchar(max)", nullable: true), + UserId = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + RoleId = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), CommonJson = table.Column(type: "nvarchar(max)", nullable: true), DataSourceJson = table.Column(type: "nvarchar(max)", nullable: true), AdaptiveLayoutJson = table.Column(type: "nvarchar(max)", nullable: true), @@ -1266,7 +1266,7 @@ namespace Kurs.Platform.Migrations ValidRows = table.Column(type: "int", nullable: false), ErrorRows = table.Column(type: "int", nullable: false), Progress = table.Column(type: "float", nullable: false), - ErrorsJson = table.Column(type: "text", nullable: true), + ErrorsJson = table.Column(type: "nvarchar(max)", nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), @@ -1288,10 +1288,10 @@ namespace Kurs.Platform.Migrations Code = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), DisplayName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), Order = table.Column(type: "int", nullable: false), - Url = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), + Url = table.Column(type: "nvarchar(250)", maxLength: 250, nullable: true), Icon = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), ParentCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), - CssClass = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), + CssClass = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), RequiredPermissionName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), Target = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), IsDisabled = table.Column(type: "bit", nullable: false), @@ -1370,21 +1370,21 @@ namespace Kurs.Platform.Migrations { Id = table.Column(type: "uniqueidentifier", nullable: false), TenantId = table.Column(type: "uniqueidentifier", nullable: true), - OrganizationName = table.Column(type: "nvarchar(max)", nullable: true), - Founder = table.Column(type: "nvarchar(max)", nullable: true), + OrganizationName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + Founder = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), VknTckn = table.Column(type: "bigint", nullable: false), - TaxOffice = table.Column(type: "nvarchar(max)", nullable: true), - Address = table.Column(type: "nvarchar(max)", nullable: true), - Address2 = table.Column(type: "nvarchar(max)", nullable: true), - District = table.Column(type: "nvarchar(max)", nullable: true), - Country = table.Column(type: "nvarchar(max)", nullable: true), - City = table.Column(type: "nvarchar(max)", nullable: true), - PostalCode = table.Column(type: "nvarchar(max)", nullable: true), + TaxOffice = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + Address = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true), + Address2 = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true), + District = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + Country = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + City = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + PostalCode = table.Column(type: "nvarchar(16)", maxLength: 16, nullable: true), Phone = table.Column(type: "bigint", nullable: false), Mobile = table.Column(type: "bigint", nullable: false), Fax = table.Column(type: "bigint", nullable: false), - Email = table.Column(type: "nvarchar(max)", nullable: true), - Website = table.Column(type: "nvarchar(max)", nullable: true), + Email = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), + Website = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), Subtotal = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false), Commission = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false), Total = table.Column(type: "decimal(18,2)", precision: 18, scale: 2, nullable: false), @@ -1475,7 +1475,7 @@ namespace Kurs.Platform.Migrations Key = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), Path = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), ComponentPath = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), - RouteType = table.Column(type: "nvarchar(max)", nullable: true), + RouteType = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), Authority = table.Column(type: "nvarchar(max)", nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), @@ -1873,7 +1873,7 @@ namespace Kurs.Platform.Migrations ContentEn = table.Column(type: "nvarchar(max)", nullable: false), Summary = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: false), CoverImage = table.Column(type: "nvarchar(512)", maxLength: 512, nullable: true), - ReadTime = table.Column(type: "nvarchar(max)", nullable: true), + ReadTime = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), CategoryId = table.Column(type: "uniqueidentifier", nullable: false), AuthorId = table.Column(type: "uniqueidentifier", nullable: false), ViewCount = table.Column(type: "int", nullable: true), @@ -2063,7 +2063,8 @@ namespace Kurs.Platform.Migrations name: "FK_PBankAccount_PCurrency_CurrencyId", column: x => x.CurrencyId, principalTable: "PCurrency", - principalColumn: "Id"); + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( @@ -2110,7 +2111,7 @@ namespace Kurs.Platform.Migrations SqlScript = table.Column(type: "nvarchar(max)", nullable: false), Status = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), AppliedAt = table.Column(type: "datetime2", nullable: true), - ErrorMessage = table.Column(type: "nvarchar(max)", nullable: true), + ErrorMessage = table.Column(type: "nvarchar(1000)", maxLength: 1000, nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), LastModificationTime = table.Column(type: "datetime2", nullable: true), @@ -2123,7 +2124,8 @@ namespace Kurs.Platform.Migrations name: "FK_PApiMigration_PCustomEntity_EntityId", column: x => x.EntityId, principalTable: "PCustomEntity", - principalColumn: "Id"); + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( @@ -2137,7 +2139,7 @@ namespace Kurs.Platform.Migrations IsRequired = table.Column(type: "bit", nullable: false), MaxLength = table.Column(type: "int", nullable: true), IsUnique = table.Column(type: "bit", nullable: false), - DefaultValue = table.Column(type: "nvarchar(max)", nullable: true), + DefaultValue = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), Description = table.Column(type: "nvarchar(500)", maxLength: 500, nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), @@ -2167,7 +2169,7 @@ namespace Kurs.Platform.Migrations Content = table.Column(type: "nvarchar(max)", nullable: false), CategoryId = table.Column(type: "uniqueidentifier", nullable: false), AuthorId = table.Column(type: "uniqueidentifier", nullable: false), - AuthorName = table.Column(type: "nvarchar(max)", nullable: true), + AuthorName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), ViewCount = table.Column(type: "int", nullable: false), ReplyCount = table.Column(type: "int", nullable: false), LikeCount = table.Column(type: "int", nullable: false), @@ -2177,7 +2179,7 @@ namespace Kurs.Platform.Migrations LastPostId = table.Column(type: "uniqueidentifier", nullable: true), LastPostDate = table.Column(type: "datetime2", nullable: true), LastPostUserId = table.Column(type: "uniqueidentifier", nullable: true), - LastPostUserName = table.Column(type: "nvarchar(max)", nullable: true), + LastPostUserName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), TenantId = table.Column(type: "uniqueidentifier", nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), @@ -2231,10 +2233,10 @@ namespace Kurs.Platform.Migrations columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), - ListFormCode = table.Column(type: "nvarchar(450)", nullable: false), - UserId = table.Column(type: "nvarchar(max)", nullable: true), - RoleId = table.Column(type: "nvarchar(max)", nullable: true), - FilterName = table.Column(type: "nvarchar(max)", nullable: true), + ListFormCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + UserId = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + RoleId = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + FilterName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), CustomizationData = table.Column(type: "nvarchar(max)", nullable: true), CustomizationType = table.Column(type: "int", nullable: false), CreationTime = table.Column(type: "datetime2", nullable: false), @@ -2261,29 +2263,29 @@ namespace Kurs.Platform.Migrations columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), - ListFormCode = table.Column(type: "nvarchar(450)", nullable: false), - UserId = table.Column(type: "nvarchar(max)", nullable: true), - RoleId = table.Column(type: "nvarchar(max)", nullable: true), - CultureName = table.Column(type: "nvarchar(max)", nullable: true), - FieldName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), - CaptionName = table.Column(type: "nvarchar(max)", nullable: true), + ListFormCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + UserId = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + RoleId = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), + CultureName = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: true), + FieldName = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: false), + CaptionName = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), Visible = table.Column(type: "bit", nullable: true, defaultValue: true), IsActive = table.Column(type: "bit", nullable: true, defaultValue: true), Width = table.Column(type: "int", nullable: true, defaultValue: 100), ListOrderNo = table.Column(type: "int", nullable: true, defaultValue: 30), - SourceDbType = table.Column(type: "int", nullable: false, defaultValue: 16), + SourceDbType = table.Column(type: "int", nullable: false), SortIndex = table.Column(type: "int", nullable: true), - SortDirection = table.Column(type: "nvarchar(max)", nullable: true), + SortDirection = table.Column(type: "nvarchar(10)", maxLength: 10, nullable: true), AllowSearch = table.Column(type: "bit", nullable: true, defaultValue: false), - BandName = table.Column(type: "nvarchar(max)", nullable: true), + BandName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), ColumnFilterJson = table.Column(type: "nvarchar(max)", nullable: true), ColumnHeaderJson = table.Column(type: "nvarchar(max)", nullable: true), GroupingJson = table.Column(type: "nvarchar(max)", nullable: true), ColumnCustomizationJson = table.Column(type: "nvarchar(max)", nullable: true), TotalSummaryJson = table.Column(type: "nvarchar(max)", nullable: true), GroupSummaryJson = table.Column(type: "nvarchar(max)", nullable: true), - ColumnCssClass = table.Column(type: "nvarchar(max)", nullable: true), - ColumnCssValue = table.Column(type: "nvarchar(max)", nullable: true), + ColumnCssClass = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), + ColumnCssValue = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: true), JoinTableJson = table.Column(type: "nvarchar(max)", nullable: true), EditingJson = table.Column(type: "nvarchar(max)", nullable: true), LookupJson = table.Column(type: "nvarchar(max)", nullable: true), @@ -2291,8 +2293,8 @@ namespace Kurs.Platform.Migrations ColumnStylingJson = table.Column(type: "nvarchar(max)", nullable: true), PermissionJson = table.Column(type: "nvarchar(max)", nullable: true), PivotSettingsJson = table.Column(type: "nvarchar(max)", nullable: true), - Alignment = table.Column(type: "nvarchar(max)", nullable: true), - Format = table.Column(type: "nvarchar(max)", nullable: true), + Alignment = table.Column(type: "nvarchar(20)", maxLength: 20, nullable: true, defaultValue: "left"), + Format = table.Column(type: "nvarchar(100)", maxLength: 100, nullable: true), EditorOptions = table.Column(type: "nvarchar(max)", nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), @@ -2404,8 +2406,8 @@ namespace Kurs.Platform.Migrations { Id = table.Column(type: "uniqueidentifier", nullable: false), Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), - Progress = table.Column(type: "int", nullable: false), - IsDefault = table.Column(type: "bit", nullable: false), + Progress = table.Column(type: "int", nullable: false, defaultValue: 0), + IsDefault = table.Column(type: "bit", nullable: false, defaultValue: false), SkillTypeId = table.Column(type: "uniqueidentifier", nullable: false), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), @@ -2550,7 +2552,7 @@ namespace Kurs.Platform.Migrations TopicId = table.Column(type: "uniqueidentifier", nullable: false), Content = table.Column(type: "nvarchar(max)", nullable: false), AuthorId = table.Column(type: "uniqueidentifier", nullable: false), - AuthorName = table.Column(type: "nvarchar(max)", nullable: true), + AuthorName = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), LikeCount = table.Column(type: "int", nullable: true), IsAcceptedAnswer = table.Column(type: "bit", nullable: true), ParentPostId = table.Column(type: "uniqueidentifier", nullable: true), @@ -2645,7 +2647,7 @@ namespace Kurs.Platform.Migrations columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), - CountryCode = table.Column(type: "nvarchar(8)", nullable: true), + CountryCode = table.Column(type: "nvarchar(8)", maxLength: 8, nullable: true), CityCode = table.Column(type: "nvarchar(16)", maxLength: 16, nullable: false), Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), Township = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: true), diff --git a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs index 9d416848..7320e2e9 100644 --- a/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs +++ b/api/src/Kurs.Platform.EntityFrameworkCore/Migrations/PlatformDbContextModelSnapshot.cs @@ -706,7 +706,9 @@ namespace Kurs.Platform.Migrations .HasColumnType("uniqueidentifier"); b.Property("BotName") - .HasColumnType("nvarchar(max)"); + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.HasKey("Id"); @@ -814,7 +816,8 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(100)"); b.Property("ErrorMessage") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(1000) + .HasColumnType("nvarchar(1000)"); b.Property("FileName") .IsRequired() @@ -888,7 +891,9 @@ namespace Kurs.Platform.Migrations .HasColumnName("DeletionTime"); b.Property("IsActive") - .HasColumnType("bit"); + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); b.Property("IsDeleted") .ValueGeneratedOnAdd() @@ -1097,7 +1102,8 @@ namespace Kurs.Platform.Migrations .HasColumnType("int"); b.Property("Icon") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("IsActive") .HasColumnType("bit"); @@ -1206,7 +1212,8 @@ namespace Kurs.Platform.Migrations .HasColumnType("datetime2"); b.Property("ReadTime") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); b.Property("Slug") .IsRequired() @@ -1249,19 +1256,25 @@ namespace Kurs.Platform.Migrations .HasColumnType("uniqueidentifier"); b.Property("Address") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); b.Property("Address2") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); b.Property("City") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("Code") - .HasColumnType("nvarchar(max)"); + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); b.Property("Country") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("CreationTime") .HasColumnType("datetime2") @@ -1280,16 +1293,21 @@ namespace Kurs.Platform.Migrations .HasColumnName("DeletionTime"); b.Property("District") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("Email") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("Fax") + .HasMaxLength(20) .HasColumnType("bigint"); b.Property("IsActive") - .HasColumnType("bit"); + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); b.Property("IsDeleted") .ValueGeneratedOnAdd() @@ -1306,22 +1324,29 @@ namespace Kurs.Platform.Migrations .HasColumnName("LastModifierId"); b.Property("Mobile") + .HasMaxLength(20) .HasColumnType("bigint"); b.Property("Name") - .HasColumnType("nvarchar(max)"); + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("Phone") + .HasMaxLength(20) .HasColumnType("bigint"); b.Property("PostalCode") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(16) + .HasColumnType("nvarchar(16)"); b.Property("Street") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.Property("TaxOffice") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("TenantId") .HasColumnType("uniqueidentifier"); @@ -1330,7 +1355,8 @@ namespace Kurs.Platform.Migrations .HasColumnType("bigint"); b.Property("Website") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.HasKey("Id"); @@ -1964,7 +1990,9 @@ namespace Kurs.Platform.Migrations .HasColumnName("DeletionTime"); b.Property("IsActive") - .HasColumnType("bit"); + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(true); b.Property("IsDeleted") .ValueGeneratedOnAdd() @@ -1989,6 +2017,7 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(128)"); b.Property("Rate") + .HasPrecision(18, 6) .HasColumnType("decimal(18,6)"); b.Property("Symbol") @@ -2026,7 +2055,8 @@ namespace Kurs.Platform.Migrations .HasColumnName("DeletionTime"); b.Property("Dependencies") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(2000) + .HasColumnType("nvarchar(2000)"); b.Property("Description") .HasMaxLength(500) @@ -2081,7 +2111,9 @@ namespace Kurs.Platform.Migrations .HasColumnName("CreatorId"); b.Property("DataSourceCode") - .HasColumnType("nvarchar(max)"); + .IsRequired() + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); b.Property("DeleterId") .HasColumnType("uniqueidentifier") @@ -2092,7 +2124,8 @@ namespace Kurs.Platform.Migrations .HasColumnName("DeletionTime"); b.Property("Description") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); b.Property("IsDeleted") .ValueGeneratedOnAdd() @@ -2109,10 +2142,14 @@ namespace Kurs.Platform.Migrations .HasColumnName("LastModifierId"); b.Property("Method") - .HasColumnType("nvarchar(max)"); + .IsRequired() + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); b.Property("Name") - .HasColumnType("nvarchar(max)"); + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("ParametersJson") .HasColumnType("nvarchar(max)"); @@ -2121,6 +2158,7 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(max)"); b.Property("Sql") + .IsRequired() .HasColumnType("nvarchar(max)"); b.Property("TenantId") @@ -2128,7 +2166,9 @@ namespace Kurs.Platform.Migrations .HasColumnName("TenantId"); b.Property("Url") - .HasColumnType("nvarchar(max)"); + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.HasKey("Id"); @@ -2234,7 +2274,8 @@ namespace Kurs.Platform.Migrations .HasColumnName("CreatorId"); b.Property("DefaultValue") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.Property("DeleterId") .HasColumnType("uniqueidentifier") @@ -2302,8 +2343,8 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(100)"); b.Property("ConnectionString") - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.Property("CreationTime") .HasColumnType("datetime2") @@ -2434,6 +2475,7 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(16)"); b.Property("CountryCode") + .HasMaxLength(8) .HasColumnType("nvarchar(8)"); b.Property("CreationTime") @@ -2513,13 +2555,17 @@ namespace Kurs.Platform.Migrations .HasColumnName("TenantId"); b.Property("Term") - .HasColumnType("nvarchar(max)"); + .IsRequired() + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.Property("Url") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); b.Property("Weight") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); b.HasKey("Id"); @@ -2656,7 +2702,8 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(max)"); b.Property("CultureName") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); b.Property("CustomJsSourcesJson") .HasColumnType("nvarchar(max)"); @@ -2665,7 +2712,8 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(max)"); b.Property("DataSourceCode") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); b.Property("DataSourceJson") .HasColumnType("nvarchar(max)"); @@ -2680,7 +2728,8 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(max)"); b.Property("DeleteServiceAddress") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.Property("DeleterId") .HasColumnType("uniqueidentifier") @@ -2691,7 +2740,8 @@ namespace Kurs.Platform.Migrations .HasColumnName("DeletionTime"); b.Property("Description") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); b.Property("EditingFormJson") .HasColumnType("nvarchar(max)"); @@ -2730,7 +2780,8 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(max)"); b.Property("InsertServiceAddress") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.Property("IsBranch") .HasColumnType("bit"); @@ -2773,21 +2824,24 @@ namespace Kurs.Platform.Migrations b.Property("ListFormCode") .IsRequired() - .HasColumnType("nvarchar(450)"); + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); b.Property("ListFormType") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); b.Property("MarginJson") .HasColumnType("nvarchar(max)"); b.Property("Name") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("PageSize") .ValueGeneratedOnAdd() .HasColumnType("int") - .HasDefaultValue(10); + .HasDefaultValue(20); b.Property("PagerOptionJson") .HasColumnType("nvarchar(max)"); @@ -2802,7 +2856,8 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(max)"); b.Property("RoleId") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.Property("ScrollBarJson") .HasColumnType("nvarchar(max)"); @@ -2829,7 +2884,8 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(max)"); b.Property("SortMode") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); b.Property("StateStoringJson") .HasColumnType("nvarchar(max)"); @@ -2838,10 +2894,12 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(max)"); b.Property("TableName") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("Title") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.Property("TitleJson") .HasColumnType("nvarchar(max)"); @@ -2856,10 +2914,12 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(max)"); b.Property("UpdateServiceAddress") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.Property("UserId") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.Property("ValueAxisJson") .HasColumnType("nvarchar(max)"); @@ -2906,7 +2966,8 @@ namespace Kurs.Platform.Migrations .HasColumnName("DeletionTime"); b.Property("FilterName") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("IsDeleted") .ValueGeneratedOnAdd() @@ -2924,13 +2985,16 @@ namespace Kurs.Platform.Migrations b.Property("ListFormCode") .IsRequired() - .HasColumnType("nvarchar(450)"); + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); b.Property("RoleId") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.Property("UserId") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.HasKey("Id"); @@ -2945,7 +3009,10 @@ namespace Kurs.Platform.Migrations .HasColumnType("uniqueidentifier"); b.Property("Alignment") - .HasColumnType("nvarchar(max)"); + .ValueGeneratedOnAdd() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)") + .HasDefaultValue("left"); b.Property("AllowSearch") .ValueGeneratedOnAdd() @@ -2953,16 +3020,20 @@ namespace Kurs.Platform.Migrations .HasDefaultValue(false); b.Property("BandName") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("CaptionName") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); b.Property("ColumnCssClass") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); b.Property("ColumnCssValue") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.Property("ColumnCustomizationJson") .HasColumnType("nvarchar(max)"); @@ -2985,7 +3056,8 @@ namespace Kurs.Platform.Migrations .HasColumnName("CreatorId"); b.Property("CultureName") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); b.Property("DeleterId") .HasColumnType("uniqueidentifier") @@ -3002,11 +3074,13 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(max)"); b.Property("FieldName") + .IsRequired() .HasMaxLength(100) .HasColumnType("nvarchar(100)"); b.Property("Format") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(100) + .HasColumnType("nvarchar(100)"); b.Property("GroupSummaryJson") .HasColumnType("nvarchar(max)"); @@ -3038,7 +3112,8 @@ namespace Kurs.Platform.Migrations b.Property("ListFormCode") .IsRequired() - .HasColumnType("nvarchar(450)"); + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); b.Property("ListOrderNo") .ValueGeneratedOnAdd() @@ -3055,24 +3130,25 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(max)"); b.Property("RoleId") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.Property("SortDirection") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(10) + .HasColumnType("nvarchar(10)"); b.Property("SortIndex") .HasColumnType("int"); b.Property("SourceDbType") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasDefaultValue(16); + .HasColumnType("int"); b.Property("TotalSummaryJson") .HasColumnType("nvarchar(max)"); b.Property("UserId") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(256) + .HasColumnType("nvarchar(256)"); b.Property("ValidationRuleJson") .HasColumnType("nvarchar(max)"); @@ -3182,7 +3258,7 @@ namespace Kurs.Platform.Migrations .HasColumnType("int"); b.Property("ErrorsJson") - .HasColumnType("text"); + .HasColumnType("nvarchar(max)"); b.Property("ExecRows") .HasColumnType("int"); @@ -3239,8 +3315,8 @@ namespace Kurs.Platform.Migrations .HasColumnName("CreatorId"); b.Property("CssClass") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("CultureName") .HasMaxLength(50) @@ -3304,8 +3380,8 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(50)"); b.Property("Url") - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); + .HasMaxLength(250) + .HasColumnType("nvarchar(250)"); b.Property("UserId") .HasMaxLength(256) @@ -3322,20 +3398,24 @@ namespace Kurs.Platform.Migrations .HasColumnType("uniqueidentifier"); b.Property("Address") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); b.Property("Address2") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(512) + .HasColumnType("nvarchar(512)"); b.Property("City") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("Commission") .HasPrecision(18, 2) .HasColumnType("decimal(18,2)"); b.Property("Country") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("CreationTime") .HasColumnType("datetime2") @@ -3354,16 +3434,19 @@ namespace Kurs.Platform.Migrations .HasColumnName("DeletionTime"); b.Property("District") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("Email") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("Fax") .HasColumnType("bigint"); b.Property("Founder") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("InstallmentName") .HasMaxLength(128) @@ -3390,7 +3473,8 @@ namespace Kurs.Platform.Migrations .HasColumnType("bigint"); b.Property("OrganizationName") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("PaymentDataJson") .HasMaxLength(4000) @@ -3405,14 +3489,16 @@ namespace Kurs.Platform.Migrations .HasColumnType("bigint"); b.Property("PostalCode") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(16) + .HasColumnType("nvarchar(16)"); b.Property("Subtotal") .HasPrecision(18, 2) .HasColumnType("decimal(18,2)"); b.Property("TaxOffice") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("TenantId") .HasColumnType("uniqueidentifier") @@ -3426,7 +3512,8 @@ namespace Kurs.Platform.Migrations .HasColumnType("bigint"); b.Property("Website") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.HasKey("Id"); @@ -3896,7 +3983,8 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(256)"); b.Property("RouteType") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); b.HasKey("Id"); @@ -4090,7 +4178,9 @@ namespace Kurs.Platform.Migrations .HasColumnName("DeletionTime"); b.Property("IsDefault") - .HasColumnType("bit"); + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); b.Property("IsDeleted") .ValueGeneratedOnAdd() @@ -4112,7 +4202,9 @@ namespace Kurs.Platform.Migrations .HasColumnType("nvarchar(128)"); b.Property("Progress") - .HasColumnType("int"); + .ValueGeneratedOnAdd() + .HasColumnType("int") + .HasDefaultValue(0); b.Property("SkillTypeId") .HasColumnType("uniqueidentifier"); @@ -4359,7 +4451,9 @@ namespace Kurs.Platform.Migrations .HasColumnType("int"); b.Property("Slug") - .HasColumnType("nvarchar(max)"); + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("TenantId") .HasColumnType("uniqueidentifier"); @@ -4383,7 +4477,8 @@ namespace Kurs.Platform.Migrations .HasColumnType("uniqueidentifier"); b.Property("AuthorName") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("Content") .IsRequired() @@ -4452,7 +4547,8 @@ namespace Kurs.Platform.Migrations .HasColumnType("uniqueidentifier"); b.Property("AuthorName") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("CategoryId") .HasColumnType("uniqueidentifier"); @@ -4510,7 +4606,8 @@ namespace Kurs.Platform.Migrations .HasColumnType("uniqueidentifier"); b.Property("LastPostUserName") - .HasColumnType("nvarchar(max)"); + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); b.Property("LikeCount") .HasColumnType("int"); @@ -6475,7 +6572,9 @@ namespace Kurs.Platform.Migrations { b.HasOne("Kurs.Platform.Entities.CustomEntity", "Entity") .WithMany() - .HasForeignKey("EntityId"); + .HasForeignKey("EntityId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); b.Navigation("Entity"); }); @@ -6490,7 +6589,8 @@ namespace Kurs.Platform.Migrations b.HasOne("Kurs.Platform.Entities.Currency", "Currency") .WithMany() - .HasForeignKey("CurrencyId"); + .HasForeignKey("CurrencyId") + .OnDelete(DeleteBehavior.Restrict); b.Navigation("Bank"); @@ -6609,7 +6709,8 @@ namespace Kurs.Platform.Migrations b.HasOne("Kurs.Platform.Entities.Order", "Order") .WithMany("Items") .HasForeignKey("OrderId") - .OnDelete(DeleteBehavior.Cascade); + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); b.Navigation("Order"); });