-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change index type from "btree" to "hash" for text columns
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
8f92e8c
commit dad5a1d
Showing
12 changed files
with
1,566 additions
and
7 deletions.
There are no files selected for viewing
919 changes: 919 additions & 0 deletions
919
....Infrastructure.Database.Postgres/Migrations/20240830164312_HashIndexesForIds.Designer.cs
Large diffs are not rendered by default.
Oops, something went wrong.
64 changes: 64 additions & 0 deletions
64
...c/Devices.Infrastructure.Database.Postgres/Migrations/20240830164312_HashIndexesForIds.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,64 @@ | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
#nullable disable | ||
|
||
namespace Backbone.Modules.Devices.Infrastructure.Database.Postgres.Migrations | ||
{ | ||
/// <inheritdoc /> | ||
public partial class HashIndexesForIds : Migration | ||
{ | ||
/// <inheritdoc /> | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropIndex( | ||
name: "IX_Identities_ClientId", | ||
schema: "Devices", | ||
table: "Identities"); | ||
|
||
migrationBuilder.DropIndex( | ||
name: "IX_Identities_TierId", | ||
schema: "Devices", | ||
table: "Identities"); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_Identities_ClientId", | ||
schema: "Devices", | ||
table: "Identities", | ||
column: "ClientId") | ||
.Annotation("Npgsql:IndexMethod", "hash"); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_Identities_TierId", | ||
schema: "Devices", | ||
table: "Identities", | ||
column: "TierId") | ||
.Annotation("Npgsql:IndexMethod", "hash"); | ||
} | ||
|
||
/// <inheritdoc /> | ||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropIndex( | ||
name: "IX_Identities_ClientId", | ||
schema: "Devices", | ||
table: "Identities"); | ||
|
||
migrationBuilder.DropIndex( | ||
name: "IX_Identities_TierId", | ||
schema: "Devices", | ||
table: "Identities"); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_Identities_ClientId", | ||
schema: "Devices", | ||
table: "Identities", | ||
column: "ClientId"); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_Identities_TierId", | ||
schema: "Devices", | ||
table: "Identities", | ||
column: "TierId"); | ||
} | ||
} | ||
} |
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
202 changes: 202 additions & 0 deletions
202
...Database.Postgres/Migrations/20240830164612_HashIndexForMessageCreatedByField.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
41 changes: 41 additions & 0 deletions
41
...tructure.Database.Postgres/Migrations/20240830164612_HashIndexForMessageCreatedByField.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,41 @@ | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
#nullable disable | ||
|
||
namespace Backbone.Modules.Messages.Infrastructure.Database.Postgres.Migrations | ||
{ | ||
/// <inheritdoc /> | ||
public partial class HashIndexForMessageCreatedByField : Migration | ||
{ | ||
/// <inheritdoc /> | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropIndex( | ||
name: "IX_Messages_CreatedBy", | ||
schema: "Messages", | ||
table: "Messages"); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_Messages_CreatedBy", | ||
schema: "Messages", | ||
table: "Messages", | ||
column: "CreatedBy") | ||
.Annotation("Npgsql:IndexMethod", "hash"); | ||
} | ||
|
||
/// <inheritdoc /> | ||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropIndex( | ||
name: "IX_Messages_CreatedBy", | ||
schema: "Messages", | ||
table: "Messages"); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_Messages_CreatedBy", | ||
schema: "Messages", | ||
table: "Messages", | ||
column: "CreatedBy"); | ||
} | ||
} | ||
} |
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.