using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Tau.Acuvim.Portal.Migrations
{
///
public partial class AddReceivedAtAndPushState : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn(
name: "ReceivedAt",
schema: "monitoring",
table: "PowerMeasurements",
type: "timestamp with time zone",
nullable: false,
defaultValueSql: "NOW()");
migrationBuilder.CreateTable(
name: "FleetPushState",
schema: "app",
columns: table => new
{
ResourceType = table.Column(type: "character varying(20)", maxLength: 20, nullable: false),
LastCursor = table.Column(type: "timestamp with time zone", nullable: true),
LastSyncedAt = table.Column(type: "timestamp with time zone", nullable: true),
LastError = table.Column(type: "character varying(500)", maxLength: 500, nullable: true),
ConsecutiveFailures = table.Column(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_FleetPushState", x => x.ResourceType);
});
migrationBuilder.CreateIndex(
name: "IX_PowerMeasurements_ReceivedAt",
schema: "monitoring",
table: "PowerMeasurements",
column: "ReceivedAt");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "FleetPushState",
schema: "app");
migrationBuilder.DropIndex(
name: "IX_PowerMeasurements_ReceivedAt",
schema: "monitoring",
table: "PowerMeasurements");
migrationBuilder.DropColumn(
name: "ReceivedAt",
schema: "monitoring",
table: "PowerMeasurements");
}
}
}