Skip to content

Commit 07508db

Browse files
authored
add cover index (#1610)
1 parent c822438 commit 07508db

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/JoinRpg.Dal.Impl/Migrations/202110241232502_RequireClaimResponsible.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,23 @@ UPDATE Claims
1313
FROM
1414
Claims
1515
LEFT JOIN ProjectAcls ACL ON Claims.ProjectId = ACL.ProjectId AND ACL.IsOwner = 1
16-
WHERE[ResponsibleMasterUserId] is null");
16+
WHERE [ResponsibleMasterUserId] is null");
1717
Sql("DROP INDEX IF EXISTS [nci_wi_Claims_DD27A24D517BFF9AFEC7C6C5C8FCCA84] ON [dbo].[Claims]");
18+
Sql("DROP INDEX IF EXISTS [Claim_Cover_index] ON [dbo].[Claims]");
1819
DropForeignKey("dbo.Claims", "ResponsibleMasterUserId", "dbo.Users");
1920
DropIndex("dbo.Claims", new[] { "ResponsibleMasterUserId" });
2021
AlterColumn("dbo.Claims", "ResponsibleMasterUserId", c => c.Int(nullable: false));
2122
CreateIndex("dbo.Claims", "ResponsibleMasterUserId");
2223

23-
Sql(@"CREATE NONCLUSTERED INDEX [nci_wi_Claims_DD27A24D517BFF9AFEC7C6C5C8FCCA84] ON [dbo].[Claims]
24+
Sql(@"
25+
CREATE NONCLUSTERED INDEX [Claim_Cover_index] ON [dbo].[Claims]
2426
(
2527
[ProjectId] ASC,
2628
[ClaimStatus] ASC
2729
)
28-
INCLUDE([CharacterGroupId],[CharacterId],[CommentDiscussionId],[CreateDate],[CurrentFee],[JsonData],[LastUpdateDateTime],[MasterAcceptedDate],[MasterDeclinedDate],[PlayerAcceptedDate],[PlayerDeclinedDate],[PlayerUserId],[ResponsibleMasterUserId]) WITH (STATISTICS_NORECOMPUTE = OFF, DROP_EXISTING = OFF, ONLINE = OFF) ON [PRIMARY]
29-
GO");
30+
INCLUDE([AccommodationRequest_Id],[CharacterGroupId],[CharacterId],[CheckInDate],[ClaimDenialStatus],[CommentDiscussionId],[CreateDate],[CurrentFee],[JsonData],[LastUpdateDateTime],[MasterAcceptedDate],[MasterDeclinedDate],[PlayerAcceptedDate],[PlayerDeclinedDate],[PlayerUserId],[PreferentialFeeUser],[ResponsibleMasterUserId],[LastMasterCommentAt],[LastMasterCommentBy_Id],[LastPlayerCommentAt],[LastVisibleMasterCommentAt],[LastVisibleMasterCommentBy_Id]) WITH (STATISTICS_NORECOMPUTE = OFF, DROP_EXISTING = OFF, ONLINE = OFF) ON [PRIMARY]
31+
");
32+
3033
AddForeignKey("dbo.Claims", "ResponsibleMasterUserId", "dbo.Users", "UserId", cascadeDelete: true);
3134
}
3235

0 commit comments

Comments
 (0)