Entity ve Seeder düzenlemesi

This commit is contained in:
Sedat ÖZTÜRK 2025-10-03 14:35:52 +03:00
parent b64cdf8b86
commit 2e61c1a7ce
69 changed files with 7399 additions and 6986 deletions

View file

@ -14,9 +14,12 @@ public class LanguagesApplicationAutoMapperProfile : Profile
CreateMap<LanguageKey, LanguageKeyDto>();
CreateMap<LanguageText, LanguageTextDto>();
CreateMap<LanguageText, LanguageTextEto>();
CreateMap<LanguageTextCreateUpdateDto, LanguageText>()
.IgnoreAllPropertiesWithAnInaccessibleSetter()
.IgnoreFullAuditedObjectProperties();
.IgnoreFullAuditedObjectProperties()
.ForMember(dest => dest.LanguageKey, opt => opt.Ignore());
CreateMap<LanguageKey, LanguageTextTranslatedDto>()
.ForMember(d => d.Key, o => o.MapFrom(s => s.Key))
.ForMember(d => d.ResourceName, o => o.MapFrom(s => s.ResourceName))

View file

@ -9,6 +9,6 @@ public class LanguageKey : FullAuditedEntity<Guid>
public string Key { get; set; }
public string ResourceName { get; set; }
public ICollection<LanguageText> Texts { get; set; }
public virtual ICollection<LanguageText> Texts { get; set; } = [];
}

View file

@ -7,7 +7,8 @@ public class LanguageText : FullAuditedEntity<Guid>
{
public string CultureName { get; set; }
public string? Key { get; set; }
public string Value { get; set; }
public string? ResourceName { get; set; }
public string Value { get; set; }
public virtual LanguageKey LanguageKey { get; set; }
}

View file

@ -20,6 +20,13 @@ public static class LanguagesDbContextModelCreatingExtensions
b.Property(a => a.CultureName).HasMaxLength(10).IsRequired();
b.Property(a => a.UiCultureName).HasMaxLength(10).IsRequired();
b.Property(a => a.DisplayName).HasMaxLength(50).IsRequired();
// Language → LanguageText (CultureName üzerinden)
b.HasMany<LanguageText>()
.WithOne()
.HasForeignKey(t => t.CultureName)
.HasPrincipalKey(l => l.CultureName)
.OnDelete(DeleteBehavior.Cascade);
});
builder.Entity<LanguageKey>(b =>
@ -27,13 +34,18 @@ public static class LanguagesDbContextModelCreatingExtensions
b.ToTable(LanguagesDbProperties.DbTablePrefix + nameof(LanguageKey), LanguagesDbProperties.DbSchema);
b.ConfigureByConvention();
b.HasKey(a => new { a.ResourceName, a.Key });
b.HasMany(a => a.Texts).WithOne()
.HasForeignKey(a => new { a.ResourceName, a.Key })
.OnDelete(DeleteBehavior.SetNull);
b.Property(a => a.Key).HasMaxLength(100).IsRequired();
b.Property(a => a.ResourceName).HasMaxLength(50).IsRequired();
// LanguageKey → LanguageText (ResourceName + Key üzerinden)
b.HasMany(a => a.Texts)
.WithOne(t => t.LanguageKey)
.HasForeignKey(t => new { t.ResourceName, t.Key })
.HasPrincipalKey(k => new { k.ResourceName, k.Key })
.OnDelete(DeleteBehavior.Cascade);
// Unique index (ResourceName + Key)
b.HasIndex(x => new { x.ResourceName, x.Key }).IsUnique();
});
builder.Entity<LanguageText>(b =>

View file

@ -1,34 +1,22 @@
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.Domain.Entities.Auditing;
namespace Kurs.MailQueue.Domain.Entities;
public class BackgroundWorker_MailQueue : FullAuditedEntity<Guid>
{
public Guid TemplateId { get; set; }
[Required]
[StringLength(100)]
public string From { get; set; }
[Required]
[StringLength(100)]
public string To { get; set; }
[StringLength(8000)]
public string MailParameter { get; set; } //{0:KURYE=FEDEX&ABWNO=777705877048}
[StringLength(100)]
public string Table { get; set; }
[StringLength(500)]
public string MailParameter { get; set; }
public string TableName { get; set; }
public string TableParameter { get; set; }
[StringLength(100)]
public string Attachment { get; set; }
[StringLength(500)]
public string AttachmentParameter { get; set; }
public bool SendStatus { get; set; } // Mail gönderildi mi, vs
// [Column(TypeName = "datetime")]
public DateTime? SendTime { get; set; } // Gönderim zamanı
[StringLength(100)]
public string AwsMessageId { get; set; } // AWS'ten gelen response
[StringLength(100)]
public string RelatedRecordId { get; set; } // İlgili kaydın ID'si
public bool SendStatus { get; set; }
public DateTime? SendTime { get; set; }
public string AwsMessageId { get; set; }
public string RelatedRecordId { get; set; }
public virtual ICollection<BackgroundWorker_MailQueueEvents> Events { get; set; }
public virtual BackgroundWorker_MailQueueTableFormat TableFormat { get; set; }
}

View file

@ -1,18 +1,14 @@
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Domain.Entities.Auditing;
using Volo.Abp.Domain.Entities.Auditing;
namespace Kurs.MailQueue.Domain.Entities;
public partial class BackgroundWorker_MailQueueEvents : FullAuditedEntity<Guid>
{
[Required]
[StringLength(100)]
public string AwsMessageId { get; set; }
// [Column(TypeName = "datetime")]
public DateTime? EventDate { get; set; }
[StringLength(20)]
public string Event { get; set; }
[StringLength(100)]
public string MailAddress { get; set; }
public string ResponseDescription { get; set; }
public virtual BackgroundWorker_MailQueue MailQueue { get; set; }
}

View file

@ -1,33 +1,22 @@
using System.ComponentModel.DataAnnotations;
using Microsoft.EntityFrameworkCore;
using Volo.Abp.Domain.Entities;
using Volo.Abp.Domain.Entities;
namespace Kurs.MailQueue.Domain.Entities;
[Index(nameof(TableName), nameof(Order), Name = "IX_MailQueueTableFormat", IsUnique = true)]
public partial class BackgroundWorker_MailQueueTableFormat : Entity<int>
{
[Required]
[StringLength(100)]
public string TableName { get; set; }
public short Order { get; set; }
[StringLength(50)]
public string ColumnName { get; set; }
[StringLength(50)]
public string Caption { get; set; }
[StringLength(1000)]
public string HeaderCss { get; set; }
[StringLength(1000)]
public string Css { get; set; }
[StringLength(1000)]
public string FooterCss { get; set; }
[StringLength(50)]
public string DataType { get; set; }
[StringLength(50)]
public string DataFormat { get; set; }
public bool IsHidden { get; set; }
public bool IsProtected { get; set; } // Excel'deki sutun korumali mi olacak?
[StringLength(50)]
public bool IsProtected { get; set; }
public string SubTotal { get; set; }
public int Width { get; set; }
public virtual ICollection<BackgroundWorker_MailQueue> MailQueues { get; set; }
}

View file

@ -117,7 +117,7 @@ public class MailQueueWorker : BackgroundWorkerBase
//LogManager.LogInformation("Kuyruk process başladı", "KUYRUK", "KUYRUK", kuyruk.Id, jobId);
// Tablo oluştur
var tables = await TableGenerator.GenerateAsync(queue.Table, queue.TableParameter, queue.Id);
var tables = await TableGenerator.GenerateAsync(queue.TableName, queue.TableParameter, queue.Id);
//LogManager.LogInformation($"{tables.Count} adet tablo oluşturuldu", "TABLO", "KUYRUK", kuyruk.Id, jobId);

View file

@ -15,18 +15,61 @@ public static class MailQueueDbContextModelCreatingExtensions
{
b.ToTable(MailQueueDbProperties.DbTablePrefix + nameof(Domain.Entities.BackgroundWorker_MailQueue), MailQueueDbProperties.DbSchema);
b.ConfigureByConvention();
});
builder.Entity<Domain.Entities.BackgroundWorker_MailQueueTableFormat>(b =>
{
b.ToTable(MailQueueDbProperties.DbTablePrefix + nameof(Domain.Entities.BackgroundWorker_MailQueueTableFormat), MailQueueDbProperties.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.From).IsRequired().HasMaxLength(100);
b.Property(x => x.To).IsRequired().HasMaxLength(100);
b.Property(x => x.MailParameter).HasMaxLength(8000);
b.Property(x => x.TableName).HasMaxLength(100);
b.Property(x => x.TableParameter).HasMaxLength(500);
b.Property(x => x.Attachment).HasMaxLength(100);
b.Property(x => x.AttachmentParameter).HasMaxLength(500);
b.Property(x => x.AwsMessageId).HasMaxLength(100);
b.Property(x => x.RelatedRecordId).HasMaxLength(100);
// 🔗 İlişki: MailQueue ↔ MailQueueEvents (AwsMessageId)
b.HasMany(x => x.Events)
.WithOne(x => x.MailQueue)
.HasPrincipalKey(x => x.AwsMessageId) // Principal key
.HasForeignKey(x => x.AwsMessageId) // Dependent key
.OnDelete(DeleteBehavior.Cascade);
// 🔗 İlişki: MailQueue ↔ MailQueueTableFormat (TableName)
b.HasOne(x => x.TableFormat)
.WithMany(x => x.MailQueues)
.HasPrincipalKey(x => x.TableName) // Principal key
.HasForeignKey(x => x.TableName) // Dependent key
.OnDelete(DeleteBehavior.Cascade);
});
builder.Entity<Domain.Entities.BackgroundWorker_MailQueueEvents>(b =>
{
b.ToTable(MailQueueDbProperties.DbTablePrefix + nameof(Domain.Entities.BackgroundWorker_MailQueueEvents), MailQueueDbProperties.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.AwsMessageId).IsRequired().HasMaxLength(100);
b.Property(x => x.Event).HasMaxLength(20);
b.Property(x => x.MailAddress).HasMaxLength(100);
});
builder.Entity<Domain.Entities.BackgroundWorker_MailQueueTableFormat>(b =>
{
b.ToTable(MailQueueDbProperties.DbTablePrefix + nameof(Domain.Entities.BackgroundWorker_MailQueueTableFormat), MailQueueDbProperties.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.TableName).IsRequired().HasMaxLength(100);
b.Property(x => x.ColumnName).HasMaxLength(50);
b.Property(x => x.Caption).HasMaxLength(50);
b.Property(x => x.HeaderCss).HasMaxLength(1000);
b.Property(x => x.Css).HasMaxLength(1000);
b.Property(x => x.FooterCss).HasMaxLength(1000);
b.Property(x => x.DataType).HasMaxLength(50);
b.Property(x => x.DataFormat).HasMaxLength(50);
b.Property(x => x.SubTotal).HasMaxLength(50);
// Unique index (TableName + Order)
b.HasIndex(x => new { x.TableName, x.Order })
.IsUnique()
.HasDatabaseName("IX_MailQueueTableFormat");
});
}
}

View file

@ -5,7 +5,7 @@ namespace Kurs.Notifications.Entities;
public class Notification : FullAuditedEntity<Guid>
{
public Guid? NotificationRuleId { get; set; }
public Guid NotificationRuleId { get; set; }
public required string NotificationChannel { get; set; }
public required string NotificationType { get; set; }
@ -17,4 +17,6 @@ public class Notification : FullAuditedEntity<Guid>
public bool IsSent { get; set; }
public bool IsRead { get; set; }
public DateTime? ReadTime { get; set; }
public virtual NotificationRule NotificationRule { get; set; }
}

View file

@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using Volo.Abp.Domain.Entities.Auditing;
namespace Kurs.Notifications.Entities;
@ -19,4 +20,6 @@ public class NotificationRule : FullAuditedEntity<Guid>
public bool IsActive { get; set; }
public bool IsFixed { get; set; }
public bool IsCustomized { get; set; }
public virtual ICollection<Notification> Notifications { get; set; } = [];
}

View file

@ -18,8 +18,16 @@ public static class NotificationDbContextModelCreatingExtensions
b.ToTable(NotificationDbProperties.DbTablePrefix + nameof(NotificationRule), NotificationDbProperties.DbSchema);
b.ConfigureByConvention();
b.Property(a => a.Channel).HasMaxLength(10).IsRequired();
b.Property(a => a.NotificationType).HasMaxLength(100).IsRequired();
b.Property(x => x.NotificationType).IsRequired().HasMaxLength(100);
b.Property(x => x.RecipientType).IsRequired().HasMaxLength(50);
b.Property(x => x.RecipientId).HasMaxLength(200);
b.Property(x => x.Channel).IsRequired().HasMaxLength(50);
// 1:N ilişki NotificationRule -> Notifications
b.HasMany(x => x.Notifications)
.WithOne(x => x.NotificationRule)
.HasForeignKey(x => x.NotificationRuleId)
.OnDelete(DeleteBehavior.Cascade);
});
builder.Entity<Notification>(b =>
@ -27,27 +35,10 @@ public static class NotificationDbContextModelCreatingExtensions
b.ToTable(NotificationDbProperties.DbTablePrefix + nameof(Notification), NotificationDbProperties.DbSchema);
b.ConfigureByConvention();
b.Property(a => a.NotificationChannel).HasMaxLength(10).IsRequired();
b.Property(a => a.NotificationType).HasMaxLength(100).IsRequired();
b.Property(x => x.NotificationChannel).IsRequired().HasMaxLength(50);
b.Property(x => x.NotificationType).IsRequired().HasMaxLength(100);
b.Property(x => x.Identifier).IsRequired().HasMaxLength(200);
b.Property(x => x.Message).IsRequired().HasMaxLength(2000);
});
/* Configure all entities here. Example:
builder.Entity<Question>(b =>
{
//Configure table & schema name
b.ToTable(NotificationDbProperties.DbTablePrefix + "Questions", NotificationDbProperties.DbSchema);
b.ConfigureByConvention();
//Properties
b.Property(q => q.Title).IsRequired().HasMaxLength(QuestionConsts.MaxTitleLength);
//Relations
b.HasMany(question => question.Tags).WithOne().HasForeignKey(qt => qt.QuestionId);
//Indexes
b.HasIndex(q => q.CreationTime);
});
*/
}
}

View file

@ -8,5 +8,5 @@ public class CityDto : AuditedEntityDto<Guid>
public string Code { get; set; }
public string Name { get; set; }
public string PlateCode { get; set; }
public string CountryCode { get; set; }
public string Country { get; set; }
}

View file

@ -5,8 +5,8 @@ namespace Kurs.Platform.Contacts;
public class DistrictDto : AuditedEntityDto<Guid>
{
public string CountryCode { get; set; }
public string CityCode { get; set; }
public string Country { get; set; }
public string City { get; set; }
public string Name { get; set; }
public string Township { get; set; }
public string Street { get; set; }

File diff suppressed because it is too large Load diff

View file

@ -298,12 +298,12 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency
{
if (item == null) continue;
var key = $"{item.CountryCode}.{item.Code}";
var key = $"{item.Country}.{item.Code}";
if (existingSet.Contains(key)) continue; // duplicate kontrolü
buffer.Add(new City(
Guid.NewGuid(),
item.CountryCode,
item.Country,
item.Name,
key,
item.PlateCode
@ -339,11 +339,11 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency
// 1. Mevcut kayıtları çek (tek sorguda)
var existingDistricts = await dbCtx.Set<District>()
.Select(d => new { d.CountryCode, d.CityCode, d.Name, d.Township, d.Street, d.ZipCode })
.Select(d => new { d.Country, d.City, d.Name, d.Township, d.Street, d.ZipCode })
.ToListAsync();
var existingSet = existingDistricts
.Select(d => $"{d.CountryCode}:{d.CityCode}:{d.Name}:{d.Township}:{d.Street}:{d.ZipCode}")
.Select(d => $"{d.Country}:{d.City}:{d.Name}:{d.Township}:{d.Street}:{d.ZipCode}")
.ToHashSet();
var options = new JsonSerializerOptions
@ -359,13 +359,13 @@ public class PlatformDataSeeder : IDataSeedContributor, ITransientDependency
{
if (item == null) continue;
var key = $"{item.CountryCode}:{item.CountryCode}.{item.CityCode}:{item.Name}:{item.Township}:{item.Street}:{item.ZipCode}";
var cityCode = $"{item.CountryCode}.{item.CityCode}";
var key = $"{item.Country}:{item.Country}.{item.City}:{item.Name}:{item.Township}:{item.Street}:{item.ZipCode}";
var cityCode = $"{item.Country}.{item.City}";
if (existingSet.Contains(key)) continue;
buffer.Add(new District(
Guid.NewGuid(),
item.CountryCode,
item.Country,
cityCode,
item.Name,
item.Township,

View file

@ -12,8 +12,6 @@ public static class PlatformConsts
public const bool IsMultiTenant = true;
public const string AppName = "Platform";
public const string DbTablePrefix = "P";
public const string DbSchema = null;
public const string DefaultLanguage = LanguageCodes.En;
public const string React = "UI";
public const char MultiValueDelimiter = '|';
@ -22,6 +20,10 @@ public static class PlatformConsts
{
public const string App = "App";
public const string Abp = "Abp";
public const string DbTableDefault = "P";
public const string DbTableDefinition = "D";
public const string DbTableCoordinator = "C";
public const string DbSchema = null;
}
public static class Tenants
@ -1316,8 +1318,8 @@ public static class PlatformConsts
}
}
public static string SelectCommandByTableName(string TableName)
public static string SelectCommandByTableName(string TableName, string prefix = Prefix.DbTableDefault)
{
return DbTablePrefix + TableName;
return prefix + TableName;
}
}

View file

@ -9,10 +9,10 @@ public class Bank : FullAuditedEntity<Guid>
public string IdentifierCode { get; set; }
public string AddressLine1 { get; set; }
public string AddressLine2 { get; set; }
public string District { get; set; }
public string City { get; set; }
public string PostalCode { get; set; }
public string Country { get; set; }
public string City { get; set; }
public string District { get; set; }
public string PostalCode { get; set; }
public string Phone { get; set; }
public string Email { get; set; }
}

View file

@ -6,20 +6,19 @@ namespace Kurs.Platform.Entities;
public class City : FullAuditedEntity<Guid>
{
public string CountryCode { get; set; }
public string Country { get; set; }
public string Name { get; set; }
public string Code { get; set; }
public string PlateCode { get; set; }
public Country Country { get; set; }
public ICollection<District> Districts { get; set; }
protected City() { }
public City(Guid id, string countryCode, string name, string code, string plateCode)
public City(Guid id, string country, string name, string code, string plateCode)
: base(id)
{
CountryCode = countryCode;
Country = country;
Name = name;
Code = code;
PlateCode = plateCode;

View file

@ -1,6 +1,8 @@
using System;
using Volo.Abp.Domain.Entities.Auditing;
namespace Kurs.Platform.Entities;
public class ContactTag : FullAuditedEntity<Guid>
{
public string Name { get; set; }

View file

@ -1,6 +1,8 @@
using System;
using Volo.Abp.Domain.Entities.Auditing;
namespace Kurs.Platform.Entities;
public class ContactTitle : FullAuditedEntity<Guid>
{
public string Title { get; set; }

View file

@ -42,17 +42,3 @@ public class Country : FullAuditedEntity<Guid>
}
}
public class CountryGroup : FullAuditedEntity<Guid>
{
public string Name { get; set; }
protected CountryGroup() { }
public CountryGroup(
Guid id,
string name)
: base(id)
{
Name = name;
}
}

View file

@ -0,0 +1,17 @@
using System;
using Volo.Abp.Domain.Entities.Auditing;
namespace Kurs.Platform.Entities;
public class CountryGroup : FullAuditedEntity<Guid>
{
public string Name { get; set; }
protected CountryGroup() { }
public CountryGroup(Guid id, string name)
: base(id)
{
Name = name;
}
}

View file

@ -1,5 +1,4 @@
using System;
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Domain.Entities.Auditing;
namespace Kurs.Platform.Entities;

View file

@ -5,21 +5,20 @@ namespace Kurs.Platform.Entities;
public class District : FullAuditedEntity<Guid>
{
public string CountryCode { get; set; }
public string CityCode { get; set; }
public string Country { get; set; }
public string City { get; set; }
public string Name { get; set; }
public string Township { get; set; }
public string Street { get; set; }
public string ZipCode { get; set; }
public City City { get; set; }
protected District() { }
public District(Guid id, string countryCode, string cityCode, string name, string township, string street, string zipCode)
public District(Guid id, string country, string city, string name, string township, string street, string zipCode)
: base(id)
{
CountryCode = countryCode;
CityCode = cityCode;
Country = country;
City = city;
Name = name;
Township = township;
Street = street;

View file

@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using Volo.Abp.Domain.Entities.Auditing;
namespace Kurs.Platform.Entities;
@ -23,4 +24,6 @@ public class Branch : FullAuditedEntity<Guid>
public string Email { get; set; }
public string Website { get; set; }
public bool? IsActive { get; set; }
public virtual ICollection<BranchUsers> Users { get; set; }
}

View file

@ -2,6 +2,7 @@ using System;
using Volo.Abp.MultiTenancy;
namespace Kurs.Platform.Entities;
using Volo.Abp.Domain.Entities;
public class BranchUsers : Entity<Guid>, IMultiTenant
@ -9,5 +10,8 @@ public class BranchUsers : Entity<Guid>, IMultiTenant
public Guid UserId { get; set; }
public Guid BranchId { get; set; }
public Guid? TenantId { get; set; }
Guid? IMultiTenant.TenantId => TenantId;
public virtual Branch Branch { get; set; }
}

View file

@ -17,13 +17,15 @@ using Volo.Abp.PermissionManagement.EntityFrameworkCore;
using Volo.Abp.TenantManagement;
using Volo.Abp.TenantManagement.EntityFrameworkCore;
using Kurs.Notifications.EntityFrameworkCore;
using static Kurs.Settings.SettingsConsts;
using Kurs.Platform.Forum;
using Microsoft.EntityFrameworkCore.ChangeTracking;
using System;
using System.Linq;
using System.Text.Json;
using static Kurs.Platform.PlatformConsts;
using static Kurs.Settings.SettingsConsts;
namespace Kurs.Platform.EntityFrameworkCore;
[ReplaceDbContext(typeof(IIdentityDbContext))]
@ -167,7 +169,7 @@ public class PlatformDbContext :
builder.Entity<ListForm>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(ListForm), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefault + nameof(ListForm), Prefix.DbSchema);
b.ConfigureByConvention(); // base class props
// Anahtar
@ -192,66 +194,67 @@ public class PlatformDbContext :
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.Property(a => a.SelectCommand).HasColumnType("text");
b.Property(a => a.SelectFieldsDefaultValueJson).HasColumnType("text");
b.Property(a => a.DefaultFilter).HasColumnType("text");
b.Property(a => a.ColumnOptionJson).HasColumnType("text");
b.Property(a => a.PivotOptionJson).HasColumnType("text");
b.Property(a => a.FilterRowJson).HasColumnType("text");
b.Property(a => a.HeaderFilterJson).HasColumnType("text");
b.Property(a => a.FilterPanelJson).HasColumnType("text");
b.Property(a => a.SearchPanelJson).HasColumnType("text");
b.Property(a => a.GroupPanelJson).HasColumnType("text");
b.Property(a => a.SelectionJson).HasColumnType("text");
b.Property(a => a.PagerOptionJson).HasColumnType("text");
b.Property(a => a.EditingOptionJson).HasColumnType("text");
b.Property(a => a.EditingFormJson).HasColumnType("text");
b.Property(a => a.PermissionJson).HasColumnType("text");
b.Property(a => a.InsertFieldsDefaultValueJson).HasColumnType("text");
b.Property(a => a.UpdateFieldsDefaultValueJson).HasColumnType("text");
b.Property(a => a.DeleteFieldsDefaultValueJson).HasColumnType("text");
b.Property(a => a.CommandColumnJson).HasColumnType("text");
b.Property(a => a.StateStoringJson).HasColumnType("text");
b.Property(a => a.DeleteCommand).HasColumnType("text");
b.Property(a => a.UpdateCommand).HasColumnType("text");
b.Property(a => a.InsertCommand).HasColumnType("text");
b.Property(a => a.CustomJsSourcesJson).HasColumnType("text");
b.Property(a => a.CustomStyleSourcesJson).HasColumnType("text");
b.Property(a => a.FormFieldsDefaultValueJson).HasColumnType("text");
b.Property(a => a.SubFormsJson).HasColumnType("text");
b.Property(a => a.WidgetsJson).HasColumnType("text");
b.Property(a => a.ExtraFilterJson).HasColumnType("text");
b.Property(a => a.LayoutJson).HasColumnType("text");
b.Property(a => a.CommonJson).HasColumnType("text");
b.Property(a => a.DataSourceJson).HasColumnType("text");
b.Property(a => a.AdaptiveLayoutJson).HasColumnType("text");
b.Property(a => a.AnimationJson).HasColumnType("text");
b.Property(a => a.AnnotationsJson).HasColumnType("text");
b.Property(a => a.ArgumentAxisJson).HasColumnType("text");
b.Property(a => a.CommonAnnotationsSettingsJson).HasColumnType("text");
b.Property(a => a.CommonAxisSettingsJson).HasColumnType("text");
b.Property(a => a.CommonPaneSettingsJson).HasColumnType("text");
b.Property(a => a.CommonSeriesSettingsJson).HasColumnType("text");
b.Property(a => a.CrosshairJson).HasColumnType("text");
b.Property(a => a.ExportJson).HasColumnType("text");
b.Property(a => a.LegendJson).HasColumnType("text");
b.Property(a => a.MarginJson).HasColumnType("text");
b.Property(a => a.PanesJson).HasColumnType("text");
b.Property(a => a.ScrollBarJson).HasColumnType("text");
b.Property(a => a.SeriesJson).HasColumnType("text");
b.Property(a => a.SizeJson).HasColumnType("text");
b.Property(a => a.TitleJson).HasColumnType("text");
b.Property(a => a.TooltipJson).HasColumnType("text");
b.Property(a => a.ValueAxisJson).HasColumnType("text");
b.Property(a => a.ZoomAndPanJson).HasColumnType("text");
b.HasMany<ListFormField>().WithOne().HasForeignKey(x => x.ListFormCode).HasPrincipalKey(x => x.ListFormCode).IsRequired();
b.HasMany<ListFormCustomization>().WithOne().HasForeignKey(x => x.ListFormCode).HasPrincipalKey(x => x.ListFormCode).IsRequired();
b.HasMany<ListFormImport>().WithOne().HasForeignKey(x => x.ListFormCode).HasPrincipalKey(x => x.ListFormCode).IsRequired();
});
builder.Entity<ListFormField>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(ListFormField), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefault + nameof(ListFormField), Prefix.DbSchema);
b.ConfigureByConvention();
// Anahtar
@ -275,44 +278,67 @@ public class PlatformDbContext :
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)");
b.Property(a => a.ColumnFilterJson).HasColumnType("text");
b.Property(a => a.ColumnHeaderJson).HasColumnType("text");
b.Property(a => a.GroupingJson).HasColumnType("text");
b.Property(a => a.ColumnCustomizationJson).HasColumnType("text");
b.Property(a => a.TotalSummaryJson).HasColumnType("text");
b.Property(a => a.GroupSummaryJson).HasColumnType("text");
b.Property(a => a.JoinTableJson).HasColumnType("text");
b.Property(a => a.EditingJson).HasColumnType("text");
b.Property(a => a.LookupJson).HasColumnType("text");
b.Property(a => a.ValidationRuleJson).HasColumnType("text");
b.Property(a => a.ColumnStylingJson).HasColumnType("text");
b.Property(a => a.PermissionJson).HasColumnType("text");
b.Property(a => a.PivotSettingsJson).HasColumnType("text");
// 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)");
b.Property(a => a.EditorOptions).HasColumnType("text");
});
builder.Entity<ListFormCustomization>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(ListFormCustomization), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefault + nameof(ListFormCustomization), Prefix.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.CustomizationData).HasColumnType("text");
b.Property(a => a.CustomizationType).IsRequired();
});
builder.Entity<ListFormImport>(b =>
{
b.ToTable(Prefix.DbTableDefault + nameof(ListFormImport), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.ListFormCode).IsRequired().HasMaxLength(64);
b.Property(x => x.BlobName).IsRequired().HasMaxLength(256);
b.Property(x => x.Status).IsRequired().HasMaxLength(64);
builder.Entity<ListFormImport>(b => { b.HasMany<ListFormImportExecute>().WithOne().HasForeignKey(x => x.ImportId).OnDelete(DeleteBehavior.Cascade); });
});
builder.Entity<ListFormImportExecute>(b =>
{
b.ToTable(Prefix.DbTableDefault + nameof(ListFormImportExecute), Prefix.DbSchema);
b.ConfigureByConvention();
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");
});
builder.Entity<Menu>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(Menu), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefault + nameof(Menu), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(a => a.Code).IsRequired().HasMaxLength(100);
@ -331,7 +357,7 @@ public class PlatformDbContext :
builder.Entity<IpRestriction>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(IpRestriction), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefault + nameof(IpRestriction), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(a => a.ResourceType).IsRequired().HasMaxLength(10);
@ -341,7 +367,7 @@ public class PlatformDbContext :
builder.Entity<DataSource>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(DataSource), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefault + nameof(DataSource), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(a => a.Code).IsRequired().HasMaxLength(100);
@ -351,7 +377,7 @@ public class PlatformDbContext :
builder.Entity<BackgroundWorker>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(BackgroundWorker), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefault + nameof(BackgroundWorker), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(a => a.Name).IsRequired().HasMaxLength(100);
@ -361,12 +387,12 @@ public class PlatformDbContext :
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)");
b.Property(a => a.Options).HasColumnType("text");
});
builder.Entity<CustomEndpoint>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(CustomEndpoint), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefault + nameof(CustomEndpoint), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(a => a.Name).IsRequired().HasMaxLength(128);
@ -375,13 +401,13 @@ public class PlatformDbContext :
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)");
b.Property(a => a.ParametersJson).HasColumnType("text");
b.Property(a => a.PermissionsJson).HasColumnType("text");
});
builder.Entity<GlobalSearch>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(GlobalSearch), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefault + nameof(GlobalSearch), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(a => a.System).HasMaxLength(50);
@ -393,7 +419,7 @@ public class PlatformDbContext :
builder.Entity<AiBot>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(AiBot), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefault + nameof(AiBot), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(a => a.BotName).IsRequired().HasMaxLength(128);
@ -401,7 +427,7 @@ public class PlatformDbContext :
builder.Entity<Branch>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(Branch), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefault + nameof(Branch), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(a => a.TenantId).IsRequired();
@ -422,11 +448,16 @@ public class PlatformDbContext :
b.Property(a => a.Email).HasMaxLength(128);
b.Property(a => a.Website).HasMaxLength(128);
b.Property(a => a.IsActive).HasDefaultValue(true);
b.HasMany(x => x.Users)
.WithOne(x => x.Branch)
.HasForeignKey(x => x.BranchId)
.OnDelete(DeleteBehavior.Cascade);
});
builder.Entity<BranchUsers>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(BranchUsers), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefault + nameof(BranchUsers), Prefix.DbSchema);
b.ConfigureByConvention();
b.HasKey(x => new { x.UserId, x.BranchId });
@ -437,7 +468,7 @@ public class PlatformDbContext :
builder.Entity<Sector>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(Sector), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefinition + nameof(Sector), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Name).IsRequired().HasMaxLength(128);
@ -446,7 +477,7 @@ public class PlatformDbContext :
builder.Entity<UomCategory>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(UomCategory), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefinition + nameof(UomCategory), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Name).IsRequired().HasMaxLength(128);
@ -456,7 +487,7 @@ public class PlatformDbContext :
builder.Entity<Uom>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(Uom), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefinition + nameof(Uom), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Name).IsRequired().HasMaxLength(64);
@ -474,7 +505,7 @@ public class PlatformDbContext :
builder.Entity<Currency>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(Currency), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefinition + nameof(Currency), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Code).IsRequired().HasMaxLength(8);
@ -487,7 +518,7 @@ public class PlatformDbContext :
builder.Entity<Bank>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(Bank), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefinition + nameof(Bank), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Name).IsRequired().HasMaxLength(128);
@ -504,7 +535,7 @@ public class PlatformDbContext :
builder.Entity<BankAccount>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(BankAccount), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefinition + nameof(BankAccount), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.AccountNumber).IsRequired().HasMaxLength(64);
@ -529,7 +560,7 @@ public class PlatformDbContext :
builder.Entity<CountryGroup>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(CountryGroup), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefinition + nameof(CountryGroup), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Name).IsRequired().HasMaxLength(128);
@ -538,24 +569,23 @@ public class PlatformDbContext :
builder.Entity<Country>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(Country), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefinition + nameof(Country), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Code).IsRequired().HasMaxLength(8);
b.Property(x => x.Name).IsRequired().HasMaxLength(128);
b.Property(x => x.GroupName).HasMaxLength(128);
b.Property(x => x.CurrencyCode).HasMaxLength(8);
b.Property(x => x.PhoneCode).HasMaxLength(16);
b.Property(x => x.TaxLabel).HasMaxLength(64);
b.HasIndex(x => x.Code).IsUnique();
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);
// b.HasMany(x => x.Cities)
// .WithOne(x => x.Country)
// .HasForeignKey(x => x.CountryCode)
// .HasPrincipalKey(x => x.Code)
// .OnDelete(DeleteBehavior.Cascade);
b.HasOne<CountryGroup>()
.WithMany()
@ -566,41 +596,41 @@ public class PlatformDbContext :
builder.Entity<City>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(City), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefinition + nameof(City), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.CountryCode).HasMaxLength(8);
b.Property(x => x.Country).HasMaxLength(8);
b.Property(x => x.Name).IsRequired().HasMaxLength(128);
b.Property(x => x.Code).IsRequired().HasMaxLength(16);
b.Property(x => x.PlateCode).HasMaxLength(20);
b.HasIndex(x => new { x.CountryCode, x.Code }).IsUnique();
b.HasIndex(x => new { x.Country, 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);
// b.HasMany(x => x.Districts)
// .WithOne(x => x.City)
// .HasForeignKey(x => new { x.CountryCode, x.CityCode })
// .HasPrincipalKey(x => new { x.Country, x.Code })
// .OnDelete(DeleteBehavior.Cascade);
});
builder.Entity<District>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(District), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefinition + nameof(District), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.CountryCode).HasMaxLength(8);
b.Property(x => x.CityCode).IsRequired().HasMaxLength(16);
b.Property(x => x.Country).HasMaxLength(8);
b.Property(x => x.City).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);
b.HasIndex(x => new { x.CountryCode, x.CityCode, x.Name, x.Township, x.Street, x.ZipCode }).IsUnique();
b.HasIndex(x => new { x.Country, x.City, x.Name, x.Township, x.Street, x.ZipCode }).IsUnique();
});
builder.Entity<SkillType>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(SkillType), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefinition + nameof(SkillType), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Name).IsRequired().HasMaxLength(128);
@ -622,7 +652,7 @@ public class PlatformDbContext :
builder.Entity<Skill>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(Skill), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefinition + nameof(Skill), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Name).IsRequired().HasMaxLength(128);
@ -631,7 +661,7 @@ public class PlatformDbContext :
builder.Entity<SkillLevel>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(SkillLevel), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefinition + nameof(SkillLevel), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Name).IsRequired().HasMaxLength(128);
@ -642,7 +672,7 @@ public class PlatformDbContext :
builder.Entity<ContactTag>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(ContactTag), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefinition + nameof(ContactTag), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Name).IsRequired().HasMaxLength(128);
@ -651,7 +681,7 @@ public class PlatformDbContext :
builder.Entity<ContactTitle>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(ContactTitle), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefinition + nameof(ContactTitle), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Title).IsRequired().HasMaxLength(128);
@ -660,7 +690,7 @@ public class PlatformDbContext :
builder.Entity<BlogCategory>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(BlogCategory), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefault + nameof(BlogCategory), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Name).IsRequired().HasMaxLength(128);
@ -673,7 +703,7 @@ public class PlatformDbContext :
builder.Entity<BlogPost>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(BlogPost), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefault + nameof(BlogPost), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Title).IsRequired().HasMaxLength(256);
@ -696,7 +726,7 @@ public class PlatformDbContext :
builder.Entity<ForumCategory>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(ForumCategory), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefault + nameof(ForumCategory), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Name).IsRequired().HasMaxLength(128);
@ -714,7 +744,7 @@ public class PlatformDbContext :
builder.Entity<ForumTopic>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(ForumTopic), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefault + nameof(ForumTopic), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Title).IsRequired().HasMaxLength(256);
@ -734,7 +764,7 @@ public class PlatformDbContext :
builder.Entity<ForumPost>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(ForumPost), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefault + nameof(ForumPost), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Content).IsRequired();
@ -755,7 +785,7 @@ public class PlatformDbContext :
builder.Entity<Route>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(Route), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefault + nameof(Route), Prefix.DbSchema);
b.ConfigureByConvention();
b.HasIndex(x => x.Key).IsUnique();
@ -779,7 +809,7 @@ public class PlatformDbContext :
builder.Entity<CustomEntity>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(CustomEntity), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefault + nameof(CustomEntity), Prefix.DbSchema);
b.ConfigureByConvention();
b.HasKey(x => x.Id);
@ -798,7 +828,7 @@ public class PlatformDbContext :
builder.Entity<CustomEntityField>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(CustomEntityField), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefault + nameof(CustomEntityField), Prefix.DbSchema);
b.ConfigureByConvention();
b.HasKey(x => x.Id);
@ -810,7 +840,7 @@ public class PlatformDbContext :
builder.Entity<ApiMigration>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(ApiMigration), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefault + nameof(ApiMigration), Prefix.DbSchema);
b.ConfigureByConvention();
b.HasKey(x => x.Id);
@ -828,7 +858,7 @@ public class PlatformDbContext :
builder.Entity<ApiEndpoint>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(ApiEndpoint), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefault + nameof(ApiEndpoint), Prefix.DbSchema);
b.ConfigureByConvention();
b.HasKey(x => x.Id);
@ -846,7 +876,7 @@ public class PlatformDbContext :
builder.Entity<CustomComponent>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(CustomComponent), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefault + nameof(CustomComponent), Prefix.DbSchema);
b.ConfigureByConvention();
b.HasKey(x => x.Id);
@ -859,7 +889,7 @@ public class PlatformDbContext :
builder.Entity<Product>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(Product), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefault + nameof(Product), Prefix.DbSchema);
b.ConfigureByConvention();
b.HasKey(x => x.Id);
@ -873,7 +903,7 @@ public class PlatformDbContext :
builder.Entity<PaymentMethod>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(PaymentMethod), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefault + nameof(PaymentMethod), Prefix.DbSchema);
b.ConfigureByConvention();
b.HasKey(x => x.Id);
@ -884,7 +914,7 @@ public class PlatformDbContext :
builder.Entity<InstallmentOption>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(InstallmentOption), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefault + nameof(InstallmentOption), Prefix.DbSchema);
b.ConfigureByConvention();
b.HasKey(x => x.Id);
@ -894,7 +924,7 @@ public class PlatformDbContext :
builder.Entity<Order>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(Order), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefault + nameof(Order), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(o => o.OrganizationName).HasMaxLength(128);
@ -925,7 +955,7 @@ public class PlatformDbContext :
builder.Entity<OrderItem>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(OrderItem), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefault + nameof(OrderItem), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(i => i.ProductName).IsRequired().HasMaxLength(128);
@ -933,30 +963,9 @@ public class PlatformDbContext :
b.Property(i => i.TotalPrice).IsRequired().HasPrecision(18, 2);
});
builder.Entity<ListFormImport>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(ListFormImport), PlatformConsts.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.ListFormCode).IsRequired().HasMaxLength(128);
b.Property(x => x.BlobName).IsRequired().HasMaxLength(256);
b.Property(x => x.Status).IsRequired().HasMaxLength(64);
});
builder.Entity<ListFormImportExecute>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(ListFormImportExecute), PlatformConsts.DbSchema);
b.ConfigureByConvention();
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("nvarchar(max)");
});
builder.Entity<ReportCategory>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(ReportCategory), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefault + nameof(ReportCategory), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Name).IsRequired().HasMaxLength(256);
@ -974,7 +983,7 @@ public class PlatformDbContext :
builder.Entity<ReportTemplate>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(ReportTemplate), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefault + nameof(ReportTemplate), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Name).IsRequired().HasMaxLength(256);
@ -991,7 +1000,7 @@ public class PlatformDbContext :
builder.Entity<ReportParameter>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(ReportParameter), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefault + nameof(ReportParameter), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.ReportTemplateId).IsRequired();
@ -1005,7 +1014,7 @@ public class PlatformDbContext :
builder.Entity<ReportGenerated>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(ReportGenerated), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefault + nameof(ReportGenerated), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.TemplateId).IsRequired(false);
@ -1023,7 +1032,7 @@ public class PlatformDbContext :
builder.Entity<Demo>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(Demo), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefault + nameof(Demo), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.OrganizationName).IsRequired().HasMaxLength(256);
@ -1038,7 +1047,7 @@ public class PlatformDbContext :
builder.Entity<Service>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(Service), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefault + nameof(Service), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Title).IsRequired().HasMaxLength(128);
@ -1062,17 +1071,17 @@ public class PlatformDbContext :
builder.Entity<About>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(About), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefault + nameof(About), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.StatsJson).HasColumnType("nvarchar(max)");
b.Property(x => x.DescriptionsJson).HasColumnType("nvarchar(max)");
b.Property(x => x.SectionsJson).HasColumnType("nvarchar(max)");
b.Property(x => x.StatsJson).HasColumnType("text");
b.Property(x => x.DescriptionsJson).HasColumnType("text");
b.Property(x => x.SectionsJson).HasColumnType("text");
});
builder.Entity<Contact>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(Contact), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefault + nameof(Contact), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Address).HasMaxLength(500);
@ -1081,14 +1090,14 @@ public class PlatformDbContext :
b.Property(x => x.Location).HasMaxLength(150);
b.Property(x => x.TaxNumber).HasMaxLength(50);
b.Property(x => x.BankJson).HasColumnType("nvarchar(max)");
b.Property(x => x.WorkHoursJson).HasColumnType("nvarchar(max)");
b.Property(x => x.MapJson).HasColumnType("nvarchar(max)");
b.Property(x => x.BankJson).HasColumnType("text");
b.Property(x => x.WorkHoursJson).HasColumnType("text");
b.Property(x => x.MapJson).HasColumnType("text");
});
builder.Entity<Classroom>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(Classroom), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefault + nameof(Classroom), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.Name).IsRequired().HasMaxLength(200);
@ -1117,7 +1126,7 @@ public class PlatformDbContext :
builder.Entity<ClassroomParticipant>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(ClassroomParticipant), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefault + nameof(ClassroomParticipant), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.UserName).IsRequired().HasMaxLength(100);
@ -1132,7 +1141,7 @@ public class PlatformDbContext :
builder.Entity<ClassroomAttandance>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(ClassroomAttandance), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefault + nameof(ClassroomAttandance), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.StudentName).IsRequired().HasMaxLength(100);
@ -1144,7 +1153,7 @@ public class PlatformDbContext :
builder.Entity<ClassroomChat>(b =>
{
b.ToTable(PlatformConsts.DbTablePrefix + nameof(ClassroomChat), PlatformConsts.DbSchema);
b.ToTable(Prefix.DbTableDefault + nameof(ClassroomChat), Prefix.DbSchema);
b.ConfigureByConvention();
b.Property(x => x.SenderName).IsRequired().HasMaxLength(100);

View file

@ -13,7 +13,7 @@ using Volo.Abp.EntityFrameworkCore;
namespace Kurs.Platform.Migrations
{
[DbContext(typeof(PlatformDbContext))]
[Migration("20251002115440_Initial")]
[Migration("20251003092426_Initial")]
partial class Initial
{
/// <inheritdoc />
@ -73,7 +73,7 @@ namespace Kurs.Platform.Migrations
b.HasKey("Id");
b.ToTable("PContactTag", (string)null);
b.ToTable("DContactTag", (string)null);
});
modelBuilder.Entity("ContactTitle", b =>
@ -122,7 +122,7 @@ namespace Kurs.Platform.Migrations
b.HasKey("Id");
b.ToTable("PContactTitle", (string)null);
b.ToTable("DContactTitle", (string)null);
});
modelBuilder.Entity("Kurs.Languages.Entities.Language", b =>
@ -189,13 +189,9 @@ namespace Kurs.Platform.Migrations
modelBuilder.Entity("Kurs.Languages.Entities.LanguageKey", b =>
{
b.Property<string>("ResourceName")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Key")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
@ -213,15 +209,17 @@ namespace Kurs.Platform.Migrations
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<string>("Key")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
@ -230,7 +228,15 @@ namespace Kurs.Platform.Migrations
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.HasKey("ResourceName", "Key");
b.Property<string>("ResourceName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.HasKey("Id");
b.HasIndex("ResourceName", "Key")
.IsUnique();
b.ToTable("PLanguageKey", (string)null);
});
@ -291,6 +297,8 @@ namespace Kurs.Platform.Migrations
b.HasKey("Id");
b.HasIndex("CultureName");
b.HasIndex("ResourceName", "Key");
b.ToTable("PLanguageText", (string)null);
@ -311,6 +319,7 @@ namespace Kurs.Platform.Migrations
.HasColumnType("nvarchar(500)");
b.Property<string>("AwsMessageId")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
@ -363,7 +372,7 @@ namespace Kurs.Platform.Migrations
b.Property<DateTime?>("SendTime")
.HasColumnType("datetime2");
b.Property<string>("Table")
b.Property<string>("TableName")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
@ -381,6 +390,8 @@ namespace Kurs.Platform.Migrations
b.HasKey("Id");
b.HasIndex("TableName");
b.ToTable("PBackgroundWorker_MailQueue", (string)null);
});
@ -441,6 +452,8 @@ namespace Kurs.Platform.Migrations
b.HasKey("Id");
b.HasIndex("AwsMessageId");
b.ToTable("PBackgroundWorker_MailQueueEvents", (string)null);
});
@ -503,8 +516,9 @@ namespace Kurs.Platform.Migrations
b.HasKey("Id");
b.HasIndex(new[] { "TableName", "Order" }, "IX_MailQueueTableFormat")
.IsUnique();
b.HasIndex("TableName", "Order")
.IsUnique()
.HasDatabaseName("IX_MailQueueTableFormat");
b.ToTable("PBackgroundWorker_MailQueueTableFormat", (string)null);
});
@ -533,7 +547,8 @@ namespace Kurs.Platform.Migrations
b.Property<string>("Identifier")
.IsRequired()
.HasColumnType("nvarchar(max)");
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
@ -557,14 +572,15 @@ namespace Kurs.Platform.Migrations
b.Property<string>("Message")
.IsRequired()
.HasColumnType("nvarchar(max)");
.HasMaxLength(2000)
.HasColumnType("nvarchar(2000)");
b.Property<string>("NotificationChannel")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("nvarchar(10)");
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<Guid?>("NotificationRuleId")
b.Property<Guid>("NotificationRuleId")
.HasColumnType("uniqueidentifier");
b.Property<string>("NotificationType")
@ -580,6 +596,8 @@ namespace Kurs.Platform.Migrations
b.HasKey("Id");
b.HasIndex("NotificationRuleId");
b.ToTable("PNotification", (string)null);
});
@ -591,8 +609,8 @@ namespace Kurs.Platform.Migrations
b.Property<string>("Channel")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("nvarchar(10)");
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
@ -639,11 +657,13 @@ namespace Kurs.Platform.Migrations
.HasColumnType("nvarchar(100)");
b.Property<string>("RecipientId")
.HasColumnType("nvarchar(max)");
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<string>("RecipientType")
.IsRequired()
.HasColumnType("nvarchar(max)");
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.HasKey("Id");
@ -672,7 +692,7 @@ namespace Kurs.Platform.Migrations
.HasColumnName("DeletionTime");
b.Property<string>("DescriptionsJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
@ -689,10 +709,10 @@ namespace Kurs.Platform.Migrations
.HasColumnName("LastModifierId");
b.Property<string>("SectionsJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("StatsJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<Guid?>("TenantId")
.HasColumnType("uniqueidentifier")
@ -918,7 +938,7 @@ namespace Kurs.Platform.Migrations
.HasColumnType("nvarchar(100)");
b.Property<string>("Options")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<int>("WorkerType")
.HasColumnType("int");
@ -1006,7 +1026,7 @@ namespace Kurs.Platform.Migrations
b.HasKey("Id");
b.ToTable("PBank", (string)null);
b.ToTable("DBank", (string)null);
});
modelBuilder.Entity("Kurs.Platform.Entities.BankAccount", b =>
@ -1073,7 +1093,7 @@ namespace Kurs.Platform.Migrations
b.HasIndex("CurrencyId");
b.ToTable("PBankAccount", (string)null);
b.ToTable("DBankAccount", (string)null);
});
modelBuilder.Entity("Kurs.Platform.Entities.BlogCategory", b =>
@ -1383,6 +1403,8 @@ namespace Kurs.Platform.Migrations
b.HasKey("UserId", "BranchId");
b.HasIndex("BranchId");
b.ToTable("PBranchUsers", (string)null);
});
@ -1445,7 +1467,7 @@ namespace Kurs.Platform.Migrations
b.HasIndex("CountryCode", "Code")
.IsUnique();
b.ToTable("PCity", (string)null);
b.ToTable("DCity", (string)null);
});
modelBuilder.Entity("Kurs.Platform.Entities.Classroom", b =>
@ -1778,7 +1800,7 @@ namespace Kurs.Platform.Migrations
.HasColumnType("nvarchar(500)");
b.Property<string>("BankJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
@ -1819,7 +1841,7 @@ namespace Kurs.Platform.Migrations
.HasColumnType("nvarchar(150)");
b.Property<string>("MapJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("Phone")
.HasMaxLength(50)
@ -1834,7 +1856,7 @@ namespace Kurs.Platform.Migrations
.HasColumnName("TenantId");
b.Property<string>("WorkHoursJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.HasKey("Id");
@ -1895,7 +1917,6 @@ namespace Kurs.Platform.Migrations
.HasColumnType("nvarchar(128)");
b.Property<int>("PhoneCode")
.HasMaxLength(16)
.HasColumnType("int");
b.Property<bool>("StateRequired")
@ -1915,7 +1936,7 @@ namespace Kurs.Platform.Migrations
b.HasIndex("GroupName");
b.ToTable("PCountry", (string)null);
b.ToTable("DCountry", (string)null);
});
modelBuilder.Entity("Kurs.Platform.Entities.CountryGroup", b =>
@ -1963,7 +1984,7 @@ namespace Kurs.Platform.Migrations
b.HasIndex("Name")
.IsUnique();
b.ToTable("PCountryGroup", (string)null);
b.ToTable("DCountryGroup", (string)null);
});
modelBuilder.Entity("Kurs.Platform.Entities.Currency", b =>
@ -2029,7 +2050,7 @@ namespace Kurs.Platform.Migrations
b.HasKey("Id");
b.ToTable("PCurrency", (string)null);
b.ToTable("DCurrency", (string)null);
});
modelBuilder.Entity("Kurs.Platform.Entities.CustomComponent", b =>
@ -2155,10 +2176,10 @@ namespace Kurs.Platform.Migrations
.HasColumnType("nvarchar(128)");
b.Property<string>("ParametersJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("PermissionsJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("Sql")
.IsRequired()
@ -2534,7 +2555,7 @@ namespace Kurs.Platform.Migrations
.IsUnique()
.HasFilter("[CountryCode] IS NOT NULL AND [Township] IS NOT NULL AND [Street] IS NOT NULL AND [ZipCode] IS NOT NULL");
b.ToTable("PDistrict", (string)null);
b.ToTable("DDistrict", (string)null);
});
modelBuilder.Entity("Kurs.Platform.Entities.GlobalSearch", b =>
@ -2661,37 +2682,37 @@ namespace Kurs.Platform.Migrations
.HasColumnType("uniqueidentifier");
b.Property<string>("AdaptiveLayoutJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("AnimationJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("AnnotationsJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("ArgumentAxisJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("ColumnOptionJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("CommandColumnJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("CommonAnnotationsSettingsJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("CommonAxisSettingsJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("CommonJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("CommonPaneSettingsJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("CommonSeriesSettingsJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
@ -2702,33 +2723,33 @@ namespace Kurs.Platform.Migrations
.HasColumnName("CreatorId");
b.Property<string>("CrosshairJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("CultureName")
.HasMaxLength(10)
.HasColumnType("nvarchar(10)");
b.Property<string>("CustomJsSourcesJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("CustomStyleSourcesJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("DataSourceCode")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("DataSourceJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("DefaultFilter")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("DeleteCommand")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("DeleteFieldsDefaultValueJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("DeleteServiceAddress")
.HasMaxLength(256)
@ -2747,40 +2768,40 @@ namespace Kurs.Platform.Migrations
.HasColumnType("nvarchar(512)");
b.Property<string>("EditingFormJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("EditingOptionJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("ExportJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("ExtraFilterJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("FilterPanelJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("FilterRowJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("FormFieldsDefaultValueJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("GroupPanelJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("HeaderFilterJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<int?>("Height")
.HasColumnType("int");
b.Property<string>("InsertCommand")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("InsertFieldsDefaultValueJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("InsertServiceAddress")
.HasMaxLength(256)
@ -2820,10 +2841,10 @@ namespace Kurs.Platform.Migrations
.HasColumnName("LastModifierId");
b.Property<string>("LayoutJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("LegendJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("ListFormCode")
.IsRequired()
@ -2835,7 +2856,7 @@ namespace Kurs.Platform.Migrations
.HasColumnType("nvarchar(20)");
b.Property<string>("MarginJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("Name")
.HasMaxLength(128)
@ -2847,54 +2868,54 @@ namespace Kurs.Platform.Migrations
.HasDefaultValue(20);
b.Property<string>("PagerOptionJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("PanesJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("PermissionJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("PivotOptionJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("RoleId")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("ScrollBarJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("SearchPanelJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("SelectCommand")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<int>("SelectCommandType")
.HasColumnType("int");
b.Property<string>("SelectFieldsDefaultValueJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("SelectionJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("SeriesJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("SizeJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("SortMode")
.HasMaxLength(20)
.HasColumnType("nvarchar(20)");
b.Property<string>("StateStoringJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("SubFormsJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("TableName")
.HasMaxLength(128)
@ -2905,16 +2926,16 @@ namespace Kurs.Platform.Migrations
.HasColumnType("nvarchar(256)");
b.Property<string>("TitleJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("TooltipJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("UpdateCommand")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("UpdateFieldsDefaultValueJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("UpdateServiceAddress")
.HasMaxLength(256)
@ -2925,16 +2946,16 @@ namespace Kurs.Platform.Migrations
.HasColumnType("nvarchar(256)");
b.Property<string>("ValueAxisJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("WidgetsJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<int?>("Width")
.HasColumnType("int");
b.Property<string>("ZoomAndPanJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.HasKey("Id");
@ -2955,7 +2976,7 @@ namespace Kurs.Platform.Migrations
.HasColumnName("CreatorId");
b.Property<string>("CustomizationData")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<int>("CustomizationType")
.HasColumnType("int");
@ -3039,16 +3060,16 @@ namespace Kurs.Platform.Migrations
.HasColumnType("nvarchar(256)");
b.Property<string>("ColumnCustomizationJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("ColumnFilterJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("ColumnHeaderJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("ColumnStylingJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
@ -3071,10 +3092,10 @@ namespace Kurs.Platform.Migrations
.HasColumnName("DeletionTime");
b.Property<string>("EditingJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("EditorOptions")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("FieldName")
.IsRequired()
@ -3086,10 +3107,10 @@ namespace Kurs.Platform.Migrations
.HasColumnType("nvarchar(100)");
b.Property<string>("GroupSummaryJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("GroupingJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<bool?>("IsActive")
.ValueGeneratedOnAdd()
@ -3103,7 +3124,7 @@ namespace Kurs.Platform.Migrations
.HasColumnName("IsDeleted");
b.Property<string>("JoinTableJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
@ -3124,13 +3145,13 @@ namespace Kurs.Platform.Migrations
.HasDefaultValue(30);
b.Property<string>("LookupJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("PermissionJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("PivotSettingsJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("RoleId")
.HasMaxLength(256)
@ -3147,14 +3168,14 @@ namespace Kurs.Platform.Migrations
.HasColumnType("int");
b.Property<string>("TotalSummaryJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("UserId")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("ValidationRuleJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<bool?>("Visible")
.ValueGeneratedOnAdd()
@ -3215,8 +3236,8 @@ namespace Kurs.Platform.Migrations
b.Property<string>("ListFormCode")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("Status")
.IsRequired()
@ -3228,6 +3249,8 @@ namespace Kurs.Platform.Migrations
b.HasKey("Id");
b.HasIndex("ListFormCode");
b.ToTable("PListFormImport", (string)null);
});
@ -3261,7 +3284,7 @@ namespace Kurs.Platform.Migrations
.HasColumnType("int");
b.Property<string>("ErrorsJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<int>("ExecRows")
.HasColumnType("int");
@ -3296,6 +3319,8 @@ namespace Kurs.Platform.Migrations
b.HasKey("Id");
b.HasIndex("ImportId");
b.ToTable("PListFormImportExecute", (string)null);
});
@ -4043,7 +4068,7 @@ namespace Kurs.Platform.Migrations
b.HasKey("Id");
b.ToTable("PSector", (string)null);
b.ToTable("DSector", (string)null);
});
modelBuilder.Entity("Kurs.Platform.Entities.Service", b =>
@ -4156,7 +4181,7 @@ namespace Kurs.Platform.Migrations
b.HasIndex("SkillTypeId");
b.ToTable("PSkill", (string)null);
b.ToTable("DSkill", (string)null);
});
modelBuilder.Entity("Kurs.Platform.Entities.SkillLevel", b =>
@ -4216,7 +4241,7 @@ namespace Kurs.Platform.Migrations
b.HasIndex("SkillTypeId");
b.ToTable("PSkillLevel", (string)null);
b.ToTable("DSkillLevel", (string)null);
});
modelBuilder.Entity("Kurs.Platform.Entities.SkillType", b =>
@ -4264,7 +4289,7 @@ namespace Kurs.Platform.Migrations
b.HasIndex("Name")
.IsUnique();
b.ToTable("PSkillType", (string)null);
b.ToTable("DSkillType", (string)null);
});
modelBuilder.Entity("Kurs.Platform.Entities.Uom", b =>
@ -4330,7 +4355,7 @@ namespace Kurs.Platform.Migrations
b.HasIndex("UomCategoryId");
b.ToTable("PUom", (string)null);
b.ToTable("DUom", (string)null);
});
modelBuilder.Entity("Kurs.Platform.Entities.UomCategory", b =>
@ -4378,7 +4403,7 @@ namespace Kurs.Platform.Migrations
b.HasIndex("Name")
.IsUnique();
b.ToTable("PUomCategory", (string)null);
b.ToTable("DUomCategory", (string)null);
});
modelBuilder.Entity("Kurs.Platform.Forum.ForumCategory", b =>
@ -6554,10 +6579,54 @@ namespace Kurs.Platform.Migrations
modelBuilder.Entity("Kurs.Languages.Entities.LanguageText", b =>
{
b.HasOne("Kurs.Languages.Entities.LanguageKey", null)
b.HasOne("Kurs.Languages.Entities.Language", null)
.WithMany()
.HasForeignKey("CultureName")
.HasPrincipalKey("CultureName")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Kurs.Languages.Entities.LanguageKey", "LanguageKey")
.WithMany("Texts")
.HasForeignKey("ResourceName", "Key")
.OnDelete(DeleteBehavior.SetNull);
.HasPrincipalKey("ResourceName", "Key")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("LanguageKey");
});
modelBuilder.Entity("Kurs.MailQueue.Domain.Entities.BackgroundWorker_MailQueue", b =>
{
b.HasOne("Kurs.MailQueue.Domain.Entities.BackgroundWorker_MailQueueTableFormat", "TableFormat")
.WithMany("MailQueues")
.HasForeignKey("TableName")
.HasPrincipalKey("TableName")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("TableFormat");
});
modelBuilder.Entity("Kurs.MailQueue.Domain.Entities.BackgroundWorker_MailQueueEvents", b =>
{
b.HasOne("Kurs.MailQueue.Domain.Entities.BackgroundWorker_MailQueue", "MailQueue")
.WithMany("Events")
.HasForeignKey("AwsMessageId")
.HasPrincipalKey("AwsMessageId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("MailQueue");
});
modelBuilder.Entity("Kurs.Notifications.Entities.Notification", b =>
{
b.HasOne("Kurs.Notifications.Entities.NotificationRule", "NotificationRule")
.WithMany("Notifications")
.HasForeignKey("NotificationRuleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("NotificationRule");
});
modelBuilder.Entity("Kurs.Platform.Entities.ApiEndpoint", b =>
@ -6611,6 +6680,17 @@ namespace Kurs.Platform.Migrations
b.Navigation("Category");
});
modelBuilder.Entity("Kurs.Platform.Entities.BranchUsers", b =>
{
b.HasOne("Kurs.Platform.Entities.Branch", "Branch")
.WithMany("Users")
.HasForeignKey("BranchId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Branch");
});
modelBuilder.Entity("Kurs.Platform.Entities.City", b =>
{
b.HasOne("Kurs.Platform.Entities.Country", "Country")
@ -6707,6 +6787,25 @@ namespace Kurs.Platform.Migrations
.IsRequired();
});
modelBuilder.Entity("Kurs.Platform.Entities.ListFormImport", b =>
{
b.HasOne("Kurs.Platform.Entities.ListForm", null)
.WithMany()
.HasForeignKey("ListFormCode")
.HasPrincipalKey("ListFormCode")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Kurs.Platform.Entities.ListFormImportExecute", b =>
{
b.HasOne("Kurs.Platform.Entities.ListFormImport", null)
.WithMany()
.HasForeignKey("ImportId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Kurs.Platform.Entities.OrderItem", b =>
{
b.HasOne("Kurs.Platform.Entities.Order", "Order")
@ -6959,11 +7058,31 @@ namespace Kurs.Platform.Migrations
b.Navigation("Texts");
});
modelBuilder.Entity("Kurs.MailQueue.Domain.Entities.BackgroundWorker_MailQueue", b =>
{
b.Navigation("Events");
});
modelBuilder.Entity("Kurs.MailQueue.Domain.Entities.BackgroundWorker_MailQueueTableFormat", b =>
{
b.Navigation("MailQueues");
});
modelBuilder.Entity("Kurs.Notifications.Entities.NotificationRule", b =>
{
b.Navigation("Notifications");
});
modelBuilder.Entity("Kurs.Platform.Entities.BlogCategory", b =>
{
b.Navigation("Posts");
});
modelBuilder.Entity("Kurs.Platform.Entities.Branch", b =>
{
b.Navigation("Users");
});
modelBuilder.Entity("Kurs.Platform.Entities.City", b =>
{
b.Navigation("Districts");

View file

@ -70,7 +70,7 @@ namespace Kurs.Platform.Migrations
b.HasKey("Id");
b.ToTable("PContactTag", (string)null);
b.ToTable("DContactTag", (string)null);
});
modelBuilder.Entity("ContactTitle", b =>
@ -119,7 +119,7 @@ namespace Kurs.Platform.Migrations
b.HasKey("Id");
b.ToTable("PContactTitle", (string)null);
b.ToTable("DContactTitle", (string)null);
});
modelBuilder.Entity("Kurs.Languages.Entities.Language", b =>
@ -186,13 +186,9 @@ namespace Kurs.Platform.Migrations
modelBuilder.Entity("Kurs.Languages.Entities.LanguageKey", b =>
{
b.Property<string>("ResourceName")
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<string>("Key")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("uniqueidentifier");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
@ -210,15 +206,17 @@ namespace Kurs.Platform.Migrations
.HasColumnType("datetime2")
.HasColumnName("DeletionTime");
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
.HasColumnType("bit")
.HasDefaultValue(false)
.HasColumnName("IsDeleted");
b.Property<string>("Key")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
.HasColumnName("LastModificationTime");
@ -227,7 +225,15 @@ namespace Kurs.Platform.Migrations
.HasColumnType("uniqueidentifier")
.HasColumnName("LastModifierId");
b.HasKey("ResourceName", "Key");
b.Property<string>("ResourceName")
.IsRequired()
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.HasKey("Id");
b.HasIndex("ResourceName", "Key")
.IsUnique();
b.ToTable("PLanguageKey", (string)null);
});
@ -288,6 +294,8 @@ namespace Kurs.Platform.Migrations
b.HasKey("Id");
b.HasIndex("CultureName");
b.HasIndex("ResourceName", "Key");
b.ToTable("PLanguageText", (string)null);
@ -308,6 +316,7 @@ namespace Kurs.Platform.Migrations
.HasColumnType("nvarchar(500)");
b.Property<string>("AwsMessageId")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
@ -360,7 +369,7 @@ namespace Kurs.Platform.Migrations
b.Property<DateTime?>("SendTime")
.HasColumnType("datetime2");
b.Property<string>("Table")
b.Property<string>("TableName")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
@ -378,6 +387,8 @@ namespace Kurs.Platform.Migrations
b.HasKey("Id");
b.HasIndex("TableName");
b.ToTable("PBackgroundWorker_MailQueue", (string)null);
});
@ -438,6 +449,8 @@ namespace Kurs.Platform.Migrations
b.HasKey("Id");
b.HasIndex("AwsMessageId");
b.ToTable("PBackgroundWorker_MailQueueEvents", (string)null);
});
@ -500,8 +513,9 @@ namespace Kurs.Platform.Migrations
b.HasKey("Id");
b.HasIndex(new[] { "TableName", "Order" }, "IX_MailQueueTableFormat")
.IsUnique();
b.HasIndex("TableName", "Order")
.IsUnique()
.HasDatabaseName("IX_MailQueueTableFormat");
b.ToTable("PBackgroundWorker_MailQueueTableFormat", (string)null);
});
@ -530,7 +544,8 @@ namespace Kurs.Platform.Migrations
b.Property<string>("Identifier")
.IsRequired()
.HasColumnType("nvarchar(max)");
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
@ -554,14 +569,15 @@ namespace Kurs.Platform.Migrations
b.Property<string>("Message")
.IsRequired()
.HasColumnType("nvarchar(max)");
.HasMaxLength(2000)
.HasColumnType("nvarchar(2000)");
b.Property<string>("NotificationChannel")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("nvarchar(10)");
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<Guid?>("NotificationRuleId")
b.Property<Guid>("NotificationRuleId")
.HasColumnType("uniqueidentifier");
b.Property<string>("NotificationType")
@ -577,6 +593,8 @@ namespace Kurs.Platform.Migrations
b.HasKey("Id");
b.HasIndex("NotificationRuleId");
b.ToTable("PNotification", (string)null);
});
@ -588,8 +606,8 @@ namespace Kurs.Platform.Migrations
b.Property<string>("Channel")
.IsRequired()
.HasMaxLength(10)
.HasColumnType("nvarchar(10)");
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
@ -636,11 +654,13 @@ namespace Kurs.Platform.Migrations
.HasColumnType("nvarchar(100)");
b.Property<string>("RecipientId")
.HasColumnType("nvarchar(max)");
.HasMaxLength(200)
.HasColumnType("nvarchar(200)");
b.Property<string>("RecipientType")
.IsRequired()
.HasColumnType("nvarchar(max)");
.HasMaxLength(50)
.HasColumnType("nvarchar(50)");
b.HasKey("Id");
@ -669,7 +689,7 @@ namespace Kurs.Platform.Migrations
.HasColumnName("DeletionTime");
b.Property<string>("DescriptionsJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<bool>("IsDeleted")
.ValueGeneratedOnAdd()
@ -686,10 +706,10 @@ namespace Kurs.Platform.Migrations
.HasColumnName("LastModifierId");
b.Property<string>("SectionsJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("StatsJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<Guid?>("TenantId")
.HasColumnType("uniqueidentifier")
@ -915,7 +935,7 @@ namespace Kurs.Platform.Migrations
.HasColumnType("nvarchar(100)");
b.Property<string>("Options")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<int>("WorkerType")
.HasColumnType("int");
@ -1003,7 +1023,7 @@ namespace Kurs.Platform.Migrations
b.HasKey("Id");
b.ToTable("PBank", (string)null);
b.ToTable("DBank", (string)null);
});
modelBuilder.Entity("Kurs.Platform.Entities.BankAccount", b =>
@ -1070,7 +1090,7 @@ namespace Kurs.Platform.Migrations
b.HasIndex("CurrencyId");
b.ToTable("PBankAccount", (string)null);
b.ToTable("DBankAccount", (string)null);
});
modelBuilder.Entity("Kurs.Platform.Entities.BlogCategory", b =>
@ -1380,6 +1400,8 @@ namespace Kurs.Platform.Migrations
b.HasKey("UserId", "BranchId");
b.HasIndex("BranchId");
b.ToTable("PBranchUsers", (string)null);
});
@ -1442,7 +1464,7 @@ namespace Kurs.Platform.Migrations
b.HasIndex("CountryCode", "Code")
.IsUnique();
b.ToTable("PCity", (string)null);
b.ToTable("DCity", (string)null);
});
modelBuilder.Entity("Kurs.Platform.Entities.Classroom", b =>
@ -1775,7 +1797,7 @@ namespace Kurs.Platform.Migrations
.HasColumnType("nvarchar(500)");
b.Property<string>("BankJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
@ -1816,7 +1838,7 @@ namespace Kurs.Platform.Migrations
.HasColumnType("nvarchar(150)");
b.Property<string>("MapJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("Phone")
.HasMaxLength(50)
@ -1831,7 +1853,7 @@ namespace Kurs.Platform.Migrations
.HasColumnName("TenantId");
b.Property<string>("WorkHoursJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.HasKey("Id");
@ -1892,7 +1914,6 @@ namespace Kurs.Platform.Migrations
.HasColumnType("nvarchar(128)");
b.Property<int>("PhoneCode")
.HasMaxLength(16)
.HasColumnType("int");
b.Property<bool>("StateRequired")
@ -1912,7 +1933,7 @@ namespace Kurs.Platform.Migrations
b.HasIndex("GroupName");
b.ToTable("PCountry", (string)null);
b.ToTable("DCountry", (string)null);
});
modelBuilder.Entity("Kurs.Platform.Entities.CountryGroup", b =>
@ -1960,7 +1981,7 @@ namespace Kurs.Platform.Migrations
b.HasIndex("Name")
.IsUnique();
b.ToTable("PCountryGroup", (string)null);
b.ToTable("DCountryGroup", (string)null);
});
modelBuilder.Entity("Kurs.Platform.Entities.Currency", b =>
@ -2026,7 +2047,7 @@ namespace Kurs.Platform.Migrations
b.HasKey("Id");
b.ToTable("PCurrency", (string)null);
b.ToTable("DCurrency", (string)null);
});
modelBuilder.Entity("Kurs.Platform.Entities.CustomComponent", b =>
@ -2152,10 +2173,10 @@ namespace Kurs.Platform.Migrations
.HasColumnType("nvarchar(128)");
b.Property<string>("ParametersJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("PermissionsJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("Sql")
.IsRequired()
@ -2531,7 +2552,7 @@ namespace Kurs.Platform.Migrations
.IsUnique()
.HasFilter("[CountryCode] IS NOT NULL AND [Township] IS NOT NULL AND [Street] IS NOT NULL AND [ZipCode] IS NOT NULL");
b.ToTable("PDistrict", (string)null);
b.ToTable("DDistrict", (string)null);
});
modelBuilder.Entity("Kurs.Platform.Entities.GlobalSearch", b =>
@ -2658,37 +2679,37 @@ namespace Kurs.Platform.Migrations
.HasColumnType("uniqueidentifier");
b.Property<string>("AdaptiveLayoutJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("AnimationJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("AnnotationsJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("ArgumentAxisJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("ColumnOptionJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("CommandColumnJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("CommonAnnotationsSettingsJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("CommonAxisSettingsJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("CommonJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("CommonPaneSettingsJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("CommonSeriesSettingsJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
@ -2699,33 +2720,33 @@ namespace Kurs.Platform.Migrations
.HasColumnName("CreatorId");
b.Property<string>("CrosshairJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("CultureName")
.HasMaxLength(10)
.HasColumnType("nvarchar(10)");
b.Property<string>("CustomJsSourcesJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("CustomStyleSourcesJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("DataSourceCode")
.HasMaxLength(100)
.HasColumnType("nvarchar(100)");
b.Property<string>("DataSourceJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("DefaultFilter")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("DeleteCommand")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("DeleteFieldsDefaultValueJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("DeleteServiceAddress")
.HasMaxLength(256)
@ -2744,40 +2765,40 @@ namespace Kurs.Platform.Migrations
.HasColumnType("nvarchar(512)");
b.Property<string>("EditingFormJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("EditingOptionJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("ExportJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("ExtraFilterJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("FilterPanelJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("FilterRowJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("FormFieldsDefaultValueJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("GroupPanelJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("HeaderFilterJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<int?>("Height")
.HasColumnType("int");
b.Property<string>("InsertCommand")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("InsertFieldsDefaultValueJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("InsertServiceAddress")
.HasMaxLength(256)
@ -2817,10 +2838,10 @@ namespace Kurs.Platform.Migrations
.HasColumnName("LastModifierId");
b.Property<string>("LayoutJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("LegendJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("ListFormCode")
.IsRequired()
@ -2832,7 +2853,7 @@ namespace Kurs.Platform.Migrations
.HasColumnType("nvarchar(20)");
b.Property<string>("MarginJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("Name")
.HasMaxLength(128)
@ -2844,54 +2865,54 @@ namespace Kurs.Platform.Migrations
.HasDefaultValue(20);
b.Property<string>("PagerOptionJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("PanesJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("PermissionJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("PivotOptionJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("RoleId")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("ScrollBarJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("SearchPanelJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("SelectCommand")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<int>("SelectCommandType")
.HasColumnType("int");
b.Property<string>("SelectFieldsDefaultValueJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("SelectionJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("SeriesJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("SizeJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("SortMode")
.HasMaxLength(20)
.HasColumnType("nvarchar(20)");
b.Property<string>("StateStoringJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("SubFormsJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("TableName")
.HasMaxLength(128)
@ -2902,16 +2923,16 @@ namespace Kurs.Platform.Migrations
.HasColumnType("nvarchar(256)");
b.Property<string>("TitleJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("TooltipJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("UpdateCommand")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("UpdateFieldsDefaultValueJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("UpdateServiceAddress")
.HasMaxLength(256)
@ -2922,16 +2943,16 @@ namespace Kurs.Platform.Migrations
.HasColumnType("nvarchar(256)");
b.Property<string>("ValueAxisJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("WidgetsJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<int?>("Width")
.HasColumnType("int");
b.Property<string>("ZoomAndPanJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.HasKey("Id");
@ -2952,7 +2973,7 @@ namespace Kurs.Platform.Migrations
.HasColumnName("CreatorId");
b.Property<string>("CustomizationData")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<int>("CustomizationType")
.HasColumnType("int");
@ -3036,16 +3057,16 @@ namespace Kurs.Platform.Migrations
.HasColumnType("nvarchar(256)");
b.Property<string>("ColumnCustomizationJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("ColumnFilterJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("ColumnHeaderJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("ColumnStylingJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
@ -3068,10 +3089,10 @@ namespace Kurs.Platform.Migrations
.HasColumnName("DeletionTime");
b.Property<string>("EditingJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("EditorOptions")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("FieldName")
.IsRequired()
@ -3083,10 +3104,10 @@ namespace Kurs.Platform.Migrations
.HasColumnType("nvarchar(100)");
b.Property<string>("GroupSummaryJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("GroupingJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<bool?>("IsActive")
.ValueGeneratedOnAdd()
@ -3100,7 +3121,7 @@ namespace Kurs.Platform.Migrations
.HasColumnName("IsDeleted");
b.Property<string>("JoinTableJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<DateTime?>("LastModificationTime")
.HasColumnType("datetime2")
@ -3121,13 +3142,13 @@ namespace Kurs.Platform.Migrations
.HasDefaultValue(30);
b.Property<string>("LookupJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("PermissionJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("PivotSettingsJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("RoleId")
.HasMaxLength(256)
@ -3144,14 +3165,14 @@ namespace Kurs.Platform.Migrations
.HasColumnType("int");
b.Property<string>("TotalSummaryJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<string>("UserId")
.HasMaxLength(256)
.HasColumnType("nvarchar(256)");
b.Property<string>("ValidationRuleJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<bool?>("Visible")
.ValueGeneratedOnAdd()
@ -3212,8 +3233,8 @@ namespace Kurs.Platform.Migrations
b.Property<string>("ListFormCode")
.IsRequired()
.HasMaxLength(128)
.HasColumnType("nvarchar(128)");
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("Status")
.IsRequired()
@ -3225,6 +3246,8 @@ namespace Kurs.Platform.Migrations
b.HasKey("Id");
b.HasIndex("ListFormCode");
b.ToTable("PListFormImport", (string)null);
});
@ -3258,7 +3281,7 @@ namespace Kurs.Platform.Migrations
.HasColumnType("int");
b.Property<string>("ErrorsJson")
.HasColumnType("nvarchar(max)");
.HasColumnType("text");
b.Property<int>("ExecRows")
.HasColumnType("int");
@ -3293,6 +3316,8 @@ namespace Kurs.Platform.Migrations
b.HasKey("Id");
b.HasIndex("ImportId");
b.ToTable("PListFormImportExecute", (string)null);
});
@ -4040,7 +4065,7 @@ namespace Kurs.Platform.Migrations
b.HasKey("Id");
b.ToTable("PSector", (string)null);
b.ToTable("DSector", (string)null);
});
modelBuilder.Entity("Kurs.Platform.Entities.Service", b =>
@ -4153,7 +4178,7 @@ namespace Kurs.Platform.Migrations
b.HasIndex("SkillTypeId");
b.ToTable("PSkill", (string)null);
b.ToTable("DSkill", (string)null);
});
modelBuilder.Entity("Kurs.Platform.Entities.SkillLevel", b =>
@ -4213,7 +4238,7 @@ namespace Kurs.Platform.Migrations
b.HasIndex("SkillTypeId");
b.ToTable("PSkillLevel", (string)null);
b.ToTable("DSkillLevel", (string)null);
});
modelBuilder.Entity("Kurs.Platform.Entities.SkillType", b =>
@ -4261,7 +4286,7 @@ namespace Kurs.Platform.Migrations
b.HasIndex("Name")
.IsUnique();
b.ToTable("PSkillType", (string)null);
b.ToTable("DSkillType", (string)null);
});
modelBuilder.Entity("Kurs.Platform.Entities.Uom", b =>
@ -4327,7 +4352,7 @@ namespace Kurs.Platform.Migrations
b.HasIndex("UomCategoryId");
b.ToTable("PUom", (string)null);
b.ToTable("DUom", (string)null);
});
modelBuilder.Entity("Kurs.Platform.Entities.UomCategory", b =>
@ -4375,7 +4400,7 @@ namespace Kurs.Platform.Migrations
b.HasIndex("Name")
.IsUnique();
b.ToTable("PUomCategory", (string)null);
b.ToTable("DUomCategory", (string)null);
});
modelBuilder.Entity("Kurs.Platform.Forum.ForumCategory", b =>
@ -6551,10 +6576,54 @@ namespace Kurs.Platform.Migrations
modelBuilder.Entity("Kurs.Languages.Entities.LanguageText", b =>
{
b.HasOne("Kurs.Languages.Entities.LanguageKey", null)
b.HasOne("Kurs.Languages.Entities.Language", null)
.WithMany()
.HasForeignKey("CultureName")
.HasPrincipalKey("CultureName")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("Kurs.Languages.Entities.LanguageKey", "LanguageKey")
.WithMany("Texts")
.HasForeignKey("ResourceName", "Key")
.OnDelete(DeleteBehavior.SetNull);
.HasPrincipalKey("ResourceName", "Key")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("LanguageKey");
});
modelBuilder.Entity("Kurs.MailQueue.Domain.Entities.BackgroundWorker_MailQueue", b =>
{
b.HasOne("Kurs.MailQueue.Domain.Entities.BackgroundWorker_MailQueueTableFormat", "TableFormat")
.WithMany("MailQueues")
.HasForeignKey("TableName")
.HasPrincipalKey("TableName")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("TableFormat");
});
modelBuilder.Entity("Kurs.MailQueue.Domain.Entities.BackgroundWorker_MailQueueEvents", b =>
{
b.HasOne("Kurs.MailQueue.Domain.Entities.BackgroundWorker_MailQueue", "MailQueue")
.WithMany("Events")
.HasForeignKey("AwsMessageId")
.HasPrincipalKey("AwsMessageId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("MailQueue");
});
modelBuilder.Entity("Kurs.Notifications.Entities.Notification", b =>
{
b.HasOne("Kurs.Notifications.Entities.NotificationRule", "NotificationRule")
.WithMany("Notifications")
.HasForeignKey("NotificationRuleId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("NotificationRule");
});
modelBuilder.Entity("Kurs.Platform.Entities.ApiEndpoint", b =>
@ -6608,6 +6677,17 @@ namespace Kurs.Platform.Migrations
b.Navigation("Category");
});
modelBuilder.Entity("Kurs.Platform.Entities.BranchUsers", b =>
{
b.HasOne("Kurs.Platform.Entities.Branch", "Branch")
.WithMany("Users")
.HasForeignKey("BranchId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Branch");
});
modelBuilder.Entity("Kurs.Platform.Entities.City", b =>
{
b.HasOne("Kurs.Platform.Entities.Country", "Country")
@ -6704,6 +6784,25 @@ namespace Kurs.Platform.Migrations
.IsRequired();
});
modelBuilder.Entity("Kurs.Platform.Entities.ListFormImport", b =>
{
b.HasOne("Kurs.Platform.Entities.ListForm", null)
.WithMany()
.HasForeignKey("ListFormCode")
.HasPrincipalKey("ListFormCode")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Kurs.Platform.Entities.ListFormImportExecute", b =>
{
b.HasOne("Kurs.Platform.Entities.ListFormImport", null)
.WithMany()
.HasForeignKey("ImportId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("Kurs.Platform.Entities.OrderItem", b =>
{
b.HasOne("Kurs.Platform.Entities.Order", "Order")
@ -6956,11 +7055,31 @@ namespace Kurs.Platform.Migrations
b.Navigation("Texts");
});
modelBuilder.Entity("Kurs.MailQueue.Domain.Entities.BackgroundWorker_MailQueue", b =>
{
b.Navigation("Events");
});
modelBuilder.Entity("Kurs.MailQueue.Domain.Entities.BackgroundWorker_MailQueueTableFormat", b =>
{
b.Navigation("MailQueues");
});
modelBuilder.Entity("Kurs.Notifications.Entities.NotificationRule", b =>
{
b.Navigation("Notifications");
});
modelBuilder.Entity("Kurs.Platform.Entities.BlogCategory", b =>
{
b.Navigation("Posts");
});
modelBuilder.Entity("Kurs.Platform.Entities.Branch", b =>
{
b.Navigation("Users");
});
modelBuilder.Entity("Kurs.Platform.Entities.City", b =>
{
b.Navigation("Districts");