48 lines
1.5 KiB
C#
48 lines
1.5 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace MP.Data.Migrations.MoonPro_Utils
|
|
{
|
|
public partial class UpdateAggrStat : Migration
|
|
{
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropIndex(
|
|
name: "idx_statsaggr_env_hour",
|
|
table: "stats_aggr");
|
|
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "MachineId",
|
|
table: "stats_aggr",
|
|
type: "nvarchar(450)",
|
|
nullable: true);
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "idx_statsaggr_env_mach_hour",
|
|
table: "stats_aggr",
|
|
columns: new[] { "Destination", "MachineId", "Hour" },
|
|
unique: true,
|
|
filter: "[Destination] IS NOT NULL AND [MachineId] IS NOT NULL");
|
|
}
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropIndex(
|
|
name: "idx_statsaggr_env_mach_hour",
|
|
table: "stats_aggr");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "MachineId",
|
|
table: "stats_aggr");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "idx_statsaggr_env_hour",
|
|
table: "stats_aggr",
|
|
columns: new[] { "Destination", "Hour" },
|
|
unique: true,
|
|
filter: "[Destination] IS NOT NULL");
|
|
}
|
|
}
|
|
}
|