-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fc27d78
commit cb56a32
Showing
3 changed files
with
38 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
namespace Tyger.ControlPlane.Database.Migrations; | ||
|
||
public class Migrator4 : Migrator | ||
{ | ||
public override async Task Apply(Npgsql.NpgsqlDataSource dataSource, ILogger logger, CancellationToken cancellationToken) | ||
{ | ||
using (var cmd = dataSource.CreateCommand( | ||
""" | ||
CREATE INDEX IF NOT EXISTS idx_runs_created_at_id_status | ||
ON runs (created_at, id) | ||
INCLUDE (status) | ||
""")) | ||
{ | ||
await cmd.ExecuteNonQueryAsync(cancellationToken); | ||
} | ||
|
||
using (var cmd = dataSource.CreateCommand( | ||
""" | ||
DROP INDEX IF EXISTS idx_runs_created_at | ||
""")) | ||
{ | ||
await cmd.ExecuteNonQueryAsync(cancellationToken); | ||
} | ||
} | ||
} |
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