fix(backend): add missing domain foreign keys
This commit is contained in:
@@ -1359,6 +1359,12 @@ namespace Socialize.Api.Migrations
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("CampaignId");
|
||||
|
||||
b.HasIndex("ClientId");
|
||||
|
||||
b.HasIndex("ContentItemId");
|
||||
|
||||
b.HasIndex("LastActivityAt");
|
||||
|
||||
b.HasIndex("ReporterUserId");
|
||||
@@ -1856,6 +1862,83 @@ namespace Socialize.Api.Migrations
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Socialize.Api.Modules.Approvals.Data.ApprovalDecision", b =>
|
||||
{
|
||||
b.HasOne("Socialize.Api.Modules.Approvals.Data.ApprovalRequest", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("ApprovalRequestId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Socialize.Api.Modules.Approvals.Data.ApprovalRequest", b =>
|
||||
{
|
||||
b.HasOne("Socialize.Api.Modules.ContentItems.Data.ContentItem", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("ContentItemId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Socialize.Api.Modules.Approvals.Data.ApprovalWorkflowInstance", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("WorkflowInstanceId")
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
b.HasOne("Socialize.Api.Modules.Workspaces.Data.Workspace", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("WorkspaceId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Socialize.Api.Modules.Approvals.Data.ApprovalWorkflowInstance", b =>
|
||||
{
|
||||
b.HasOne("Socialize.Api.Modules.ContentItems.Data.ContentItem", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("ContentItemId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Socialize.Api.Modules.Workspaces.Data.Workspace", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("WorkspaceId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Socialize.Api.Modules.Approvals.Data.WorkspaceApprovalStepConfiguration", b =>
|
||||
{
|
||||
b.HasOne("Socialize.Api.Modules.Workspaces.Data.Workspace", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("WorkspaceId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Socialize.Api.Modules.Assets.Data.Asset", b =>
|
||||
{
|
||||
b.HasOne("Socialize.Api.Modules.ContentItems.Data.ContentItem", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("ContentItemId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Socialize.Api.Modules.Workspaces.Data.Workspace", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("WorkspaceId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Socialize.Api.Modules.Assets.Data.AssetRevision", b =>
|
||||
{
|
||||
b.HasOne("Socialize.Api.Modules.Assets.Data.Asset", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("AssetId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Socialize.Api.Modules.CalendarIntegrations.Data.CalendarEvent", b =>
|
||||
{
|
||||
b.HasOne("Socialize.Api.Modules.CalendarIntegrations.Data.CalendarSource", null)
|
||||
@@ -1865,6 +1948,104 @@ namespace Socialize.Api.Migrations
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Socialize.Api.Modules.Campaigns.Data.Campaign", b =>
|
||||
{
|
||||
b.HasOne("Socialize.Api.Modules.Clients.Data.Client", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("ClientId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Socialize.Api.Modules.Workspaces.Data.Workspace", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("WorkspaceId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Socialize.Api.Modules.Channels.Data.Channel", b =>
|
||||
{
|
||||
b.HasOne("Socialize.Api.Modules.Workspaces.Data.Workspace", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("WorkspaceId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Socialize.Api.Modules.Clients.Data.Client", b =>
|
||||
{
|
||||
b.HasOne("Socialize.Api.Modules.Workspaces.Data.Workspace", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("WorkspaceId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Socialize.Api.Modules.Comments.Data.Comment", b =>
|
||||
{
|
||||
b.HasOne("Socialize.Api.Modules.ContentItems.Data.ContentItem", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("ContentItemId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Socialize.Api.Modules.Comments.Data.Comment", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("ParentCommentId")
|
||||
.OnDelete(DeleteBehavior.Restrict);
|
||||
|
||||
b.HasOne("Socialize.Api.Modules.Workspaces.Data.Workspace", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("WorkspaceId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Socialize.Api.Modules.ContentItems.Data.ContentItem", b =>
|
||||
{
|
||||
b.HasOne("Socialize.Api.Modules.Campaigns.Data.Campaign", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("CampaignId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Socialize.Api.Modules.Clients.Data.Client", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("ClientId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Socialize.Api.Modules.Workspaces.Data.Workspace", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("WorkspaceId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Socialize.Api.Modules.ContentItems.Data.ContentItemActivityEntry", b =>
|
||||
{
|
||||
b.HasOne("Socialize.Api.Modules.ContentItems.Data.ContentItem", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("ContentItemId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("Socialize.Api.Modules.Workspaces.Data.Workspace", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("WorkspaceId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Socialize.Api.Modules.ContentItems.Data.ContentItemRevision", b =>
|
||||
{
|
||||
b.HasOne("Socialize.Api.Modules.ContentItems.Data.ContentItem", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("ContentItemId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Socialize.Api.Modules.Feedback.Data.FeedbackActivityEntry", b =>
|
||||
{
|
||||
b.HasOne("Socialize.Api.Modules.Feedback.Data.FeedbackReport", "FeedbackReport")
|
||||
@@ -1887,6 +2068,29 @@ namespace Socialize.Api.Migrations
|
||||
b.Navigation("FeedbackReport");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Socialize.Api.Modules.Feedback.Data.FeedbackReport", b =>
|
||||
{
|
||||
b.HasOne("Socialize.Api.Modules.Campaigns.Data.Campaign", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("CampaignId")
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
|
||||
b.HasOne("Socialize.Api.Modules.Clients.Data.Client", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("ClientId")
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
|
||||
b.HasOne("Socialize.Api.Modules.ContentItems.Data.ContentItem", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("ContentItemId")
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
|
||||
b.HasOne("Socialize.Api.Modules.Workspaces.Data.Workspace", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("WorkspaceId")
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Socialize.Api.Modules.Feedback.Data.FeedbackScreenshot", b =>
|
||||
{
|
||||
b.HasOne("Socialize.Api.Modules.Feedback.Data.FeedbackReport", "FeedbackReport")
|
||||
@@ -1909,6 +2113,20 @@ namespace Socialize.Api.Migrations
|
||||
b.Navigation("FeedbackReport");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Socialize.Api.Modules.Notifications.Data.NotificationEvent", b =>
|
||||
{
|
||||
b.HasOne("Socialize.Api.Modules.ContentItems.Data.ContentItem", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("ContentItemId")
|
||||
.OnDelete(DeleteBehavior.SetNull);
|
||||
|
||||
b.HasOne("Socialize.Api.Modules.Workspaces.Data.Workspace", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("WorkspaceId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Socialize.Api.Modules.Organizations.Data.OrganizationMembership", b =>
|
||||
{
|
||||
b.HasOne("Socialize.Api.Modules.Organizations.Data.Organization", null)
|
||||
@@ -1927,6 +2145,15 @@ namespace Socialize.Api.Migrations
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Socialize.Api.Modules.Workspaces.Data.WorkspaceInvite", b =>
|
||||
{
|
||||
b.HasOne("Socialize.Api.Modules.Workspaces.Data.Workspace", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("WorkspaceId")
|
||||
.OnDelete(DeleteBehavior.Restrict)
|
||||
.IsRequired();
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Socialize.Api.Modules.Feedback.Data.FeedbackReport", b =>
|
||||
{
|
||||
b.Navigation("ActivityEntries");
|
||||
|
||||
Reference in New Issue
Block a user