-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added index for MetadataEntries on Key Include Value for joins
- Loading branch information
Ovan Crone
committed
Jan 11, 2019
1 parent
babb80c
commit c6ec807
Showing
4 changed files
with
156 additions
and
0 deletions.
There are no files selected for viewing
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
118 changes: 118 additions & 0 deletions
118
...rkCore.Migrations.SqlServer/Migrations/20190111035035_IndexMetadataEntriesKey.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
33 changes: 33 additions & 0 deletions
33
...tyFrameworkCore.Migrations.SqlServer/Migrations/20190111035035_IndexMetadataEntriesKey.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,33 @@ | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
namespace REstate.EntityFrameworkCore.Migrations.SqlServer.Migrations | ||
{ | ||
public partial class IndexMetadataEntriesKey : Migration | ||
{ | ||
private const string SqlServer = "Microsoft.EntityFrameworkCore.SqlServer"; | ||
|
||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
if (migrationBuilder.ActiveProvider == SqlServer) | ||
{ | ||
migrationBuilder.Sql(@"CREATE NONCLUSTERED INDEX IX_MetadataEntries_Key | ||
ON [dbo].[MetadataEntries] ([Key]) | ||
INCLUDE ([Value])"); | ||
} | ||
else | ||
{ | ||
migrationBuilder.CreateIndex( | ||
name: "IX_MetadataEntries_Key", | ||
table: "MetadataEntries", | ||
column: "Key"); | ||
} | ||
} | ||
|
||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropIndex( | ||
name: "IX_MetadataEntries_Key", | ||
table: "MetadataEntries"); | ||
} | ||
} | ||
} |
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