Skip to content

Commit

Permalink
Add indices according to auto recommendations
Browse files Browse the repository at this point in the history
  • Loading branch information
skofman1 committed Sep 9, 2016
1 parent deac8c3 commit aae66e0
Show file tree
Hide file tree
Showing 7 changed files with 358 additions and 0 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

@@ -0,0 +1,17 @@
namespace NuGetGallery.Migrations
{
using System.Data.Entity.Migrations;

public partial class AddIndexCredentialExpires : DbMigration
{
public override void Up()
{
Sql("IF NOT EXISTS(SELECT * FROM sys.indexes WHERE name = 'nci_wi_Credentials_Type_Expires' AND object_id = OBJECT_ID('Credentials')) CREATE NONCLUSTERED INDEX [nci_wi_Credentials_Type_Expires] ON [dbo].[Credentials] ([Type], [Expires]) INCLUDE ([Created], [UserKey]) WITH (ONLINE = ON)");
}

public override void Down()
{
Sql("DROP INDEX [nci_wi_Credentials_Type_Expires] ON [dbo].[Credentials]");
}
}
}

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions src/NuGetGallery/Migrations/201609092255576_AddIndexUsersEmail.cs
@@ -0,0 +1,17 @@
namespace NuGetGallery.Migrations
{
using System.Data.Entity.Migrations;

public partial class AddIndexUsersEmail : DbMigration
{
public override void Up()
{
Sql("IF NOT EXISTS(SELECT * FROM sys.indexes WHERE name = 'nci_wi_Users_EmailAllowed' AND object_id = OBJECT_ID('Users')) CREATE NONCLUSTERED INDEX [nci_wi_Users_EmailAllowed] ON [dbo].[Users] ([EmailAllowed], [EmailAddress]) INCLUDE ([Key], [Username]) WITH (ONLINE = ON)");
}

public override void Down()
{
Sql("DROP INDEX [nci_wi_Users_EmailAllowed] ON [dbo].[Users]");
}
}
}
126 changes: 126 additions & 0 deletions src/NuGetGallery/Migrations/201609092255576_AddIndexUsersEmail.resx

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions src/NuGetGallery/NuGetGallery.csproj
Expand Up @@ -789,6 +789,14 @@
<Compile Include="Migrations\201608251939567_AddPackageTypes.Designer.cs">
<DependentUpon>201608251939567_AddPackageTypes.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\201609092252096_AddIndexCredentialExpires.cs" />
<Compile Include="Migrations\201609092252096_AddIndexCredentialExpires.Designer.cs">
<DependentUpon>201609092252096_AddIndexCredentialExpires.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\201609092255576_AddIndexUsersEmail.cs" />
<Compile Include="Migrations\201609092255576_AddIndexUsersEmail.Designer.cs">
<DependentUpon>201609092255576_AddIndexUsersEmail.cs</DependentUpon>
</Compile>
<Compile Include="OData\Conventions\CompositeODataKeyHelper.cs" />
<Compile Include="OData\Conventions\EntitySetPropertyRoutingConvention.cs" />
<Compile Include="OData\ODataServiceVersionHeaderPropagatingBatchHandler.cs" />
Expand Down Expand Up @@ -1903,6 +1911,12 @@
<EmbeddedResource Include="Migrations\201608251939567_AddPackageTypes.resx">
<DependentUpon>201608251939567_AddPackageTypes.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Migrations\201609092252096_AddIndexCredentialExpires.resx">
<DependentUpon>201609092252096_AddIndexCredentialExpires.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Migrations\201609092255576_AddIndexUsersEmail.resx">
<DependentUpon>201609092255576_AddIndexUsersEmail.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Strings.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Strings.Designer.cs</LastGenOutput>
Expand Down

0 comments on commit aae66e0

Please sign in to comment.