-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
781 additions
and
173 deletions.
There are no files selected for viewing
24 changes: 0 additions & 24 deletions
24
src/BUTR.CrashReport.Server.Base/Contexts/Config/FileEntityConfiguration.cs
This file was deleted.
Oops, something went wrong.
24 changes: 0 additions & 24 deletions
24
src/BUTR.CrashReport.Server.Base/Contexts/Config/JsonEntityConfiguration.cs
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
src/BUTR.CrashReport.Server.Base/Models/Database/FileEntity.cs
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
src/BUTR.CrashReport.Server.Base/Models/Database/JsonEntity.cs
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
23 changes: 23 additions & 0 deletions
23
src/BUTR.CrashReport.Server.Persistence/Contexts/Config/HtmlEntityConfiguration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using BUTR.CrashReport.Server.Models.Database; | ||
|
||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||
|
||
namespace BUTR.CrashReport.Server.Contexts.Config; | ||
|
||
public class HtmlEntityConfiguration : BaseEntityConfiguration<HtmlEntity> | ||
{ | ||
protected override void ConfigureModel(EntityTypeBuilder<HtmlEntity> builder) | ||
{ | ||
builder.Property(x => x.CrashReportId).HasColumnName("crash_report_id"); | ||
builder.Property(x => x.DataCompressed).HasColumnName("data_compressed"); | ||
builder.ToTable("html_entity").HasKey(x => x.CrashReportId).HasName("html_entity_pkey"); | ||
|
||
builder.HasOne(x => x.Id) | ||
.WithOne() | ||
.HasForeignKey<IdEntity>(x => x.CrashReportId) | ||
.HasPrincipalKey<HtmlEntity>(x => x.CrashReportId) | ||
.OnDelete(DeleteBehavior.Cascade) | ||
.HasConstraintName("html_entity_id_entity_fkey"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/BUTR.CrashReport.Server.Persistence/Contexts/Config/JsonEntityConfiguration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using BUTR.CrashReport.Server.Models.Database; | ||
|
||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||
|
||
namespace BUTR.CrashReport.Server.Contexts.Config; | ||
|
||
public class JsonEntityConfiguration : BaseEntityConfiguration<JsonEntity> | ||
{ | ||
protected override void ConfigureModel(EntityTypeBuilder<JsonEntity> builder) | ||
{ | ||
builder.Property(x => x.CrashReportId).HasColumnName("crash_report_id"); | ||
builder.Property(x => x.Json).HasColumnName("data").HasColumnType("jsonb"); | ||
builder.ToTable("json_entity").HasKey(x => x.CrashReportId); | ||
|
||
builder.HasOne(x => x.Id) | ||
.WithOne() | ||
.HasForeignKey<IdEntity>(x => x.CrashReportId) | ||
.HasPrincipalKey<JsonEntity>(x => x.CrashReportId) | ||
.OnDelete(DeleteBehavior.Cascade) | ||
.HasConstraintName("json_entity_id_entity_fkey"); | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
src/BUTR.CrashReport.Server.Persistence/Contexts/Config/ReportEntityConfiguration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using BUTR.CrashReport.Server.Models.Database; | ||
|
||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||
|
||
namespace BUTR.CrashReport.Server.Contexts.Config; | ||
|
||
public class ReportEntityConfiguration : BaseEntityConfiguration<ReportEntity> | ||
{ | ||
protected override void ConfigureModel(EntityTypeBuilder<ReportEntity> builder) | ||
{ | ||
builder.Property(x => x.CrashReportId).HasColumnName("crash_report_id"); | ||
builder.Property(x => x.Tenant).HasColumnName("tenant"); | ||
builder.Property(x => x.Version).HasColumnName("version"); | ||
builder.Property(x => x.Created).HasColumnName("created"); | ||
builder.ToTable("report_entity").HasKey(x => x.CrashReportId).HasName("report_entity_pkey"); | ||
|
||
builder.HasOne(x => x.Id) | ||
.WithOne(x => x.Report) | ||
.HasForeignKey<IdEntity>(x => x.CrashReportId) | ||
.HasPrincipalKey<ReportEntity>(x => x.CrashReportId) | ||
.OnDelete(DeleteBehavior.Cascade) | ||
.HasConstraintName("report_entity_id_entity_fkey"); | ||
|
||
builder.HasOne(x => x.Html) | ||
.WithOne(x => x.Report) | ||
.HasForeignKey<HtmlEntity>(x => x.CrashReportId) | ||
.HasPrincipalKey<ReportEntity>(x => x.CrashReportId) | ||
.OnDelete(DeleteBehavior.Cascade) | ||
.HasConstraintName("report_entity_html_entity_fkey"); | ||
|
||
builder.HasOne(x => x.Json) | ||
.WithOne(x => x.Report) | ||
.HasForeignKey<JsonEntity>(x => x.CrashReportId) | ||
.HasPrincipalKey<ReportEntity>(x => x.CrashReportId) | ||
.OnDelete(DeleteBehavior.Cascade) | ||
.HasConstraintName("report_entity_json_entity_fkey"); | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions
12
src/BUTR.CrashReport.Server.Persistence/Models/Database/HtmlEntity.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System; | ||
|
||
namespace BUTR.CrashReport.Server.Models.Database; | ||
|
||
public sealed record HtmlEntity : IEntity | ||
{ | ||
public required Guid CrashReportId { get; set; } | ||
public required byte[] DataCompressed { get; set; } | ||
|
||
public ReportEntity? Report { get; set; } | ||
public IdEntity? Id { get; set; } | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/BUTR.CrashReport.Server.Persistence/Models/Database/JsonEntity.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System; | ||
|
||
namespace BUTR.CrashReport.Server.Models.Database; | ||
|
||
public sealed record JsonEntity : IEntity | ||
{ | ||
public required Guid CrashReportId { get; set; } | ||
public required string Json { get; set; } | ||
|
||
public ReportEntity? Report { get; set; } | ||
public IdEntity? Id { get; set; } | ||
} |
15 changes: 15 additions & 0 deletions
15
src/BUTR.CrashReport.Server.Persistence/Models/Database/ReportEntity.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System; | ||
|
||
namespace BUTR.CrashReport.Server.Models.Database; | ||
|
||
public sealed record ReportEntity : IEntity | ||
{ | ||
public required Guid CrashReportId { get; set; } | ||
public required byte Tenant { get; set; } | ||
public required byte Version { get; set; } | ||
public required DateTime Created { get; set; } | ||
|
||
public IdEntity? Id { get; set; } | ||
public HtmlEntity? Html { get; set; } | ||
public JsonEntity? Json { get; set; } | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.