diff --git a/services/Archival/FilterLists.Archival.Application/Commands/ArchiveList.cs b/services/Archival/FilterLists.Archival.Application/Commands/ArchiveList.cs index 580559c78..842a38618 100644 --- a/services/Archival/FilterLists.Archival.Application/Commands/ArchiveList.cs +++ b/services/Archival/FilterLists.Archival.Application/Commands/ArchiveList.cs @@ -10,7 +10,7 @@ namespace FilterLists.Archival.Application.Commands; public static class ArchiveList { - public record Command(int ListId) : IRequest; + public record Command(long ListId) : IRequest; internal class Handler : IRequestHandler { @@ -56,7 +56,7 @@ public async Task Handle(Command request, CancellationToken cancellationTo } private async Task> GetSegmentUrlsAsync( - int listId, + long listId, CancellationToken cancellationToken) { var listDetails = await _directory.GetListDetailsAsync(listId, cancellationToken); @@ -66,7 +66,7 @@ public async Task Handle(Command request, CancellationToken cancellationTo } private ListArchive GetList( - int listId, + long listId, IEnumerable segmentUrls, CancellationToken cancellationToken) { diff --git a/services/Archival/FilterLists.Archival.Domain/ListArchives/ListArchive.cs b/services/Archival/FilterLists.Archival.Domain/ListArchives/ListArchive.cs index 025f425d1..027673ce0 100644 --- a/services/Archival/FilterLists.Archival.Domain/ListArchives/ListArchive.cs +++ b/services/Archival/FilterLists.Archival.Domain/ListArchives/ListArchive.cs @@ -1,3 +1,3 @@ namespace FilterLists.Archival.Domain.ListArchives; -public record ListArchive(int Id, IAsyncEnumerable Segments); +public record ListArchive(long Id, IAsyncEnumerable Segments); diff --git a/services/Archival/FilterLists.Archival.Infrastructure/Persistence/GitListArchiveRepository.cs b/services/Archival/FilterLists.Archival.Infrastructure/Persistence/GitListArchiveRepository.cs index f64335c32..07f332558 100644 --- a/services/Archival/FilterLists.Archival.Infrastructure/Persistence/GitListArchiveRepository.cs +++ b/services/Archival/FilterLists.Archival.Infrastructure/Persistence/GitListArchiveRepository.cs @@ -102,7 +102,7 @@ public void Dispose() _repo.CheckoutPaths("HEAD", _writtenFiles.Select(f => f.Name)); } - private FileInfo? GetTargetFile(int listId, int segmentNumber, ListFileExtension extension) + private FileInfo? GetTargetFile(long listId, int segmentNumber, ListFileExtension extension) { string targetExtension; if (extension.IsPlainText) @@ -121,7 +121,7 @@ public void Dispose() return new FileInfo(Path.Combine(_options.RepositoryPath, targetFileName)); } - private static string GetTargetFileNamePrefix(int listId) + private static string GetTargetFileNamePrefix(long listId) { return listId.ToString(CultureInfo.InvariantCulture).PadLeft(5, '0'); } diff --git a/services/Directory/FilterLists.Directory.Api.Contracts/IDirectoryApi.cs b/services/Directory/FilterLists.Directory.Api.Contracts/IDirectoryApi.cs index 63a7fb984..5ae3fc818 100644 --- a/services/Directory/FilterLists.Directory.Api.Contracts/IDirectoryApi.cs +++ b/services/Directory/FilterLists.Directory.Api.Contracts/IDirectoryApi.cs @@ -9,5 +9,5 @@ public interface IDirectoryApi Task> GetListsAsync(CancellationToken cancellationToken); [Get("/lists/{id}")] - Task GetListDetailsAsync(int id, CancellationToken cancellationToken); + Task GetListDetailsAsync(long id, CancellationToken cancellationToken); } diff --git a/services/Directory/FilterLists.Directory.Api.Contracts/Models/ListDetailsVm.cs b/services/Directory/FilterLists.Directory.Api.Contracts/Models/ListDetailsVm.cs index 6b468e6a9..e01f8c9bd 100644 --- a/services/Directory/FilterLists.Directory.Api.Contracts/Models/ListDetailsVm.cs +++ b/services/Directory/FilterLists.Directory.Api.Contracts/Models/ListDetailsVm.cs @@ -2,13 +2,13 @@ public record ListDetailsVm { - public int Id { get; init; } + public long Id { get; init; } public string Name { get; init; } = null!; public string? Description { get; init; } - public int? LicenseId { get; init; } - public IEnumerable SyntaxIds { get; init; } = new HashSet(); - public IEnumerable Iso6391s { get; init; } = new HashSet(); - public IEnumerable TagIds { get; init; } = new HashSet(); + public long? LicenseId { get; init; } + public IEnumerable SyntaxIds { get; init; } = new HashSet(); + public IEnumerable LanguageIds { get; init; } = new HashSet(); + public IEnumerable TagIds { get; init; } = new HashSet(); public IEnumerable ViewUrls { get; init; } = new HashSet(); public Uri? HomeUrl { get; init; } public Uri? OnionUrl { get; init; } @@ -19,13 +19,13 @@ public record ListDetailsVm public Uri? ChatUrl { get; init; } public string? EmailAddress { get; init; } public Uri? DonateUrl { get; init; } - public IEnumerable MaintainerIds { get; init; } = new HashSet(); - public IEnumerable UpstreamFilterListIds { get; init; } = new HashSet(); - public IEnumerable ForkFilterListIds { get; init; } = new HashSet(); - public IEnumerable IncludedInFilterListIds { get; init; } = new HashSet(); - public IEnumerable IncludesFilterListIds { get; init; } = new HashSet(); - public IEnumerable DependencyFilterListIds { get; init; } = new HashSet(); - public IEnumerable DependentFilterListIds { get; init; } = new HashSet(); + public IEnumerable MaintainerIds { get; init; } = new HashSet(); + public IEnumerable UpstreamFilterListIds { get; init; } = new HashSet(); + public IEnumerable ForkFilterListIds { get; init; } = new HashSet(); + public IEnumerable IncludedInFilterListIds { get; init; } = new HashSet(); + public IEnumerable IncludesFilterListIds { get; init; } = new HashSet(); + public IEnumerable DependencyFilterListIds { get; init; } = new HashSet(); + public IEnumerable DependentFilterListIds { get; init; } = new HashSet(); public record ViewUrlVm { diff --git a/services/Directory/FilterLists.Directory.Api.Contracts/Models/ListVm.cs b/services/Directory/FilterLists.Directory.Api.Contracts/Models/ListVm.cs index c270ec490..f708a758a 100644 --- a/services/Directory/FilterLists.Directory.Api.Contracts/Models/ListVm.cs +++ b/services/Directory/FilterLists.Directory.Api.Contracts/Models/ListVm.cs @@ -2,13 +2,13 @@ public record ListVm { - public int Id { get; init; } + public long Id { get; init; } public string Name { get; init; } = null!; public string? Description { get; init; } - public int? LicenseId { get; init; } - public IEnumerable SyntaxIds { get; init; } = new HashSet(); - public IEnumerable Iso6391s { get; init; } = new HashSet(); - public IEnumerable TagIds { get; init; } = new HashSet(); + public long? LicenseId { get; init; } + public IEnumerable SyntaxIds { get; init; } = new HashSet(); + public IEnumerable LanguageIds { get; init; } = new HashSet(); + public IEnumerable TagIds { get; init; } = new HashSet(); public Uri? PrimaryViewUrl { get; init; } - public IEnumerable MaintainerIds { get; init; } = new HashSet(); + public IEnumerable MaintainerIds { get; init; } = new HashSet(); } diff --git a/services/Directory/FilterLists.Directory.Api/Controllers/BaseController.cs b/services/Directory/FilterLists.Directory.Api/Controllers/BaseController.cs index 1e470c010..202b09715 100644 --- a/services/Directory/FilterLists.Directory.Api/Controllers/BaseController.cs +++ b/services/Directory/FilterLists.Directory.Api/Controllers/BaseController.cs @@ -19,7 +19,7 @@ protected BaseController(IMemoryCache cache) /// https://stackoverflow.com/a/52506210/2343739 protected async Task CacheGetOrCreateAsync( Func> actionAsync, - int? keySuffix = default, + long? keySuffix = default, TimeSpan? absoluteExpirationRelativeToNow = default, [CallerMemberName] string key = default!) { diff --git a/services/Directory/FilterLists.Directory.Api/Controllers/ListsController.cs b/services/Directory/FilterLists.Directory.Api/Controllers/ListsController.cs index 764b4d1a1..daf295203 100644 --- a/services/Directory/FilterLists.Directory.Api/Controllers/ListsController.cs +++ b/services/Directory/FilterLists.Directory.Api/Controllers/ListsController.cs @@ -33,10 +33,10 @@ public Task Get(CancellationToken cancellationToken) /// The identifier of the FilterList. /// The cancellation token. /// The details of the FilterList. - [HttpGet("{id:int}")] + [HttpGet("{id:long}")] [ProducesResponseType(typeof(ListDetailsVm), StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status404NotFound)] - public Task GetDetails(int id, CancellationToken cancellationToken) + public Task GetDetails(long id, CancellationToken cancellationToken) { return CacheGetOrCreateAsync(() => _mediator.Send(new GetListDetails.Query(id), cancellationToken), id); } diff --git a/services/Directory/FilterLists.Directory.Application/Queries/GetLanguages.cs b/services/Directory/FilterLists.Directory.Application/Queries/GetLanguages.cs index 0d2952ceb..2ecb56815 100644 --- a/services/Directory/FilterLists.Directory.Application/Queries/GetLanguages.cs +++ b/services/Directory/FilterLists.Directory.Application/Queries/GetLanguages.cs @@ -46,8 +46,9 @@ public LanguageVmProfile() public record LanguageVm { + public long Id { get; init; } public string Iso6391 { get; init; } = null!; public string Name { get; init; } = null!; - public IEnumerable FilterListIds { get; init; } = new HashSet(); + public IEnumerable FilterListIds { get; init; } = new HashSet(); } } diff --git a/services/Directory/FilterLists.Directory.Application/Queries/GetLicenses.cs b/services/Directory/FilterLists.Directory.Application/Queries/GetLicenses.cs index 8ce1f0f5a..eadfbeaa0 100644 --- a/services/Directory/FilterLists.Directory.Application/Queries/GetLicenses.cs +++ b/services/Directory/FilterLists.Directory.Application/Queries/GetLicenses.cs @@ -44,12 +44,12 @@ public LicenseVmProfile() public record LicenseVm { - public int Id { get; init; } + public long Id { get; init; } public string Name { get; init; } = null!; public Uri? Url { get; init; } public bool PermitsModification { get; init; } public bool PermitsDistribution { get; init; } public bool PermitsCommercialUse { get; init; } - public IEnumerable FilterListIds { get; init; } = new HashSet(); + public IEnumerable FilterListIds { get; init; } = new HashSet(); } } diff --git a/services/Directory/FilterLists.Directory.Application/Queries/GetListDetails.cs b/services/Directory/FilterLists.Directory.Application/Queries/GetListDetails.cs index 514bf83ea..aa087b6b1 100644 --- a/services/Directory/FilterLists.Directory.Application/Queries/GetListDetails.cs +++ b/services/Directory/FilterLists.Directory.Application/Queries/GetListDetails.cs @@ -11,7 +11,7 @@ namespace FilterLists.Directory.Application.Queries; public static class GetListDetails { - public record Query(int Id) : IRequest; + public record Query(long Id) : IRequest; internal class Validator : AbstractValidator { @@ -51,9 +51,9 @@ public ListDetailsVmProfile() .ForMember(fl => fl.SyntaxIds, o => o.MapFrom(fl => fl.FilterListSyntaxes.OrderBy(fls => fls.SyntaxId).Select(fls => fls.SyntaxId))) - .ForMember(fl => fl.Iso6391s, + .ForMember(fl => fl.LanguageIds, o => o.MapFrom(fl => - fl.FilterListLanguages.OrderBy(fll => fll.Iso6391).Select(fll => fll.Iso6391))) + fl.FilterListLanguages.OrderBy(fll => fll.LanguageId).Select(fll => fll.LanguageId))) .ForMember(fl => fl.TagIds, o => o.MapFrom(fl => fl.FilterListTags.OrderBy(flt => flt.TagId).Select(flt => flt.TagId))) diff --git a/services/Directory/FilterLists.Directory.Application/Queries/GetLists.cs b/services/Directory/FilterLists.Directory.Application/Queries/GetLists.cs index e76219ece..25853a57d 100644 --- a/services/Directory/FilterLists.Directory.Application/Queries/GetLists.cs +++ b/services/Directory/FilterLists.Directory.Application/Queries/GetLists.cs @@ -42,9 +42,9 @@ public ListVmProfile() .ForMember(fl => fl.SyntaxIds, o => o.MapFrom(fl => fl.FilterListSyntaxes.OrderBy(fls => fls.SyntaxId).Select(fls => fls.SyntaxId))) - .ForMember(fl => fl.Iso6391s, + .ForMember(fl => fl.LanguageIds, o => o.MapFrom(fl => - fl.FilterListLanguages.OrderBy(fll => fll.Iso6391).Select(fll => fll.Iso6391))) + fl.FilterListLanguages.OrderBy(fll => fll.LanguageId).Select(fll => fll.LanguageId))) .ForMember(fl => fl.TagIds, o => o.MapFrom(fl => fl.FilterListTags.OrderBy(flt => flt.TagId).Select(flt => flt.TagId))) diff --git a/services/Directory/FilterLists.Directory.Application/Queries/GetMaintainers.cs b/services/Directory/FilterLists.Directory.Application/Queries/GetMaintainers.cs index c16058924..5ad602212 100644 --- a/services/Directory/FilterLists.Directory.Application/Queries/GetMaintainers.cs +++ b/services/Directory/FilterLists.Directory.Application/Queries/GetMaintainers.cs @@ -46,11 +46,11 @@ public MaintainerVmProfile() public record MaintainerVm { - public int Id { get; init; } + public long Id { get; init; } public string Name { get; init; } = null!; public Uri? Url { get; init; } public string? EmailAddress { get; init; } public string? TwitterHandle { get; init; } - public IEnumerable FilterListIds { get; init; } = new HashSet(); + public IEnumerable FilterListIds { get; init; } = new HashSet(); } } diff --git a/services/Directory/FilterLists.Directory.Application/Queries/GetSoftware.cs b/services/Directory/FilterLists.Directory.Application/Queries/GetSoftware.cs index c683a9acb..d66134bbc 100644 --- a/services/Directory/FilterLists.Directory.Application/Queries/GetSoftware.cs +++ b/services/Directory/FilterLists.Directory.Application/Queries/GetSoftware.cs @@ -45,12 +45,12 @@ public SoftwareVmProfile() public record SoftwareVm { - public int Id { get; init; } + public long Id { get; init; } public string Name { get; init; } = null!; public string? Description { get; init; } public Uri? HomeUrl { get; init; } public Uri? DownloadUrl { get; init; } public bool SupportsAbpUrlScheme { get; init; } - public IEnumerable SyntaxIds { get; init; } = new HashSet(); + public IEnumerable SyntaxIds { get; init; } = new HashSet(); } } diff --git a/services/Directory/FilterLists.Directory.Application/Queries/GetSyntaxes.cs b/services/Directory/FilterLists.Directory.Application/Queries/GetSyntaxes.cs index 949f4e926..976695ca4 100644 --- a/services/Directory/FilterLists.Directory.Application/Queries/GetSyntaxes.cs +++ b/services/Directory/FilterLists.Directory.Application/Queries/GetSyntaxes.cs @@ -49,11 +49,11 @@ public SyntaxVmProfile() public record SyntaxVm { - public int Id { get; init; } + public long Id { get; init; } public string Name { get; init; } = null!; public string? Description { get; init; } public Uri? Url { get; init; } - public IEnumerable FilterListIds { get; init; } = new HashSet(); - public IEnumerable SoftwareIds { get; init; } = new HashSet(); + public IEnumerable FilterListIds { get; init; } = new HashSet(); + public IEnumerable SoftwareIds { get; init; } = new HashSet(); } } diff --git a/services/Directory/FilterLists.Directory.Application/Queries/GetTags.cs b/services/Directory/FilterLists.Directory.Application/Queries/GetTags.cs index 577f69342..866e9959b 100644 --- a/services/Directory/FilterLists.Directory.Application/Queries/GetTags.cs +++ b/services/Directory/FilterLists.Directory.Application/Queries/GetTags.cs @@ -46,9 +46,9 @@ public TagVmProfile() public record TagVm { - public int Id { get; init; } + public long Id { get; init; } public string Name { get; init; } = null!; public string? Description { get; init; } - public IEnumerable FilterListIds { get; init; } = new HashSet(); + public IEnumerable FilterListIds { get; init; } = new HashSet(); } } diff --git a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/AggregateRoot.cs b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/AggregateRoot.cs index 9f1aad92b..5b060ae19 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/AggregateRoot.cs +++ b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/AggregateRoot.cs @@ -3,7 +3,7 @@ namespace FilterLists.Directory.Infrastructure.Persistence.Queries.Entities; -public abstract record AggregateRoot +public abstract record AggregateRoot : Entity { // TODO: change 'set' to 'init' when no longer seeding from json public bool IsApproved { get; set; } diff --git a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Dependent.cs b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Dependent.cs index e92de6db7..845568269 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Dependent.cs +++ b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Dependent.cs @@ -7,9 +7,9 @@ namespace FilterLists.Directory.Infrastructure.Persistence.Queries.Entities; public record Dependent { - public int DependencyFilterListId { get; init; } + public long DependencyFilterListId { get; init; } public FilterList DependencyFilterList { get; init; } = null!; - public int DependentFilterListId { get; init; } + public long DependentFilterListId { get; init; } public FilterList DependentFilterList { get; init; } = null!; } diff --git a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Entity.cs b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Entity.cs new file mode 100644 index 000000000..3692cb298 --- /dev/null +++ b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Entity.cs @@ -0,0 +1,6 @@ +namespace FilterLists.Directory.Infrastructure.Persistence.Queries.Entities; + +public abstract record Entity +{ + public long Id { get; init; } +} diff --git a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterList.cs b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterList.cs index 659b6da9f..dc044fe47 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterList.cs +++ b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterList.cs @@ -5,10 +5,9 @@ namespace FilterLists.Directory.Infrastructure.Persistence.Queries.Entities; public record FilterList : AggregateRoot { - public int Id { get; init; } public string Name { get; init; } = null!; public string? Description { get; init; } - public int LicenseId { get; init; } + public long LicenseId { get; init; } public License License { get; init; } = null!; public IEnumerable FilterListSyntaxes { get; init; } = new HashSet(); public IEnumerable FilterListLanguages { get; init; } = new HashSet(); diff --git a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterListLanguage.cs b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterListLanguage.cs index 2266b5e07..8aeaa2b13 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterListLanguage.cs +++ b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterListLanguage.cs @@ -7,9 +7,9 @@ namespace FilterLists.Directory.Infrastructure.Persistence.Queries.Entities; public record FilterListLanguage { - public int FilterListId { get; init; } + public long FilterListId { get; init; } public FilterList FilterList { get; init; } = null!; - public string Iso6391 { get; init; } = null!; + public long LanguageId { get; init; } public Language Language { get; init; } = null!; } @@ -21,11 +21,7 @@ public virtual void Configure(EntityTypeBuilder builder) var nr = new SnakeCaseNameRewriter(CultureInfo.InvariantCulture); builder.ToTable($"{nr.RewriteName(nameof(FilterListLanguage))}s"); - builder.HasKey(fll => new { fll.FilterListId, fll.Iso6391 }); - builder.HasOne(fll => fll.Language) - .WithMany(l => l.FilterListLanguages) - .HasForeignKey(fll => fll.Iso6391) - .HasConstraintName("fk_filter_list_languages_languages_iso6391"); + builder.HasKey(fll => new { fll.FilterListId, fll.LanguageId }); builder.HasQueryFilter(fll => fll.FilterList.IsApproved && fll.Language.IsApproved); builder.HasDataJsonFile(); } diff --git a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterListMaintainer.cs b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterListMaintainer.cs index 4ac75410b..2ec3475a7 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterListMaintainer.cs +++ b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterListMaintainer.cs @@ -7,9 +7,9 @@ namespace FilterLists.Directory.Infrastructure.Persistence.Queries.Entities; public record FilterListMaintainer { - public int FilterListId { get; init; } + public long FilterListId { get; init; } public FilterList FilterList { get; init; } = null!; - public int MaintainerId { get; init; } + public long MaintainerId { get; init; } public Maintainer Maintainer { get; init; } = null!; } diff --git a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterListSyntax.cs b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterListSyntax.cs index 6552897f9..f8470254f 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterListSyntax.cs +++ b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterListSyntax.cs @@ -7,9 +7,9 @@ namespace FilterLists.Directory.Infrastructure.Persistence.Queries.Entities; public record FilterListSyntax { - public int FilterListId { get; init; } + public long FilterListId { get; init; } public FilterList FilterList { get; init; } = null!; - public int SyntaxId { get; init; } + public long SyntaxId { get; init; } public Syntax Syntax { get; init; } = null!; } diff --git a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterListTag.cs b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterListTag.cs index 404fa21ec..bef1b5c60 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterListTag.cs +++ b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterListTag.cs @@ -7,9 +7,9 @@ namespace FilterLists.Directory.Infrastructure.Persistence.Queries.Entities; public record FilterListTag { - public int FilterListId { get; init; } + public long FilterListId { get; init; } public FilterList FilterList { get; init; } = null!; - public int TagId { get; init; } + public long TagId { get; init; } public Tag Tag { get; init; } = null!; } diff --git a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterListViewUrl.cs b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterListViewUrl.cs index 0812a8727..27638ec57 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterListViewUrl.cs +++ b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterListViewUrl.cs @@ -7,8 +7,8 @@ namespace FilterLists.Directory.Infrastructure.Persistence.Queries.Entities; public record FilterListViewUrl { - public int Id { get; init; } - public int FilterListId { get; init; } + public long Id { get; init; } + public long FilterListId { get; init; } public FilterList FilterList { get; init; } = null!; public short SegmentNumber { get; init; } public short Primariness { get; init; } diff --git a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Fork.cs b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Fork.cs index 1a0421821..348a4a77a 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Fork.cs +++ b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Fork.cs @@ -7,9 +7,9 @@ namespace FilterLists.Directory.Infrastructure.Persistence.Queries.Entities; public record Fork { - public int UpstreamFilterListId { get; init; } + public long UpstreamFilterListId { get; init; } public FilterList UpstreamFilterList { get; init; } = null!; - public int ForkFilterListId { get; init; } + public long ForkFilterListId { get; init; } public FilterList ForkFilterList { get; init; } = null!; } diff --git a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Language.cs b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Language.cs index 2982d6396..5735e694c 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Language.cs +++ b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Language.cs @@ -14,10 +14,11 @@ internal class LanguageTypeConfiguration : AggregateRootTypeConfiguration builder) { - builder.HasKey(l => l.Iso6391); builder.Property(l => l.Iso6391) .IsFixedLength() .HasMaxLength(2); + builder.HasIndex(l => l.Iso6391) + .IsUnique(); builder.HasIndex(l => l.Name) .IsUnique(); builder.HasDataJsonFileAggregate(); diff --git a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/License.cs b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/License.cs index 29fae9af1..c2372d72c 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/License.cs +++ b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/License.cs @@ -5,7 +5,6 @@ namespace FilterLists.Directory.Infrastructure.Persistence.Queries.Entities; public record License : AggregateRoot { - public int Id { get; init; } public string Name { get; init; } = null!; public Uri? Url { get; init; } public bool PermitsModification { get; init; } diff --git a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Maintainer.cs b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Maintainer.cs index 38dbb1b00..e4799e1bb 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Maintainer.cs +++ b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Maintainer.cs @@ -1,11 +1,9 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; +using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace FilterLists.Directory.Infrastructure.Persistence.Queries.Entities; public record Maintainer : AggregateRoot { - public int Id { get; init; } public string Name { get; init; } = null!; public Uri? Url { get; init; } public string? EmailAddress { get; init; } diff --git a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Merge.cs b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Merge.cs index 9b5387aeb..d38fbb9e5 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Merge.cs +++ b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Merge.cs @@ -7,9 +7,9 @@ namespace FilterLists.Directory.Infrastructure.Persistence.Queries.Entities; public record Merge { - public int IncludedInFilterListId { get; init; } + public long IncludedInFilterListId { get; init; } public FilterList IncludedInFilterList { get; init; } = null!; - public int IncludesFilterListId { get; init; } + public long IncludesFilterListId { get; init; } public FilterList IncludesFilterList { get; init; } = null!; } diff --git a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Software.cs b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Software.cs index 3d4fa9ed0..2d4558f4c 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Software.cs +++ b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Software.cs @@ -5,7 +5,6 @@ namespace FilterLists.Directory.Infrastructure.Persistence.Queries.Entities; public record Software : AggregateRoot { - public int Id { get; init; } public string Name { get; init; } = null!; public string? Description { get; init; } public Uri? HomeUrl { get; init; } diff --git a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/SoftwareSyntax.cs b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/SoftwareSyntax.cs index 6b1db5d83..3ef75157e 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/SoftwareSyntax.cs +++ b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/SoftwareSyntax.cs @@ -7,9 +7,9 @@ namespace FilterLists.Directory.Infrastructure.Persistence.Queries.Entities; public record SoftwareSyntax { - public int SoftwareId { get; init; } + public long SoftwareId { get; init; } public Software Software { get; init; } = null!; - public int SyntaxId { get; init; } + public long SyntaxId { get; init; } public Syntax Syntax { get; init; } = null!; } diff --git a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Syntax.cs b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Syntax.cs index 5a8adcf89..07b6a4ea7 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Syntax.cs +++ b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Syntax.cs @@ -1,11 +1,9 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; +using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace FilterLists.Directory.Infrastructure.Persistence.Queries.Entities; public record Syntax : AggregateRoot { - public int Id { get; init; } public string Name { get; init; } = null!; public string? Description { get; init; } public Uri? Url { get; init; } diff --git a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Tag.cs b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Tag.cs index 1f25c6e26..d5c82efaf 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Tag.cs +++ b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Tag.cs @@ -1,11 +1,9 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; +using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace FilterLists.Directory.Infrastructure.Persistence.Queries.Entities; public record Tag : AggregateRoot { - public int Id { get; init; } public string Name { get; init; } = null!; public string? Description { get; init; } public IEnumerable FilterListTags { get; init; } = new HashSet();