Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: the migration here shows up as a move in this PR because I had to delete the previous one that was not included in the snapshot for the migration that followed it. Deleting it and including it in this migration was the simplest path to making them consistent.

Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,33 @@
namespace ServiceControl.Persistence.EFCore.PostgreSql.Migrations
{
/// <inheritdoc />
public partial class AddCustomChecks : Migration
public partial class AddArchiveEntities : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "archive_operations",
columns: table => new
{
request_id = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false),
archive_type = table.Column<int>(type: "integer", nullable: false),
operation_type = table.Column<int>(type: "integer", nullable: false),
group_name = table.Column<string>(type: "text", nullable: false),
total_number_of_messages = table.Column<int>(type: "integer", nullable: false),
number_of_messages_processed = table.Column<int>(type: "integer", nullable: false),
number_of_batches = table.Column<int>(type: "integer", nullable: false),
current_batch = table.Column<int>(type: "integer", nullable: false),
started = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
initiated_by_id = table.Column<string>(type: "character varying(450)", maxLength: 450, nullable: true),
initiated_by_name = table.Column<string>(type: "character varying(450)", maxLength: 450, nullable: true),
operation_id = table.Column<string>(type: "character varying(450)", maxLength: 450, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("pk_archive_operations", x => new { x.request_id, x.archive_type, x.operation_type });
});

migrationBuilder.CreateTable(
name: "custom_checks",
columns: table => new
Expand All @@ -30,6 +52,11 @@ protected override void Up(MigrationBuilder migrationBuilder)
table.PrimaryKey("pk_custom_checks", x => x.id);
});

migrationBuilder.CreateIndex(
name: "ix_archive_operations_started",
table: "archive_operations",
column: "started");

migrationBuilder.CreateIndex(
name: "ix_custom_checks_reported_at",
table: "custom_checks",
Expand All @@ -44,6 +71,9 @@ protected override void Up(MigrationBuilder migrationBuilder)
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "archive_operations");

migrationBuilder.DropTable(
name: "custom_checks");
}
Expand Down
Loading
Loading